awx-operator
awx-operator copied to clipboard
Allow users to define custom config for Redis Container
Allow users to define custom config for Redis Container
ISSUE TYPE
- New or Enhanced Feature
ADDITIONAL INFORMATION
This will address the following issue #1171
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 I will provide some steps
@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
@fosterseth let me know what you think of above inputs or commands.
@fosterseth @rooftopcellist just checking to see if you can take a look at it
@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 i have done the rebasing.Please let me know how it looks from your end.
@rooftopcellist Updated README with example and also applied suggested changes
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 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 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).
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 thanks for checking our our PR and provide valuable feedback