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

Implement pull secrets #229

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

Conversation

schnatterer
Copy link
Member

For all pods except Jenkins, SCMM, Registry, ArgoCD

We have different options for using them in airGapped envs: Cloudogu
Ecosystem and Argo CD Operator (WIP) and an external registry.

Introduces new config/ CLI:

  • --create-image-pull-secrets
  • --registry-username-read-only and --registry-password-read-only': least privilege: if you don't want to use --registry-username and -password as pull secrets, that allow for writing to the registry. The cluster only needs to read.

More or less unrelated changes:

  • Introduces Content class, which we already know will in future hold example apps and exercises so they can be switched on and off separately. Also will improve maintenance of the huge ArgoCd.groovy monolith.
  • missing image params and config options
  • migrates some properties from pre-templating times from groovy to values (in Mailhog, Vault, External Secrets Operator)
  • Changes Argo CD applications to use valuesObject instead of values (String). This improves visualization and simplifies debugging.

How to test

See https://github.com/cloudogu/gitops-playground/blob/58fdd0/docs/developers.md#proper-test

After everything it built and deployed there should be

  • no degraded app in argocd
  • no failing pods returned by k get pods -A
  • and this should only return localhost:30000 pods:
$  kubectl get pods --all-namespaces -o jsonpath="{.items[*].spec.containers[*].image}" \
  | tr -s '[[:space:]]' '\n' | sort | uniq \
  | grep -v 'harbor\|jenkins\|scmm\|rancher\|argo\|redis\|dex'

localhost:30000/proxy/eso:latest
localhost:30000/proxy/grafana:latest
localhost:30000/proxy/ingress-nginx:latest
localhost:30000/proxy/k8s-sidecar:latest
localhost:30000/proxy/mailhog:latest
localhost:30000/proxy/nginx:latest
localhost:30000/proxy/prometheus-operator:latest
localhost:30000/proxy/vault:latest

@schnatterer
Copy link
Member Author

For the reviewer:

  • Please take extra care to check if I didn't forget any negative tests: without the imagePullSecrets param there should be no imagePullSecrets field in the helm chart.
  • What do you think about the design choice of FeatureWithImage in general and as a trait?

schnatterer and others added 5 commits October 1, 2024 11:09
Also add missing mailhog-image parameter

ArgoCdApplicationStrategy: use valuesObject for easier debugging of our
YAML objects.

Co-authored-by: Aaron Frey <aaron.frey@cloudogu.com>
For easier reuse.

Using a trait instead of a util might also help us in the future.
For example, we can automate the setting of image values or extract all
images used.

An abstract class might have worked as well, but this way we can later
add more traits, if needed.
Registry does not have anything to do with this.
It's only for the content, because we add the secrets to the content
namespaces.

Also: The namespaces need to be created before adding the secrets.
 Why
should Registry.groovy create these Namespaces?
It's not a concern of the registry!

Similar to Mailhog, Vault, etc that create their own secrets.

The rest of the content remains in ArgoCD.groovy for now, but we will
refactor it to Content.groovy in the future.
Ignore Jenkins, SCMM, Registry, ArgoCD because we don't have params to
set their images.

We have different options for using them in airGapped envs: Cloudogu
Ecosystem and Argo CD Operator (WIP)

Added setting nginx-image in helm-umbrella example app

Add --ingress-nginx-image and upgrade chart to avoid conflict with
isControllerTagValid.
This improves UX because we can also create image pull secrets when
running with only one registry
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.

1 participant