This article was written following the successful completion of the Kubernetes-based Infrastructure Platform course
Gitops - , infrastracture as a code - . CNCF - ArgoCD Flux. - git kubernetes. , , Flux :
;
- .
ArgoCD . , :
:
, git , , , , , ( , );
(Kustomize, Helm, Ksonnet, Jsonnet, plain-YAML);
, ;
.
:
kubernetes , . , CI container registry , , , CD. , ArgoCD , helm . - , ArgoCD , , ?
flux:
helm , - helmrelease. container registry helmrelease , semver :
apiVersion: helm.fluxcd.io/v1
kind: HelmRelease
metadata:
name: frontend
namespace: microservices-demo
annotations:
fluxcd.io/ignore: "false"
fluxcd.io/automated: "true"
flux.weave.works/tag.chart-image: semver:~v0.0
spec:
releaseName: frontend
helmVersion: v3
chart:
git: git@gitlab.com:wenger23/microservices-demo.git
ref: master
path: deploy/charts/frontend
values:
image:
repository: registry.gitlab.com/wenger23/microservices-demo/frontend
tag: v0.0.40
imagePullSecrets:
- name: registry-credentials
Flux container registry , - !
. , git - helm, , flux, merge .
ArgoCD , , . - - Argo CD Image Updater. , ArgoCD container registry, . :
container registry ( );
, c ;
.
:
ArgoCD;
Helm Kustomize, , helm - image.tag ( ).
- ArgoCD, namespace( ). . applications ( ArgoCD) : :
argocd-image-updater.argoproj.io/image-list: <image_spec_list>
- container registry , :
argocd-image-updater.argoproj.io/image-list: frontend:~v0.0
v0.0
semver , :
argocd-image-updater.argoproj.io/<image_name>.update-strategy: <strategy>
|
|
semver |
|
latest |
|
name |
, |
, application ( ) :
- ArgoCD api ( );
- ;.
argocd app set --parameter
, ArgoCD. webui. .
- :
argocd-image-updater.argoproj.io/write-back-method: git
, .argocd-source-<appName>.yaml, :
flux , , merge . argocd image updater ArgoCD, credentials.
ArgoCD argocd image updater :
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
annotations:
argocd-image-updater.argoproj.io/image-list: registry.gitlab.com/microservices28/frontend:~v0.0
argocd-image-updater.argoproj.io/write-back-method: git
name: frontend
namespace: argocd
spec:
destination:
namespace: microservices28
server: https://kubernetes.default.svc
project: microservices
source:
helm:
valueFiles:
- values.yaml
path: deploy/charts/frontend
repoURL: https://gitlab.com/microservices28/frontend.git
:
, CD .Argo CD Image Updater - 0.9.2 ,. 1.0. , .
: