From 49c457dde4c12ceab76a7fe68d30bb36d64b34f0 Mon Sep 17 00:00:00 2001 From: mrfzy Date: Tue, 9 Jan 2024 05:52:54 +0700 Subject: [PATCH] delete image service and update strategy via git --- .../application-argocd-image-updater.yaml | 231 ------------------ argocd/apps/application-laravel.yaml | 5 + 2 files changed, 5 insertions(+), 231 deletions(-) delete mode 100644 argocd/apps/application-argocd-image-updater.yaml diff --git a/argocd/apps/application-argocd-image-updater.yaml b/argocd/apps/application-argocd-image-updater.yaml deleted file mode 100644 index ced40a6..0000000 --- a/argocd/apps/application-argocd-image-updater.yaml +++ /dev/null @@ -1,231 +0,0 @@ -apiVersion: v1 -kind: ServiceAccount -metadata: - labels: - app.kubernetes.io/component: controller - app.kubernetes.io/name: argocd-image-updater - app.kubernetes.io/part-of: argocd-image-updater - name: argocd-image-updater ---- -apiVersion: rbac.authorization.k8s.io/v1 -kind: Role -metadata: - labels: - app.kubernetes.io/component: controller - app.kubernetes.io/name: argocd-image-updater - app.kubernetes.io/part-of: argocd-image-updater - name: argocd-image-updater -rules: -- apiGroups: - - "" - resources: - - secrets - - configmaps - verbs: - - get - - list - - watch -- apiGroups: - - argoproj.io - resources: - - applications - verbs: - - get - - list - - update - - patch -- apiGroups: - - "" - resources: - - events - verbs: - - create ---- -apiVersion: rbac.authorization.k8s.io/v1 -kind: RoleBinding -metadata: - labels: - app.kubernetes.io/component: controller - app.kubernetes.io/name: argocd-image-updater - app.kubernetes.io/part-of: argocd-image-updater - name: argocd-image-updater -roleRef: - apiGroup: rbac.authorization.k8s.io - kind: Role - name: argocd-image-updater -subjects: -- kind: ServiceAccount - name: argocd-image-updater ---- -apiVersion: v1 -kind: ConfigMap -metadata: - labels: - app.kubernetes.io/name: argocd-image-updater-config - app.kubernetes.io/part-of: argocd-image-updater - name: argocd-image-updater-config -data: - log.level: debug - applications_api: argocd - # The address of Argo CD API endpoint - defaults to argocd-server.argocd - argocd.server_addr: argocd-server.argocd.svc.cluster.local - # Whether to use GRPC-web protocol instead of GRPC over HTTP/2 - argocd.grpc_web: "false" - # Whether to ignore invalid TLS cert from Argo CD API endpoint - argocd.insecure: "true" - # Whether to use plain text connection (http) instead of TLS (https) - argocd.plaintext: "true" - registries.conf: | - registries: - - name: Docker Hub - prefix: docker.io - api_url: https://registry-1.docker.io - credentials: pullsecret:argocd/docker-credentials - ping: true - limit: 5 - git.commit-message-template: | - build: automatic update of {{ .AppName }} - {{ range .AppChanges -}} - updates image {{ .Image }} tag '{{ .OldTag }}' to '{{ .NewTag }}' - {{ end -}} ---- -apiVersion: v1 -kind: ConfigMap -metadata: - labels: - app.kubernetes.io/name: argocd-image-updater-ssh-config - app.kubernetes.io/part-of: argocd-image-updater - name: argocd-image-updater-ssh-config ---- -apiVersion: v1 -kind: Secret -metadata: - labels: - app.kubernetes.io/name: argocd-image-updater-secret - app.kubernetes.io/part-of: argocd-image-updater - name: argocd-image-updater-secret -data: - argocd.token: ---- -apiVersion: apps/v1 -kind: Deployment -metadata: - labels: - app.kubernetes.io/component: controller - app.kubernetes.io/name: argocd-image-updater - app.kubernetes.io/part-of: argocd-image-updater - name: argocd-image-updater -spec: - selector: - matchLabels: - app.kubernetes.io/name: argocd-image-updater - strategy: - type: Recreate - template: - metadata: - labels: - app.kubernetes.io/name: argocd-image-updater - spec: - terminationGracePeriodSeconds: 30 - containers: - - command: - - /usr/local/bin/argocd-image-updater - - run - env: - - name: APPLICATIONS_API - valueFrom: - configMapKeyRef: - key: applications_api - name: argocd-image-updater-config - optional: true - - name: ARGOCD_SERVER - valueFrom: - configMapKeyRef: - key: argocd.server_addr - name: argocd-image-updater-config - optional: true - - name: ARGOCD_INSECURE - valueFrom: - configMapKeyRef: - key: argocd.insecure - name: argocd-image-updater-config - optional: true - - name: ARGOCD_PLAINTEXT - valueFrom: - configMapKeyRef: - key: argocd.plaintext - name: argocd-image-updater-config - optional: true - - name: ARGOCD_TOKEN - valueFrom: - secretKeyRef: - key: argocd.token - name: argocd-image-updater-secret - optional: true - - name: IMAGE_UPDATER_LOGLEVEL - valueFrom: - configMapKeyRef: - key: log.level - name: argocd-image-updater-config - optional: true - - name: GIT_COMMIT_USER - valueFrom: - configMapKeyRef: - key: git.user - name: argocd-image-updater-config - optional: true - - name: GIT_COMMIT_EMAIL - valueFrom: - configMapKeyRef: - key: git.email - name: argocd-image-updater-config - optional: true - - name: IMAGE_UPDATER_KUBE_EVENTS - valueFrom: - configMapKeyRef: - key: kube.events - name: argocd-image-updater-config - optional: true - image: quay.io/argoprojlabs/argocd-image-updater:v0.12.2 - imagePullPolicy: Always - livenessProbe: - httpGet: - path: /healthz - port: 8080 - initialDelaySeconds: 3 - periodSeconds: 30 - name: argocd-image-updater - ports: - - containerPort: 8080 - readinessProbe: - httpGet: - path: /healthz - port: 8080 - initialDelaySeconds: 3 - periodSeconds: 30 - volumeMounts: - - mountPath: /app/config - name: image-updater-conf - - mountPath: /app/config/ssh - name: ssh-known-hosts - - mountPath: /app/.ssh - name: ssh-config - serviceAccountName: argocd-image-updater - volumes: - - configMap: - items: - - key: registries.conf - path: registries.conf - - key: git.commit-message-template - path: commit.template - name: argocd-image-updater-config - optional: true - name: image-updater-conf - - configMap: - name: argocd-ssh-known-hosts-cm - optional: true - name: ssh-known-hosts - - configMap: - name: argocd-image-updater-ssh-config - optional: true - name: ssh-config diff --git a/argocd/apps/application-laravel.yaml b/argocd/apps/application-laravel.yaml index 482b293..88489be 100644 --- a/argocd/apps/application-laravel.yaml +++ b/argocd/apps/application-laravel.yaml @@ -5,6 +5,11 @@ metadata: namespace: argocd labels: name: laravel-crud + annotations: + argocd-image-updater.argoproj.io/image-list: dockerhub=registry.hub.docker.com/library/crud_laravel_api-sre-test-app:latest + argocd-image-updater.argoproj.io/gcr-ocademy-api.update-strategy: digest + argocd-image-updater.argoproj.io/write-back-method: git + argocd-image-updater.argoproj.io/git-branch: main spec: project: default source: