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

Create new sidecars with configurations for argo cd #17

Merged
merged 2 commits into from
Sep 28, 2022

Conversation

mmalyska
Copy link
Owner

No description provided.

@mmalyska mmalyska self-assigned this Sep 23, 2022
@mmalyska mmalyska linked an issue Sep 23, 2022 that may be closed by this pull request
@github-actions
Copy link

github-actions bot commented Sep 23, 2022

Path: cluster/core/argocd/base

@@ -8991,8 +8991,6 @@
       generate:
         command: ["sh", "-c"]
         args: ["kustomize build --enable-alpha-plugins . | argocd-secret-replacer sops -f $ARGOCD_ENV_SOPS_FILE"]
-  helm.valuesFileSchemes: secrets+gpg-import, secrets+gpg-import-kubernetes, secrets+age-import, secrets+age-import-kubernetes, secrets, https
-  kustomize.buildOptions: --enable-alpha-plugins
   oidc.config: |
     name: Keycloak
     issuer: https://l.<secret:private-domain>/realms/home
@@ -9081,6 +9079,54 @@
   namespace: argocd
 ---
 apiVersion: v1
+data:
+  sops-replacer-plugin-helm.yaml: |
+    apiVersion: argoproj.io/v1alpha1
+    kind: ConfigManagementPlugin
+    metadata:
+      name: sops-replacer-plugin-helm
+    spec:
+      allowConcurrency: true
+      discover:
+        find:
+          command:
+            - sh
+            - "-c"
+            - "[[ ! -z $ARGOCD_ENV_SOPS_SECRET_FILE ]] && find . -name 'Chart.yaml' && find . -name 'values.yaml' && find . -name '$ARGOCD_ENV_SOPS_SECRET_FILE'"
+      generate:
+        command:
+          - bash
+          - "-c"
+          - |
+            helm template --release-name $ARGOCD_APP_NAME --namespace $ARGOCD_APP_NAMESPACE . | argocd-secret-replacer sops -f $ARGOCD_ENV_SOPS_SECRET_FILE
+      lockRepo: false
+  sops-replacer-plugin-kustomize.yaml: |
+    ---
+    apiVersion: argoproj.io/v1alpha1
+    kind: ConfigManagementPlugin
+    metadata:
+      name: sops-replacer-plugin-kustomize
+    spec:
+      allowConcurrency: true
+      discover:
+        find:
+          command:
+            - sh
+            - "-c"
+            - "[[ ! -z $ARGOCD_ENV_SOPS_SECRET_FILE ]] && find . -name 'kustomization.yaml' && find . -name '$ARGOCD_ENV_SOPS_SECRET_FILE'"
+      generate:
+        command:
+          - bash
+          - "-c"
+          - |
+            kustomize build --enable-alpha-plugins . | argocd-secret-replacer sops -f $ARGOCD_ENV_SOPS_SECRET_FILE
+      lockRepo: false
+kind: ConfigMap
+metadata:
+  name: sops-replacer-plugin
+  namespace: argocd
+---
+apiVersion: v1
 kind: Secret
 metadata:
   name: argocd-notifications-secret
@@ -9723,6 +9769,82 @@
               name: helm-working-dir
             - mountPath: /home/argocd/cmp-server/plugins
               name: plugins
+        - command:
+            - /var/run/argocd/argocd-cmp-server
+          env:
+            - name: SOPS_AGE_KEY_FILE
+              value: /sops-age/key
+            - name: ARGOCD_ENV_SOPS_EXE
+              value: /custom-tools/sops
+          image: alpine/k8s:1.23.10
+          name: sops-replacer-plugin-kustomize
+          resources:
+            limits:
+              cpu: 50m
+              memory: 128Mi
+            requests:
+              cpu: 10m
+              memory: 16Mi
+          securityContext:
+            runAsNonRoot: true
+            runAsUser: 999
+          volumeMounts:
+            - mountPath: /var/run/argocd
+              name: var-files
+            - mountPath: /home/argocd/cmp-server/plugins
+              name: plugins
+            - mountPath: /tmp
+              name: tmp-sops-replacer-plugin
+            - mountPath: /home/argocd/cmp-server/config/plugin.yaml
+              name: sops-replacer-plugin
+              subPath: sops-replacer-plugin-kustomize.yaml
+            - mountPath: /custom-tools/sops
+              name: custom-tools
+              subPath: sops
+            - mountPath: /sops-age/key
+              name: sops-age
+              subPath: age.agekey
+            - mountPath: /usr/local/bin/argocd-secret-replacer
+              name: custom-tools
+              subPath: argocd-secret-replacer
+        - command:
+            - /var/run/argocd/argocd-cmp-server
+          env:
+            - name: SOPS_AGE_KEY_FILE
+              value: /sops-age/key
+            - name: ARGOCD_ENV_SOPS_EXE
+              value: /custom-tools/sops
+          image: alpine/k8s:1.23.10
+          name: sops-replacer-plugin-helm
+          resources:
+            limits:
+              cpu: 50m
+              memory: 128Mi
+            requests:
+              cpu: 10m
+              memory: 16Mi
+          securityContext:
+            runAsNonRoot: true
+            runAsUser: 999
+          volumeMounts:
+            - mountPath: /var/run/argocd
+              name: var-files
+            - mountPath: /home/argocd/cmp-server/plugins
+              name: plugins
+            - mountPath: /tmp
+              name: tmp-sops-replacer-plugin
+            - mountPath: /home/argocd/cmp-server/config/plugin.yaml
+              name: sops-replacer-plugin
+              subPath: sops-replacer-plugin-helm.yaml
+            - mountPath: /custom-tools/sops
+              name: custom-tools
+              subPath: sops
+            - mountPath: /sops-age/key
+              name: sops-age
+              subPath: age.agekey
+            - mountPath: /usr/local/bin/argocd-secret-replacer
+              name: custom-tools
+              subPath: argocd-secret-replacer
       initContainers:
         - args:
             - |
@@ -9772,6 +9894,9 @@
               name: var-files
       serviceAccountName: argocd-repo-server
       volumes:
+        - configMap:
+            name: sops-replacer-plugin
+          name: sops-replacer-plugin
         - emptyDir: {}
           name: custom-tools
         - name: sops-age

@mmalyska mmalyska merged commit 842d7e2 into main Sep 28, 2022
@mmalyska mmalyska deleted the chore/use-sidecar-for-argo-plugins branch September 28, 2022 16:37
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.

Migrate Argo CD plugins to sidecars
1 participant