awx-operator icon indicating copy to clipboard operation
awx-operator copied to clipboard

Allow users to define custom config for Redis Container

Open rakesh561 opened this issue 1 year ago • 13 comments

Allow users to define custom config for Redis Container

ISSUE TYPE
  • New or Enhanced Feature
ADDITIONAL INFORMATION

This will address the following issue #1171

rakesh561 avatar May 22 '23 16:05 rakesh561

thanks for this PR, this sounds like the right approach

Does this allow users to drop in a redis.conf file? then the supplied redis command/args would start the redis instance from that config?

can you provide some steps as comment on the PR on what that would look like?

fosterseth avatar May 24 '23 18:05 fosterseth

@fosterseth I will provide some steps

rakesh561 avatar May 24 '23 19:05 rakesh561

@fosterseth any one who wants to customize redis container can try out following steps.It would be nice if we can run these tests through github actions if possible

apiVersion: v1 kind: ConfigMap metadata: name: redis-config namespace: awx data: redis.conf: | daemonize yes unixsocket /var/run/redis/redis.sock unixsocketperm 777 port 0 bind 127.0.0.1 maxmemory 2mb maxmemory-policy allkeys-lru


spec:
...
  extra_volumes: |
    - name: ansible-cfg
      configMap:
        defaultMode: 420
        items:
          - key: redis.conf
            path: redis.cong
        name: redis-config


  redis_extra_volume_mounts: |
    - name: redis.cfg
      mountPath: /etc/redis.conf
      subPath: redis.conf

  redis_command:
   chmod 755 /etc/redis.conf
   redis-cli start 

 redis_extra_env:
      - name: foo
         value: bar 

rakesh561 avatar May 26 '23 14:05 rakesh561

@fosterseth let me know what you think of above inputs or commands.

rakesh561 avatar Jun 01 '23 16:06 rakesh561

@fosterseth @rooftopcellist just checking to see if you can take a look at it

rakesh561 avatar Jun 22 '23 18:06 rakesh561

@rakesh561 Thank you so much for your contribution! It looks like we have some merge conflicts. Would you mind rebasing this PR for us?

djyasin avatar Jun 28 '23 18:06 djyasin

@djyasin i have done the rebasing.Please let me know how it looks from your end.

rakesh561 avatar Jun 28 '23 19:06 rakesh561

@rooftopcellist Updated README with example and also applied suggested changes

rakesh561 avatar Jun 29 '23 01:06 rakesh561

https://github.com/ansible/awx-operator/pull/1695/files try this out and let me know if this implementation allow you to ovverride the things you want

TheRealHaoLiu avatar Jan 24 '24 22:01 TheRealHaoLiu

@TheRealHaoLiu and @kurokobo , neither of your PR's #1695 or #1697 appear to address modifying the redis.conf file that is mounted to the Redis container. Not everything can be defined as an environment variable, so being able to customize the container specs doesn't necessarily help here.

What we need is a way to modify or replace the settings in redis.conf in the configmap created by the operator, perhaps by adding something like redis_extra_settings: to the awx CRD. Then it could do a dynaconf merge similar to how extra_settings: works.

Denney-tech avatar Jan 29 '24 15:01 Denney-tech

@Denney-tech Yes, you are correct. My and Hao's PRs are focused on pod spec customization, not configmap customization. As you mentiond changing conf file requires a different way (not sure whether to continue that in this PR or create it as a separate PR).

kurokobo avatar Jan 29 '24 16:01 kurokobo

Whatever you brilliant devs think would work the best. :)

Just wanted to reply to Hao's comment that his PR, and in turn yours, didn't satisfy the objective of this PR.

Denney-tech avatar Jan 29 '24 16:01 Denney-tech

@Denney-tech thanks for checking our our PR and provide valuable feedback

TheRealHaoLiu avatar Jan 31 '24 14:01 TheRealHaoLiu