Reputation: 3807
My situation is as follows:
While this is a decent setup, it's not ideal.
The first problem i faced with using a helm chart git repo is that I can't (or don't know) how to differentiate my staging environment with my production environment. Since I have a dev environment and prod environment in my cluster, argocd syncs both environments with the helm chart repo. I could get around this with separate charts for each environment but that isn't a valid solution.
The second problem i faced, while trying to get around the above problem, is that I can't get argocd to pull helm charts from a gitlab oci registry. I made it so that my build pipeline pushed the helm chart archive file to my gitlab container registry with the tag dev-latest
or prod-latest
, which is great, just what I want. The problem is that argocd, as far as I can tell, can't pull from gitlab's container registry.
How do I go about getting my pipeline automated with gitlab as my repo and build pipeline, helm for packaging my application, and argocd for syncing my helm application with my k8s cluster?
Upvotes: 1
Views: 2647
Reputation: 749
You must use the Gitlab package registry instead of Gitlab container registry.
Add your helm chart using the following 3 commands:
argocd login $ARGOCD_HOST:$ARGOCD_PORT --insecure --username $ARGOCD_ADMIN_USER --password $ARGOCD_ADMIN_PASSWORD
argocd repo add <REPO_URL> --type helm --name <NAME> --username <USERNAME> --password <PASSWORD>
argocd app create <APP_NAME> --repo <REPO_URL> --helm-chart <HELM_CHART_PACKAGE_NAME> --revision <HELM_CHART_PACKAGE_VERSION> --dest-namespace default --dest-server https://kubernetes.default.svc
Upvotes: 0
Reputation: 1328712
is that I can't get argocd to pull helm charts from a gitlab oci registry.
You might be interested by the latest Jul. 2021 GitLab 14.1:
Build, publish, and share Helm charts
Helm defines a chart as a Helm package that contains all of the resource definitions necessary to run an application, tool, or service inside of a Kubernetes cluster.
For organizations that create and manage their own Helm charts, it’s important to have a central repository to collect and share them.GitLab already supports a variety of other package manager formats.
Why not also support Helm? That’s what community member and MVP from the 14.0 milestone Mathieu Parent asked several months ago before breaking ground on the new GitLab Helm chart registry. The collaboration between the community and GitLab is part of our dual flywheel strategy and one of the reasons I love working at GitLab. Chapeau Mathieu!
Now you can use your GitLab project to publish and share packaged Helm charts.
Simply add your project as a remote, authenticating with a personal access, deploy, or CI/CD job token.
Once that’s done you can use the Helm client or GitLab CI/CD to manage your Helm charts.
You can also download the charts using the API or the user interface.What’s next? First, we’d like to present additional metadata for charts.
Then we’ll start dogfooding the feature by using it as a replacement for https://charts.gitlab.io/.So, try out the feature and let us know how it goes by commenting in the epic GitLab-#6366.
See Documentation and issue.
Upvotes: 0