From bd62b428e8104c5d880bb696f7a49dada0dd804f Mon Sep 17 00:00:00 2001 From: Nima Kaviani <17132353+nimakaviani@users.noreply.github.com> Date: Thu, 2 May 2024 22:17:49 -0700 Subject: [PATCH] Fix pull policy (#236) Signed-off-by: Nima Kaviani --- hack/argo-cd/argocd-application-controller.yaml | 14 ++++++++++++++ .../argocd-applicationset-controller.yaml | 14 ++++++++++++++ hack/argo-cd/argocd-redis.yaml | 14 ++++++++++++++ hack/argo-cd/argocd-repo-server.yaml | 14 ++++++++++++++ hack/argo-cd/argocd-server.yaml | 1 + hack/argo-cd/dex-server.yaml | 8 ++++++++ hack/argo-cd/kustomization.yaml | 4 ++++ hack/argo-cd/notifications-controller.yaml | 5 +++++ hack/gitea/generate-manifests.sh | 14 ++++++++------ hack/gitea/values.yaml | 3 +++ .../localbuild/resources/argo/install.yaml | 16 ++++++++-------- .../localbuild/resources/gitea/k8s/install.yaml | 8 ++++---- 12 files changed, 97 insertions(+), 18 deletions(-) create mode 100644 hack/argo-cd/argocd-application-controller.yaml create mode 100644 hack/argo-cd/argocd-applicationset-controller.yaml create mode 100644 hack/argo-cd/argocd-redis.yaml create mode 100644 hack/argo-cd/argocd-repo-server.yaml diff --git a/hack/argo-cd/argocd-application-controller.yaml b/hack/argo-cd/argocd-application-controller.yaml new file mode 100644 index 00000000..99674eed --- /dev/null +++ b/hack/argo-cd/argocd-application-controller.yaml @@ -0,0 +1,14 @@ +apiVersion: apps/v1 +kind: StatefulSet +metadata: + labels: + app.kubernetes.io/component: application-controller + app.kubernetes.io/name: argocd-application-controller + app.kubernetes.io/part-of: argocd + name: argocd-application-controller +spec: + template: + spec: + containers: + - name: argocd-application-controller + imagePullPolicy: IfNotPresent diff --git a/hack/argo-cd/argocd-applicationset-controller.yaml b/hack/argo-cd/argocd-applicationset-controller.yaml new file mode 100644 index 00000000..86e89308 --- /dev/null +++ b/hack/argo-cd/argocd-applicationset-controller.yaml @@ -0,0 +1,14 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + labels: + app.kubernetes.io/component: applicationset-controller + app.kubernetes.io/name: argocd-applicationset-controller + app.kubernetes.io/part-of: argocd + name: argocd-applicationset-controller +spec: + template: + spec: + containers: + - name: argocd-applicationset-controller + imagePullPolicy: IfNotPresent \ No newline at end of file diff --git a/hack/argo-cd/argocd-redis.yaml b/hack/argo-cd/argocd-redis.yaml new file mode 100644 index 00000000..80ad5246 --- /dev/null +++ b/hack/argo-cd/argocd-redis.yaml @@ -0,0 +1,14 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + labels: + app.kubernetes.io/component: redis + app.kubernetes.io/name: argocd-redis + app.kubernetes.io/part-of: argocd + name: argocd-redis +spec: + template: + spec: + containers: + - name: redis + imagePullPolicy: IfNotPresent diff --git a/hack/argo-cd/argocd-repo-server.yaml b/hack/argo-cd/argocd-repo-server.yaml new file mode 100644 index 00000000..3816992a --- /dev/null +++ b/hack/argo-cd/argocd-repo-server.yaml @@ -0,0 +1,14 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + labels: + app.kubernetes.io/component: repo-server + app.kubernetes.io/name: argocd-repo-server + app.kubernetes.io/part-of: argocd + name: argocd-repo-server +spec: + template: + spec: + containers: + - name: argocd-repo-server + imagePullPolicy: IfNotPresent diff --git a/hack/argo-cd/argocd-server.yaml b/hack/argo-cd/argocd-server.yaml index 2913c380..30f116d0 100644 --- a/hack/argo-cd/argocd-server.yaml +++ b/hack/argo-cd/argocd-server.yaml @@ -24,3 +24,4 @@ spec: - /argocd - "{{end}}" name: argocd-server + imagePullPolicy: IfNotPresent diff --git a/hack/argo-cd/dex-server.yaml b/hack/argo-cd/dex-server.yaml index 689669c8..8b23c29c 100644 --- a/hack/argo-cd/dex-server.yaml +++ b/hack/argo-cd/dex-server.yaml @@ -4,3 +4,11 @@ metadata: name: argocd-dex-server spec: replicas: 0 + template: + spec: + containers: + - name: dex + imagePullPolicy: IfNotPresent + initContainers: + - name: copyutil + imagePullPolicy: IfNotPresent diff --git a/hack/argo-cd/kustomization.yaml b/hack/argo-cd/kustomization.yaml index 7b1b1917..f148718b 100644 --- a/hack/argo-cd/kustomization.yaml +++ b/hack/argo-cd/kustomization.yaml @@ -8,3 +8,7 @@ patches: - path: notifications-controller.yaml - path: argocd-cm.yaml - path: argocd-server.yaml + - path: argocd-application-controller.yaml + - path: argocd-applicationset-controller.yaml + - path: argocd-repo-server.yaml + - path: argocd-redis.yaml diff --git a/hack/argo-cd/notifications-controller.yaml b/hack/argo-cd/notifications-controller.yaml index 5545bec7..3adc53d3 100644 --- a/hack/argo-cd/notifications-controller.yaml +++ b/hack/argo-cd/notifications-controller.yaml @@ -4,3 +4,8 @@ metadata: name: argocd-notifications-controller spec: replicas: 0 + template: + spec: + containers: + - name: argocd-notifications-controller + imagePullPolicy: IfNotPresent diff --git a/hack/gitea/generate-manifests.sh b/hack/gitea/generate-manifests.sh index 69c0eaa1..61eefc03 100755 --- a/hack/gitea/generate-manifests.sh +++ b/hack/gitea/generate-manifests.sh @@ -5,13 +5,13 @@ INSTALL_YAML="pkg/controllers/localbuild/resources/gitea/k8s/install.yaml" GITEA_DIR="./hack/gitea" CHART_VERSION="9.5.1" -echo "# GITEA INSTALL RESOURCES" > ${INSTALL_YAML} -echo "# This file is auto-generated with 'hack/gitea/generate-manifests.sh'" >> ${INSTALL_YAML} +echo "# GITEA INSTALL RESOURCES" >${INSTALL_YAML} +echo "# This file is auto-generated with 'hack/gitea/generate-manifests.sh'" >>${INSTALL_YAML} helm repo add gitea-charts --force-update https://dl.gitea.com/charts/ helm repo update -helm template my-gitea gitea-charts/gitea -f ${GITEA_DIR}/values.yaml --version ${CHART_VERSION} >> ${INSTALL_YAML} -sed -i '3d' ${INSTALL_YAML} +helm template my-gitea gitea-charts/gitea -f ${GITEA_DIR}/values.yaml --version ${CHART_VERSION} >>${INSTALL_YAML} +sed -i.bak '3d' ${INSTALL_YAML} # helm template for pvc uses Release.namespace which doesn't get set # when running the helm "template" command @@ -19,6 +19,8 @@ sed -i '3d' ${INSTALL_YAML} # and: https://gitea.com/gitea/helm-chart/src/commit/3b2b700441e91a19a535e05de3a9eab2fef0b117/templates/gitea/pvc.yaml#L6 # and: https://github.com/helm/helm/issues/3553#issuecomment-1186518158 # and: https://github.com/splunk/splunk-connect-for-kubernetes/pull/790 -sed -i 's/namespace: default/namespace: gitea/g' ${INSTALL_YAML} +sed -i.bak 's/namespace: default/namespace: gitea/g' ${INSTALL_YAML} -cat ${GITEA_DIR}/ingress.yaml.tmpl >> ${INSTALL_YAML} +cat ${GITEA_DIR}/ingress.yaml.tmpl >>${INSTALL_YAML} + +rm -rf "${INSTALL_YAML}.bak" diff --git a/hack/gitea/values.yaml b/hack/gitea/values.yaml index 21e0faee..88f06b03 100644 --- a/hack/gitea/values.yaml +++ b/hack/gitea/values.yaml @@ -36,3 +36,6 @@ service: ingress: enabled: false + +image: + pullPolicy: "IfNotPresent" diff --git a/pkg/controllers/localbuild/resources/argo/install.yaml b/pkg/controllers/localbuild/resources/argo/install.yaml index 15df04b0..5422ef9e 100644 --- a/pkg/controllers/localbuild/resources/argo/install.yaml +++ b/pkg/controllers/localbuild/resources/argo/install.yaml @@ -21487,7 +21487,7 @@ spec: name: argocd-cmd-params-cm optional: true image: quay.io/argoproj/argocd:v2.10.7 - imagePullPolicy: Always + imagePullPolicy: IfNotPresent name: argocd-applicationset-controller ports: - containerPort: 7000 @@ -21582,7 +21582,7 @@ spec: name: argocd-cmd-params-cm optional: true image: ghcr.io/dexidp/dex:v2.37.0 - imagePullPolicy: Always + imagePullPolicy: IfNotPresent name: dex ports: - containerPort: 5556 @@ -21611,7 +21611,7 @@ spec: - /usr/local/bin/argocd - /shared/argocd-dex image: quay.io/argoproj/argocd:v2.10.7 - imagePullPolicy: Always + imagePullPolicy: IfNotPresent name: copyutil securityContext: allowPrivilegeEscalation: false @@ -21694,7 +21694,7 @@ spec: name: argocd-cmd-params-cm optional: true image: quay.io/argoproj/argocd:v2.10.7 - imagePullPolicy: Always + imagePullPolicy: IfNotPresent livenessProbe: tcpSocket: port: 9001 @@ -21771,7 +21771,7 @@ spec: - --appendonly - "no" image: redis:7.0.14-alpine - imagePullPolicy: Always + imagePullPolicy: IfNotPresent name: redis ports: - containerPort: 6379 @@ -22000,7 +22000,7 @@ spec: - name: HELM_DATA_HOME value: /helm-working-dir image: quay.io/argoproj/argocd:v2.10.7 - imagePullPolicy: Always + imagePullPolicy: IfNotPresent livenessProbe: failureThreshold: 3 httpGet: @@ -22374,7 +22374,7 @@ spec: name: argocd-cmd-params-cm optional: true image: quay.io/argoproj/argocd:v2.10.7 - imagePullPolicy: Always + imagePullPolicy: IfNotPresent livenessProbe: httpGet: path: /healthz?full=true @@ -22662,7 +22662,7 @@ spec: name: argocd-cmd-params-cm optional: true image: quay.io/argoproj/argocd:v2.10.7 - imagePullPolicy: Always + imagePullPolicy: IfNotPresent name: argocd-application-controller ports: - containerPort: 8082 diff --git a/pkg/controllers/localbuild/resources/gitea/k8s/install.yaml b/pkg/controllers/localbuild/resources/gitea/k8s/install.yaml index 86a7549a..29cde0dd 100644 --- a/pkg/controllers/localbuild/resources/gitea/k8s/install.yaml +++ b/pkg/controllers/localbuild/resources/gitea/k8s/install.yaml @@ -402,7 +402,7 @@ spec: initContainers: - name: init-directories image: "gitea/gitea:1.20.5-rootless" - imagePullPolicy: Always + imagePullPolicy: IfNotPresent command: ["/usr/sbin/init_directory_structure.sh"] env: - name: GITEA_APP_INI @@ -430,7 +430,7 @@ spec: memory: 128Mi - name: init-app-ini image: "gitea/gitea:1.20.5-rootless" - imagePullPolicy: Always + imagePullPolicy: IfNotPresent command: ["/usr/sbin/config_environment.sh"] env: - name: GITEA_APP_INI @@ -461,7 +461,7 @@ spec: - name: configure-gitea image: "gitea/gitea:1.20.5-rootless" command: ["/usr/sbin/configure_gitea.sh"] - imagePullPolicy: Always + imagePullPolicy: IfNotPresent securityContext: runAsUser: 1000 env: @@ -502,7 +502,7 @@ spec: containers: - name: gitea image: "gitea/gitea:1.20.5-rootless" - imagePullPolicy: Always + imagePullPolicy: IfNotPresent env: # SSH Port values have to be set here as well for openssh configuration - name: SSH_LISTEN_PORT