5

i'm trying to do gitops

I have a Configuration repo containing k8 manifests and different app repos.

1) App repo's CI build docker images and pushes into registry.

2) App repo's CI commits into Configuration repo with newly built image tags.

A gitops CD like ArgoCD is listening to configuration repo and deploys(manual/automatic) it to kubernetes.

Is this the right way to do it ?

2 Answers 2

3
  1. App repo's CI commits into Configuration repo with newly built image tags.

Yes, this makes sense. Instead of using image tags you can use image digest, since the digest is generated from content, it is immutable, while tags may be updated (intentionally or unintentionally).

This manifest update can be done with multiple tools:

Using yq

yq write \
  --inplace deployment.yaml \
  'spec.template.spec.containers(name==myappname).image' \
  gcr.io/my-image-repository/myappname:labelOrDigest

Or using a newer tool; kpt with the kpt set command.

2

Versioning is generally a pain point in microservice management. I just wrote a Medium article how we are dogfooding our tool Reliza Hub to help with this problem - https://medium.com/@taleodor/building-kubernetes-cicd-pipeline-with-github-actions-argocd-and-reliza-hub-e7120b9be870

In short, we have prepared templating engine there which automatically resolves versions based on metadata and approval matrix from Reliza Hub. It then populates k8s definitions for each instance with specific version just for that instance.

If you do it another way, in my experience it usually tends to be manual. Because in most cases it is just to risky to always push latest to your production or even staging.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.