Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PoC] using kustomize to provide flexible override to awx deployments #1695

Draft
wants to merge 2 commits into
base: devel
Choose a base branch
from

Conversation

TheRealHaoLiu
Copy link
Member

SUMMARY

example

task_pod_spec_kustomization: |
  containers:
  - name: extra-container
    image: quay.io/ansible/awx-ee:latest
    args:
    - /bin/sh
    - -c
    - |
      echo "Hello from extra-container"
      sleep 3600
ISSUE TYPE
  • Breaking Change
  • New or Enhanced Feature
  • Bug, Docs Fix or other nominal change
ADDITIONAL INFORMATION

@TheRealHaoLiu
Copy link
Member Author

@kurokobo
Copy link
Contributor

I am interested in this but I don't know if using kustomize is the best way to achieve overriding.
Also I don't want to use massive YAML multiline strings since it ignores syntax highlighting and make it hard to read.
Will investigate similar implementation.

@kurokobo
Copy link
Contributor

kurokobo commented Jan 25, 2024

Thanks for implementing this, I have not tested well but by using kustomize like your PR it's hard to add custom env to specific container for example.

I'm considering to use combine and community.general.lists_mergeby filter. Will try to create an alternative PR as a PoC.

@kurokobo
Copy link
Contributor

My idea: #1697

@TheRealHaoLiu TheRealHaoLiu changed the title PoC using kustomize to provide flexible override to awx deployments [PoC] using kustomize to provide flexible override to awx deployments Jan 30, 2024
@TheRealHaoLiu TheRealHaoLiu marked this pull request as draft February 5, 2024 14:21
@kurokobo
Copy link
Contributor

but by using kustomize like your PR it's hard to add custom env to specific container for example

Ah ignore my comment due to lack of my understanding 😞
Strategic Merge by Kustomize can merge dict for each containers by using name as merge key, so we can add env, volumeMounts, etc. to pre-deifined containers such as awx-task, redis, etc.
Kustomize way may be safer than merging by combine or lists_mergeby that implemented in my PR #1697.

So this PR is enough for most use-cases I think. It should be better if we can define *_pod_spec_kustomization as dict instead of multi-line strings (Maybe I just dislike multi-line strings excessively).

- "web_override"

- name: Run kustomize build on task deployment and store in deployments.yaml
command: kustomize build {{ _deployment_kustomize_dir.path }} -o {{ _deployment_kustomize_dir.path }}/deployments.yaml
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants