From 2d5f040947b9dfaed0896cad3eb486f4e88d02fd Mon Sep 17 00:00:00 2001 From: Mikhail Klimko Date: Fri, 19 Sep 2025 17:05:22 +0300 Subject: [PATCH 01/37] refactor cf-argocd-extras --- .../templates/argo-api-gateway/_env.yaml | 84 ++++++++++++++ .../templates/argo-api-gateway/_helpers.tpl | 47 ++++++++ .../templates/argo-api-gateway/configmap.yaml | 16 +++ .../argo-api-gateway/deployment.yaml | 107 ++++++++++++++++++ .../templates/argo-api-gateway/hpa.yaml | 38 +++++++ .../templates/argo-api-gateway/pdb.yaml | 20 ++++ .../templates/argo-api-gateway/rbac.yaml | 64 +++++++++++ .../templates/argo-api-gateway/service.yaml | 18 +++ charts/gitops-runtime/values.yaml | 39 +++++++ 9 files changed, 433 insertions(+) create mode 100644 charts/gitops-runtime/templates/argo-api-gateway/_env.yaml create mode 100644 charts/gitops-runtime/templates/argo-api-gateway/_helpers.tpl create mode 100644 charts/gitops-runtime/templates/argo-api-gateway/configmap.yaml create mode 100644 charts/gitops-runtime/templates/argo-api-gateway/deployment.yaml create mode 100644 charts/gitops-runtime/templates/argo-api-gateway/hpa.yaml create mode 100644 charts/gitops-runtime/templates/argo-api-gateway/pdb.yaml create mode 100644 charts/gitops-runtime/templates/argo-api-gateway/rbac.yaml create mode 100644 charts/gitops-runtime/templates/argo-api-gateway/service.yaml diff --git a/charts/gitops-runtime/templates/argo-api-gateway/_env.yaml b/charts/gitops-runtime/templates/argo-api-gateway/_env.yaml new file mode 100644 index 00000000..93763bfc --- /dev/null +++ b/charts/gitops-runtime/templates/argo-api-gateway/_env.yaml @@ -0,0 +1,84 @@ +{{- define "argo-api-gateway.resources.environment-variables.calculated" }} +HTTP_PROXY: {{ .Values.global.httpProxy | squote}} +HTTPS_PROXY: {{ .Values.global.httpsProxy | squote }} +NO_PROXY: {{ .Values.global.noProxy | squote }} +{{- end }} + +{{- define "argo-api-gateway.resources.environment-variables.defaults" -}} +ARGOCD_SERVER: + valueFrom: + configMapKeyRef: + name: argo-api-gateway-cmd-params-cm + key: argocd.server +ARGO_CD_TOKEN_SECRET_NAME: argocd-token +ARGO_CD_TOKEN_SECRET_KEY: token +ARGOCD_SERVER_ROOTPATH: + valueFrom: + configMapKeyRef: + name: argocd-cmd-params-cm + key: server.rootpath + optional: true +BINARY_NAME: sources-server +CODEFRESH_SSL_CERT_PATH: "" +CODEFRESH_TLS_INSECURE: + valueFrom: + configMapKeyRef: + name: argocd-cmd-params-cm + key: codefresh.tls.insecure + optional: true +CODEFRESH_TOKEN: + valueFrom: + secretKeyRef: + key: token + name: codefresh-token +CODEFRESH_URL: + valueFrom: + configMapKeyRef: + key: base-url + name: codefresh-cm +LISTEN_ADDRESS: + valueFrom: + configMapKeyRef: + name: argo-api-gateway-cmd-params-cm + key: server.listen.address + optional: true +REDISDB: + valueFrom: + configMapKeyRef: + name: argocd-cmd-params-cm + key: redis.db + optional: true +REDIS_COMPRESSION: + valueFrom: + configMapKeyRef: + name: argocd-cmd-params-cm + key: redis.compression + optional: true +REDIS_PASSWORD: + valueFrom: + secretKeyRef: + name: argocd-redis + key: auth +REDIS_SERVER: + valueFrom: + configMapKeyRef: + name: argocd-cmd-params-cm + key: redis.server +REDIS_USERNAME: + valueFrom: + secretKeyRef: + name: argocd-redis + key: redis-username + optional: true +REPO_SERVER: + valueFrom: + configMapKeyRef: + name: argo-api-gateway-cmd-params-cm + key: repo.server +REPO_SERVER_TIMEOUT_SECONDS: + valueFrom: + configMapKeyRef: + name: argo-api-gateway-cmd-params-cm + key: repo.server.timeout.seconds + optional: true +{{- end -}} diff --git a/charts/gitops-runtime/templates/argo-api-gateway/_helpers.tpl b/charts/gitops-runtime/templates/argo-api-gateway/_helpers.tpl new file mode 100644 index 00000000..658c45d7 --- /dev/null +++ b/charts/gitops-runtime/templates/argo-api-gateway/_helpers.tpl @@ -0,0 +1,47 @@ +{{/* +Create a default fully qualified app name. +We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +If release name contains chart name it will be used as a full name. +*/}} +{{- define "argo-api-gateway.fullname" -}} +{{- print "argo-api-gateway" }} +{{- end }} + +{{/* +Create chart name and version as used by the chart label. +*/}} +{{- define "argo-api-gateway.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Common labels +*/}} +{{- define "argo-api-gateway.labels" -}} +helm.sh/chart: {{ include "argo-api-gateway.chart" . }} +{{ include "argo-api-gateway.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +app.kubernetes.io/part-of: argo-api-gateway +codefresh.io/internal: "true" +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "argo-api-gateway.selectorLabels" -}} +app.kubernetes.io/name: argo-api-gateway +{{- end }} + +{{/* +Create the name of the service account to use +*/}} +{{- define "argo-api-gateway.serviceAccountName" -}} +{{- if .Values.serviceAccount.create }} +{{- default (include "argo-api-gateway.fullname" .) .Values.serviceAccount.name }} +{{- else }} +{{- default "default" .Values.serviceAccount.name }} +{{- end }} +{{- end }} diff --git a/charts/gitops-runtime/templates/argo-api-gateway/configmap.yaml b/charts/gitops-runtime/templates/argo-api-gateway/configmap.yaml new file mode 100644 index 00000000..20d3a336 --- /dev/null +++ b/charts/gitops-runtime/templates/argo-api-gateway/configmap.yaml @@ -0,0 +1,16 @@ +{{- define "argo-api-gateway.resources.configmap.defaults"}} +argocd.server: argo-cd-server:80 +repo.server: argo-cd-repo-server:8081 +{{- end }} + +{{- $defaultConfig := (include "argo-api-gateway.resources.configmap.defaults" . | fromYaml ) }} +{{- $overrides := index .Values "argo-api-gateway" "config" | default dict }} +{{- $mergedConfig := mergeOverwrite $defaultConfig $overrides }} +apiVersion: v1 +kind: ConfigMap +metadata: + name: argo-api-gateway-cmd-params-cm + labels: + {{- include "argo-api-gateway.labels" . | nindent 4 }} +data: + {{- $mergedConfig | toYaml | nindent 2 }} diff --git a/charts/gitops-runtime/templates/argo-api-gateway/deployment.yaml b/charts/gitops-runtime/templates/argo-api-gateway/deployment.yaml new file mode 100644 index 00000000..91468121 --- /dev/null +++ b/charts/gitops-runtime/templates/argo-api-gateway/deployment.yaml @@ -0,0 +1,107 @@ +{{- $cfCommonTplSemver := printf "cf-common-%s" (index .Subcharts "cf-common").Chart.Version }} +{{- $context := deepCopy . }} +{{- $_ := set $context "Values" (deepCopy (get .Values "argo-api-gateway")) }} +{{- $_ := set $context.Values "global" (deepCopy (get .Values "global")) }} +{{/* Merge environment variables from calculated, defaults and overwrites */}} +{{- $defaults := (include "argo-api-gateway.resources.environment-variables.defaults" . | fromYaml) }} +{{- $calculated := (include "argo-api-gateway.resources.environment-variables.calculated" . | fromYaml) }} +{{- $overrides := $context.Values.env }} +{{- $mergedValues := mergeOverwrite $defaults $calculated $overrides }} +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "argo-api-gateway.fullname" . }} + labels: + {{- include "argo-api-gateway.labels" . | nindent 4 }} +spec: + replicas: {{ $context.Values.replicaCount }} + selector: + matchLabels: + {{- include "argo-api-gateway.selectorLabels" . | nindent 6 }} + template: + metadata: + {{- with $context.Values.podAnnotations }} + annotations: + {{- toYaml . | nindent 8 }} + {{- end }} + labels: + {{- include "argo-api-gateway.selectorLabels" . | nindent 8 }} + {{- with $context.Values.podLabels }} + {{- toYaml . | nindent 8 }} + {{- end }} + spec: + {{- with $context.Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + serviceAccountName: {{ include "argo-api-gateway.serviceAccountName" $context }} + securityContext: + {{- toYaml $context.Values.podSecurityContext | nindent 8 }} + containers: + - name: {{ include "argo-api-gateway.fullname" . }} + securityContext: + {{- toYaml $context.Values.securityContext | nindent 12 }} + {{- $imageContext := deepCopy $context.Values.image }} + image: {{ include (printf "%s.image.name" $cfCommonTplSemver ) (dict "image" $imageContext "context" .) }} + env: {{- include (printf "%s.env-vars" $cfCommonTplSemver ) (dict "Values" $mergedValues "context" .) | nindent 8 }} + imagePullPolicy: {{ $context.Values.image.pullPolicy }} + {{- if $context.Values.command }} + command: + {{- $context.Values.command | toYaml | nindent 8 }} + {{- end }} + {{- with $context.Values.extraArgs }} + args: + {{- . | toYaml | nindent 8 }} + {{- end }} + ports: + - name: http + containerPort: 8090 + readinessProbe: + initialDelaySeconds: {{ $context.Values.readinessProbe.initialDelaySeconds }} + periodSeconds: {{ $context.Values.readinessProbe.periodSeconds }} + timeoutSeconds: {{ $context.Values.readinessProbe.timeoutSeconds }} + successThreshold: {{ $context.Values.readinessProbe.successThreshold }} + failureThreshold: {{ $context.Values.readinessProbe.failureThreshold }} + httpGet: + port: http + path: /healthz + livenessProbe: + initialDelaySeconds: {{ $context.Values.livenessProbe.initialDelaySeconds }} + periodSeconds: {{ $context.Values.livenessProbe.periodSeconds }} + timeoutSeconds: {{ $context.Values.livenessProbe.timeoutSeconds }} + successThreshold: {{ $context.Values.livenessProbe.successThreshold }} + failureThreshold: {{ $context.Values.livenessProbe.failureThreshold }} + httpGet: + port: http + path: /healthz?full=true + resources: + {{- toYaml $context.Values.resources | nindent 10 }} + volumeMounts: + {{- if $context.Values.global.codefresh.tls.caCerts.secretKeyRef }} + - name: codefresh-tls + mountPath: /app/config/codefresh-tls + {{- end }} + {{- with $context.Values.extraVolumeMounts }} + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with $context.Values.nodeSelector | default $context.Values.global.nodeSelector }} + nodeSelector: {{ toYaml . | nindent 8 }} + {{- end }} + {{- with $context.Values.tolerations | default $context.Values.global.tolerations }} + tolerations: {{ toYaml . | nindent 6 }} + {{- end }} + {{- with $context.Values.affinity }} + affinity: {{ toYaml . | nindent 8 }} + {{- end }} + {{- with $context.Values.topologySpreadConstraints }} + topologySpreadConstraints: {{- include (printf "%s.tplrender" $cfCommonTplSemver ) (dict "Values" . "context" .) | nindent 8 }} + {{- end }} + volumes: + {{- if $context.Values.global.codefresh.tls.caCerts.secretKeyRef }} + - name: codefresh-tls + secret: + secretName: {{ $context.Values.global.codefresh.tls.caCerts.secretKeyRef.name }} + {{- end }} + {{- with $context.Values.extraVolumes }} + {{- toYaml . | nindent 6 }} + {{- end }} diff --git a/charts/gitops-runtime/templates/argo-api-gateway/hpa.yaml b/charts/gitops-runtime/templates/argo-api-gateway/hpa.yaml new file mode 100644 index 00000000..a963eeac --- /dev/null +++ b/charts/gitops-runtime/templates/argo-api-gateway/hpa.yaml @@ -0,0 +1,38 @@ +{{- $context := deepCopy . }} +{{- $_ := set $context "Values" (deepCopy (get .Values "argo-api-gateway")) }} +{{- $_ := set $context.Values "global" (deepCopy (get .Values "global")) }} +{{- if and $context.Values.hpa.enabled }} +apiVersion: autoscaling/v2 +kind: HorizontalPodAutoscaler +metadata: + name: {{ include "argo-api-gateway.fullname" . }} + labels: + {{- include "argo-api-gateway.labels" . | nindent 4 }} +spec: + scaleTargetRef: + apiVersion: apps/v1 + kind: Deployment + name: {{ include "argo-api-gateway.fullname" . }} + minReplicas: {{ $context.Values.hpa.minReplicas | default 1 }} + maxReplicas: {{ $context.Values.hpa.maxReplicas | default 10 }} + metrics: + {{- if $context.Values.hpa.metrics }} + {{- toYaml $context.Values.hpa.metrics | indent 4 }} + {{- end }} + {{- with $context.Values.hpa.targetMemoryUtilizationPercentage }} + - type: Resource + resource: + name: memory + target: + type: Utilization + averageUtilization: {{ . | int }} + {{- end }} + {{- with $context.Values.hpa.targetCPUUtilizationPercentage }} + - type: Resource + resource: + name: cpu + target: + type: Utilization + averageUtilization: {{ . | int }} + {{- end }} +{{- end -}} diff --git a/charts/gitops-runtime/templates/argo-api-gateway/pdb.yaml b/charts/gitops-runtime/templates/argo-api-gateway/pdb.yaml new file mode 100644 index 00000000..75b69c6f --- /dev/null +++ b/charts/gitops-runtime/templates/argo-api-gateway/pdb.yaml @@ -0,0 +1,20 @@ +{{- $context := deepCopy . }} +{{- $_ := set $context "Values" (deepCopy (get .Values "argo-api-gateway")) }} +{{- $_ := set $context.Values "global" (deepCopy (get .Values "global")) }} + +{{- if and $context.Values.pdb.enabled }} +apiVersion: policy/v1beta1 +kind: PodDisruptionBudget +metadata: + name: {{ include "argo-api-gateway.fullname" . }} +spec: + {{- with $context.Values.pdb.minAvailable }} + minAvailable: {{ . }} + {{- end }} + {{- with $context.Values.pdb.maxUnavailable }} + maxUnavailable: {{ . }} + {{- end }} + selector: + matchLabels: + {{- include "argo-api-gateway.selectorLabels" . | nindent 6 }} +{{- end }} diff --git a/charts/gitops-runtime/templates/argo-api-gateway/rbac.yaml b/charts/gitops-runtime/templates/argo-api-gateway/rbac.yaml new file mode 100644 index 00000000..2a0cc012 --- /dev/null +++ b/charts/gitops-runtime/templates/argo-api-gateway/rbac.yaml @@ -0,0 +1,64 @@ +{{- $context := deepCopy . }} +{{- $_ := set $context "Values" (deepCopy (get .Values "argo-api-gateway")) }} +{{- $_ := set $context.Values "global" (deepCopy (get .Values "global")) }} +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ include "argo-api-gateway.serviceAccountName" $context }} + labels: + {{- include "argo-api-gateway.labels" . | nindent 4 }} +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: {{ include "argo-api-gateway.fullname" . }} + labels: + {{- include "argo-api-gateway.labels" . | nindent 4 }} +rules: + - apiGroups: + - '' + resources: + - configmaps + - secrets + verbs: + - get + - list + - watch + - apiGroups: + - '' + - apps + resources: + - deployments + - podtemplates + verbs: + - patch + - apiGroups: + - apps + resources: + - replicasets + verbs: + - list + - patch + - apiGroups: + - argoproj.io + resources: + - rollouts + - rollouts/status + verbs: + - get + - patch +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: {{ include "argo-api-gateway.fullname" . }} + labels: + {{- include "argo-api-gateway.labels" . | nindent 4 }} +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: {{ include "argo-api-gateway.fullname" . }} +subjects: + - kind: ServiceAccount + name: {{ include "argo-api-gateway.serviceAccountName" $context }} + namespace: {{ .Release.Namespace }} diff --git a/charts/gitops-runtime/templates/argo-api-gateway/service.yaml b/charts/gitops-runtime/templates/argo-api-gateway/service.yaml new file mode 100644 index 00000000..1b7a0cf4 --- /dev/null +++ b/charts/gitops-runtime/templates/argo-api-gateway/service.yaml @@ -0,0 +1,18 @@ +{{- $context := deepCopy . }} +{{- $_ := set $context "Values" (deepCopy (get .Values "argo-api-gateway")) }} +{{- $_ := set $context.Values "global" (deepCopy (get .Values "global")) }} +apiVersion: v1 +kind: Service +metadata: + name: {{ include "argo-api-gateway.fullname" . }} + labels: + {{- include "argo-api-gateway.labels" . | nindent 4 }} +spec: + type: {{ $context.Values.service.type | default "ClusterIP" }} + ports: + - port: {{ $context.Values.service.port | default 80 }} + targetPort: {{ $context.Values.service.targetPort | default "http" }} + protocol: TCP + name: http + selector: + {{- include "argo-api-gateway.selectorLabels" . | nindent 4 }} diff --git a/charts/gitops-runtime/values.yaml b/charts/gitops-runtime/values.yaml index 06f05df7..07507740 100644 --- a/charts/gitops-runtime/values.yaml +++ b/charts/gitops-runtime/values.yaml @@ -804,3 +804,42 @@ cf-argocd-extras: enabled: false minAvailable: "50%" maxUnavailable: "" + + +argo-api-gateway: + image: + registry: quay.io + repository: codefresh/cf-argocd-extras + tag: c74d94c + nodeSelector: {} + tolerations: [] + affinity: {} + resources: + requests: + memory: "128Mi" + cpu: "100m" + hpa: + enabled: true + minReplicas: 1 + maxReplicas: 10 + targetCPUUtilizationPercentage: 70 + pdb: + enabled: true + minAvailable: "50%" + maxUnavailable: "" + service: + type: ClusterIP + serviceAccount: + create: true + readinessProbe: + failureThreshold: 3 + initialDelaySeconds: 10 + periodSeconds: 10 + successThreshold: 1 + timeoutSeconds: 10 + livenessProbe: + failureThreshold: 3 + initialDelaySeconds: 10 + periodSeconds: 10 + successThreshold: 1 + timeoutSeconds: 10 From 1ffa1972063481a80372212654a80ddfdb71e347 Mon Sep 17 00:00:00 2001 From: Mikhail Klimko Date: Fri, 19 Sep 2025 17:55:56 +0300 Subject: [PATCH 02/37] refactor cf-argocd-extras --- .../templates/argo-api-gateway/_env.yaml | 20 ++ .../templates/argo-api-gateway/configmap.yaml | 4 +- .../event-reporter/configmap.yaml | 1 - .../cf-argocd-extras/event-reporter/pdb.yaml | 1 - .../cf-argocd-extras/event-reporter/rbac.yaml | 1 - .../event-reporter/service.yaml | 1 - .../event-reporter/serviceMonitor.yaml | 1 - .../event-reporter/statefulset.yaml | 1 - .../sources-server/configmap.yaml | 1 - .../sources-server/deployment.yaml | 1 - .../cf-argocd-extras/sources-server/hpa.yaml | 1 - .../cf-argocd-extras/sources-server/pdb.yaml | 1 - .../cf-argocd-extras/sources-server/rbac.yaml | 1 - .../sources-server/service.yaml | 1 - .../rollout-reporter/clusterrolebinding.yaml | 24 --- .../rollout-reporter/eventsource.yaml | 6 - .../rollout-reporter/rbac.yaml | 6 - .../rollout-reporter/sensor.yaml | 11 -- .../rollout-reporter/serviceaccount.yaml | 6 - .../workflow-reporter/eventsource.yaml | 7 - .../workflow-reporter/rbac.yaml | 7 - .../workflow-reporter/sensor.yaml | 12 -- .../workflow-reporter/serviceaccount.yaml | 7 - charts/gitops-runtime/values.yaml | 173 +++++++++--------- 24 files changed, 106 insertions(+), 189 deletions(-) delete mode 100644 charts/gitops-runtime/templates/cf-argocd-extras/event-reporter/configmap.yaml delete mode 100644 charts/gitops-runtime/templates/cf-argocd-extras/event-reporter/pdb.yaml delete mode 100644 charts/gitops-runtime/templates/cf-argocd-extras/event-reporter/rbac.yaml delete mode 100644 charts/gitops-runtime/templates/cf-argocd-extras/event-reporter/service.yaml delete mode 100644 charts/gitops-runtime/templates/cf-argocd-extras/event-reporter/serviceMonitor.yaml delete mode 100644 charts/gitops-runtime/templates/cf-argocd-extras/event-reporter/statefulset.yaml delete mode 100644 charts/gitops-runtime/templates/cf-argocd-extras/sources-server/configmap.yaml delete mode 100644 charts/gitops-runtime/templates/cf-argocd-extras/sources-server/deployment.yaml delete mode 100644 charts/gitops-runtime/templates/cf-argocd-extras/sources-server/hpa.yaml delete mode 100644 charts/gitops-runtime/templates/cf-argocd-extras/sources-server/pdb.yaml delete mode 100644 charts/gitops-runtime/templates/cf-argocd-extras/sources-server/rbac.yaml delete mode 100644 charts/gitops-runtime/templates/cf-argocd-extras/sources-server/service.yaml delete mode 100644 charts/gitops-runtime/templates/event-reporters/rollout-reporter/clusterrolebinding.yaml delete mode 100644 charts/gitops-runtime/templates/event-reporters/rollout-reporter/eventsource.yaml delete mode 100644 charts/gitops-runtime/templates/event-reporters/rollout-reporter/rbac.yaml delete mode 100644 charts/gitops-runtime/templates/event-reporters/rollout-reporter/sensor.yaml delete mode 100644 charts/gitops-runtime/templates/event-reporters/rollout-reporter/serviceaccount.yaml delete mode 100644 charts/gitops-runtime/templates/event-reporters/workflow-reporter/eventsource.yaml delete mode 100644 charts/gitops-runtime/templates/event-reporters/workflow-reporter/rbac.yaml delete mode 100644 charts/gitops-runtime/templates/event-reporters/workflow-reporter/sensor.yaml delete mode 100644 charts/gitops-runtime/templates/event-reporters/workflow-reporter/serviceaccount.yaml diff --git a/charts/gitops-runtime/templates/argo-api-gateway/_env.yaml b/charts/gitops-runtime/templates/argo-api-gateway/_env.yaml index 93763bfc..e5ec4804 100644 --- a/charts/gitops-runtime/templates/argo-api-gateway/_env.yaml +++ b/charts/gitops-runtime/templates/argo-api-gateway/_env.yaml @@ -2,6 +2,26 @@ HTTP_PROXY: {{ .Values.global.httpProxy | squote}} HTTPS_PROXY: {{ .Values.global.httpsProxy | squote }} NO_PROXY: {{ .Values.global.noProxy | squote }} + +{{- if and (eq (index .Values "global" "external-argo-cd" "auth" "type") "token") }} + {{- if not (index .Values "global" "external-argo-cd" "auth" "token") }} +ARGO_CD_TOKEN_SECRET_NAME: {{ required ".Values.global.external-argo-cd.auth.type is set to 'token' therefore Values.global.external-argo-cd.auth.tokenSecretKeyRef.name is required" (index .Values "global" "external-argo-cd" "auth" "tokenSecretKeyRef" "name") }} +ARGO_CD_TOKEN_SECRET_KEY: {{ required ".Values.global.external-argo-cd.auth.type is set to 'token' therefore Values.global.external-argo-cd.auth.tokenSecretKeyRef.key is required" (index .Values "global" "external-argo-cd" "auth" "tokenSecretKeyRef" "key" ) }} + {{- else }} +ARGO_CD_TOKEN_SECRET_NAME: "gitops-runtime-argo-cd-token" +ARGO_CD_TOKEN_SECRET_KEY: "token" + {{- end }} +{{- end }} + +{{- if and (index .Values "global" "external-argo-cd" "server" "rootpath") }} +ARGOCD_SERVER_ROOTPATH: {{ index .Values "global" "external-argo-cd" "server" "rootpath" }} +{{- end }} + +{{- if or .Values.global.codefresh.tls.caCerts.secret.create (and .Values.global.codefresh.tls.caCerts.secretKeyRef.key .Values.global.codefresh.tls.caCerts.secretKeyRef.name) }} + {{- $secretKey := .Values.global.codefresh.tls.caCerts.secret.create | ternary (default "ca-bundle.crt" .Values.global.codefresh.tls.caCerts.secret.key) .Values.global.codefresh.tls.caCerts.secretKeyRef.key }} +CODEFRESH_SSL_CERT_PATH: {{ printf "/app/config/codefresh-tls-certs/%s" $secretKey }} +{{- end }} + {{- end }} {{- define "argo-api-gateway.resources.environment-variables.defaults" -}} diff --git a/charts/gitops-runtime/templates/argo-api-gateway/configmap.yaml b/charts/gitops-runtime/templates/argo-api-gateway/configmap.yaml index 20d3a336..dd9d01d8 100644 --- a/charts/gitops-runtime/templates/argo-api-gateway/configmap.yaml +++ b/charts/gitops-runtime/templates/argo-api-gateway/configmap.yaml @@ -1,6 +1,6 @@ {{- define "argo-api-gateway.resources.configmap.defaults"}} -argocd.server: argo-cd-server:80 -repo.server: argo-cd-repo-server:8081 +argocd.server: {{ include "codefresh-gitops-runtime.argocd.server.no-protocol-url" . }} +repo.server: {{ include "codefresh-gitops-runtime.argocd.reposerver.url" . }} {{- end }} {{- $defaultConfig := (include "argo-api-gateway.resources.configmap.defaults" . | fromYaml ) }} diff --git a/charts/gitops-runtime/templates/cf-argocd-extras/event-reporter/configmap.yaml b/charts/gitops-runtime/templates/cf-argocd-extras/event-reporter/configmap.yaml deleted file mode 100644 index 536185fb..00000000 --- a/charts/gitops-runtime/templates/cf-argocd-extras/event-reporter/configmap.yaml +++ /dev/null @@ -1 +0,0 @@ -{{- include "cf-argocd-extras.event-reporter.configmap" . }} diff --git a/charts/gitops-runtime/templates/cf-argocd-extras/event-reporter/pdb.yaml b/charts/gitops-runtime/templates/cf-argocd-extras/event-reporter/pdb.yaml deleted file mode 100644 index f0d5e459..00000000 --- a/charts/gitops-runtime/templates/cf-argocd-extras/event-reporter/pdb.yaml +++ /dev/null @@ -1 +0,0 @@ -{{- include "cf-argocd-extras.event-reporter.pdb" . }} diff --git a/charts/gitops-runtime/templates/cf-argocd-extras/event-reporter/rbac.yaml b/charts/gitops-runtime/templates/cf-argocd-extras/event-reporter/rbac.yaml deleted file mode 100644 index a2ecb9d6..00000000 --- a/charts/gitops-runtime/templates/cf-argocd-extras/event-reporter/rbac.yaml +++ /dev/null @@ -1 +0,0 @@ -{{- include "cf-argocd-extras.event-reporter.rbac" . }} diff --git a/charts/gitops-runtime/templates/cf-argocd-extras/event-reporter/service.yaml b/charts/gitops-runtime/templates/cf-argocd-extras/event-reporter/service.yaml deleted file mode 100644 index 1666e60e..00000000 --- a/charts/gitops-runtime/templates/cf-argocd-extras/event-reporter/service.yaml +++ /dev/null @@ -1 +0,0 @@ -{{- include "cf-argocd-extras.event-reporter.service" . }} diff --git a/charts/gitops-runtime/templates/cf-argocd-extras/event-reporter/serviceMonitor.yaml b/charts/gitops-runtime/templates/cf-argocd-extras/event-reporter/serviceMonitor.yaml deleted file mode 100644 index 63c88afe..00000000 --- a/charts/gitops-runtime/templates/cf-argocd-extras/event-reporter/serviceMonitor.yaml +++ /dev/null @@ -1 +0,0 @@ -{{- include "cf-argocd-extras.event-reporter.serviceMonitor" . }} diff --git a/charts/gitops-runtime/templates/cf-argocd-extras/event-reporter/statefulset.yaml b/charts/gitops-runtime/templates/cf-argocd-extras/event-reporter/statefulset.yaml deleted file mode 100644 index ad89d91e..00000000 --- a/charts/gitops-runtime/templates/cf-argocd-extras/event-reporter/statefulset.yaml +++ /dev/null @@ -1 +0,0 @@ -{{- include "cf-argocd-extras.event-reporter.statefulset" . }} diff --git a/charts/gitops-runtime/templates/cf-argocd-extras/sources-server/configmap.yaml b/charts/gitops-runtime/templates/cf-argocd-extras/sources-server/configmap.yaml deleted file mode 100644 index e03d8e37..00000000 --- a/charts/gitops-runtime/templates/cf-argocd-extras/sources-server/configmap.yaml +++ /dev/null @@ -1 +0,0 @@ -{{- include "cf-argocd-extras.sources-server.configmap" . }} diff --git a/charts/gitops-runtime/templates/cf-argocd-extras/sources-server/deployment.yaml b/charts/gitops-runtime/templates/cf-argocd-extras/sources-server/deployment.yaml deleted file mode 100644 index abc9e889..00000000 --- a/charts/gitops-runtime/templates/cf-argocd-extras/sources-server/deployment.yaml +++ /dev/null @@ -1 +0,0 @@ -{{- include "cf-argocd-extras.sources-server.deployment" . }} diff --git a/charts/gitops-runtime/templates/cf-argocd-extras/sources-server/hpa.yaml b/charts/gitops-runtime/templates/cf-argocd-extras/sources-server/hpa.yaml deleted file mode 100644 index b5817fd6..00000000 --- a/charts/gitops-runtime/templates/cf-argocd-extras/sources-server/hpa.yaml +++ /dev/null @@ -1 +0,0 @@ -{{- include "cf-argocd-extras.sources-server.hpa" . }} diff --git a/charts/gitops-runtime/templates/cf-argocd-extras/sources-server/pdb.yaml b/charts/gitops-runtime/templates/cf-argocd-extras/sources-server/pdb.yaml deleted file mode 100644 index af83e596..00000000 --- a/charts/gitops-runtime/templates/cf-argocd-extras/sources-server/pdb.yaml +++ /dev/null @@ -1 +0,0 @@ -{{- include "cf-argocd-extras.sources-server.pdb" . }} diff --git a/charts/gitops-runtime/templates/cf-argocd-extras/sources-server/rbac.yaml b/charts/gitops-runtime/templates/cf-argocd-extras/sources-server/rbac.yaml deleted file mode 100644 index 0157b716..00000000 --- a/charts/gitops-runtime/templates/cf-argocd-extras/sources-server/rbac.yaml +++ /dev/null @@ -1 +0,0 @@ -{{- include "cf-argocd-extras.sources-server.rbac" . }} diff --git a/charts/gitops-runtime/templates/cf-argocd-extras/sources-server/service.yaml b/charts/gitops-runtime/templates/cf-argocd-extras/sources-server/service.yaml deleted file mode 100644 index c81f843b..00000000 --- a/charts/gitops-runtime/templates/cf-argocd-extras/sources-server/service.yaml +++ /dev/null @@ -1 +0,0 @@ -{{- include "cf-argocd-extras.sources-server.service" . }} diff --git a/charts/gitops-runtime/templates/event-reporters/rollout-reporter/clusterrolebinding.yaml b/charts/gitops-runtime/templates/event-reporters/rollout-reporter/clusterrolebinding.yaml deleted file mode 100644 index 534ac500..00000000 --- a/charts/gitops-runtime/templates/event-reporters/rollout-reporter/clusterrolebinding.yaml +++ /dev/null @@ -1,24 +0,0 @@ -{{/* Mapping of argo rollouts clusterrole if such is created (see https://github.com/codefresh-io/argo-helm/blob/argo-rollouts/charts/argo-rollouts/templates/controller/clusterrolebinding.yaml) - to the reporters ServiceAccount -*/}} -{{- if or (index (get .Values "argo-rollouts") "enabled") (and (not (index (get .Values "argo-rollouts") "enabled")) (index .Values.global "external-argo-rollouts" "rollout-reporter" "enabled" )) }} - {{- if or (and (index (get .Values "argo-rollouts") "clusterInstall") (index (get .Values "argo-rollouts") "controller" "createClusterRole")) (and (not (index (get .Values "argo-rollouts") "enabled")) (index .Values.global "external-argo-rollouts" "rollout-reporter" "enabled" ))}} - {{- $eventReporterContext := deepCopy . }} - {{- $_ := set $eventReporterContext "Values" (deepCopy (get .Values "event-reporters")) }} - {{- $_ := set $eventReporterContext.Values "global" (deepCopy (get .Values "global")) }} -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRoleBinding -metadata: - name: codefresh-rollouts-reporter - labels: - {{- include "event-reporters.rollout-reporter.labels" . | nindent 4}} -roleRef: - apiGroup: rbac.authorization.k8s.io - kind: ClusterRole - name: {{ include "codefresh-gitops-runtime.argo-rollouts.name" . }} -subjects: - - kind: ServiceAccount - name: {{ include "event-reporters.rollout-reporter.serviceAccountName" $eventReporterContext }} - namespace: {{ .Release.Namespace }} - {{- end }} -{{- end }} diff --git a/charts/gitops-runtime/templates/event-reporters/rollout-reporter/eventsource.yaml b/charts/gitops-runtime/templates/event-reporters/rollout-reporter/eventsource.yaml deleted file mode 100644 index ea09f3a1..00000000 --- a/charts/gitops-runtime/templates/event-reporters/rollout-reporter/eventsource.yaml +++ /dev/null @@ -1,6 +0,0 @@ -{{- if or (index (get .Values "argo-rollouts") "enabled") (and (not (index (get .Values "argo-rollouts") "enabled")) (index .Values.global "external-argo-rollouts" "rollout-reporter" "enabled" )) }} - {{- $eventReporterContext := deepCopy . }} - {{- $_ := set $eventReporterContext "Values" (deepCopy (get .Values "event-reporters")) }} - {{- $_ := set $eventReporterContext.Values "global" (deepCopy (get .Values "global")) }} - {{- include "event-reporters.rollout-reporter.eventsource" $eventReporterContext }} -{{- end }} diff --git a/charts/gitops-runtime/templates/event-reporters/rollout-reporter/rbac.yaml b/charts/gitops-runtime/templates/event-reporters/rollout-reporter/rbac.yaml deleted file mode 100644 index bb2c051f..00000000 --- a/charts/gitops-runtime/templates/event-reporters/rollout-reporter/rbac.yaml +++ /dev/null @@ -1,6 +0,0 @@ -{{- if or (index (get .Values "argo-rollouts") "enabled") (and (not (index (get .Values "argo-rollouts") "enabled")) (index .Values.global "external-argo-rollouts" "rollout-reporter" "enabled" )) }} - {{- $eventReporterContext := deepCopy . }} - {{- $_ := set $eventReporterContext "Values" (deepCopy (get .Values "event-reporters")) }} - {{- $_ := set $eventReporterContext.Values "global" (deepCopy (get .Values "global")) }} - {{- include "event-reporters.rollout-reporter.rbac" $eventReporterContext }} -{{- end }} diff --git a/charts/gitops-runtime/templates/event-reporters/rollout-reporter/sensor.yaml b/charts/gitops-runtime/templates/event-reporters/rollout-reporter/sensor.yaml deleted file mode 100644 index 571b2019..00000000 --- a/charts/gitops-runtime/templates/event-reporters/rollout-reporter/sensor.yaml +++ /dev/null @@ -1,11 +0,0 @@ -{{- if or (index (get .Values "argo-rollouts") "enabled") (and (not (index (get .Values "argo-rollouts") "enabled")) (index .Values.global "external-argo-rollouts" "rollout-reporter" "enabled" )) }} - {{- $eventReporterContext := deepCopy . }} - {{- $_ := set $eventReporterContext "Values" (deepCopy (get .Values "event-reporters")) }} - {{- $_ := set $eventReporterContext.Values "global" (deepCopy (get .Values "global")) }} - - {{- $globalProxyEnv := (include "codefresh-gitops-runtime.get-proxy-env-vars" . | fromYaml) }} - {{- $mergedEnv := mergeOverwrite $globalProxyEnv $eventReporterContext.Values.rollout.sensor.env }} - {{- $_ := set $eventReporterContext.Values.rollout.sensor "env" $mergedEnv }} - - {{- include "event-reporters.rollout-reporter.sensor" $eventReporterContext }} -{{- end }} diff --git a/charts/gitops-runtime/templates/event-reporters/rollout-reporter/serviceaccount.yaml b/charts/gitops-runtime/templates/event-reporters/rollout-reporter/serviceaccount.yaml deleted file mode 100644 index ddf72053..00000000 --- a/charts/gitops-runtime/templates/event-reporters/rollout-reporter/serviceaccount.yaml +++ /dev/null @@ -1,6 +0,0 @@ -{{- if or (index (get .Values "argo-rollouts") "enabled") (and (not (index (get .Values "argo-rollouts") "enabled")) (index .Values.global "external-argo-rollouts" "rollout-reporter" "enabled" )) }} - {{- $eventReporterContext := deepCopy . }} - {{- $_ := set $eventReporterContext "Values" (deepCopy (get .Values "event-reporters")) }} - {{- $_ := set $eventReporterContext.Values "global" (deepCopy (get .Values "global")) }} - {{- include "event-reporters.rollout-reporter.sa" $eventReporterContext }} -{{- end }} diff --git a/charts/gitops-runtime/templates/event-reporters/workflow-reporter/eventsource.yaml b/charts/gitops-runtime/templates/event-reporters/workflow-reporter/eventsource.yaml deleted file mode 100644 index fb23ffd8..00000000 --- a/charts/gitops-runtime/templates/event-reporters/workflow-reporter/eventsource.yaml +++ /dev/null @@ -1,7 +0,0 @@ - -{{- if index (get .Values "argo-workflows") "enabled" }} - {{- $eventReporterContext := deepCopy . }} - {{- $_ := set $eventReporterContext "Values" (deepCopy (get .Values "event-reporters")) }} - {{- $_ := set $eventReporterContext.Values "global" (deepCopy (get .Values "global")) }} - {{- include "event-reporters.workflow-reporter.eventsource" $eventReporterContext }} -{{- end }} diff --git a/charts/gitops-runtime/templates/event-reporters/workflow-reporter/rbac.yaml b/charts/gitops-runtime/templates/event-reporters/workflow-reporter/rbac.yaml deleted file mode 100644 index 93e17e40..00000000 --- a/charts/gitops-runtime/templates/event-reporters/workflow-reporter/rbac.yaml +++ /dev/null @@ -1,7 +0,0 @@ - -{{- if index (get .Values "argo-workflows") "enabled" }} - {{- $eventReporterContext := deepCopy . }} - {{- $_ := set $eventReporterContext "Values" (deepCopy (get .Values "event-reporters")) }} - {{- $_ := set $eventReporterContext.Values "global" (deepCopy (get .Values "global")) }} - {{- include "event-reporters.workflow-reporter.rbac" $eventReporterContext }} -{{- end }} diff --git a/charts/gitops-runtime/templates/event-reporters/workflow-reporter/sensor.yaml b/charts/gitops-runtime/templates/event-reporters/workflow-reporter/sensor.yaml deleted file mode 100644 index 97f73fb7..00000000 --- a/charts/gitops-runtime/templates/event-reporters/workflow-reporter/sensor.yaml +++ /dev/null @@ -1,12 +0,0 @@ - -{{- if index (get .Values "argo-workflows") "enabled" }} - {{- $eventReporterContext := deepCopy . }} - {{- $_ := set $eventReporterContext "Values" (deepCopy (get .Values "event-reporters")) }} - {{- $_ := set $eventReporterContext.Values "global" (deepCopy (get .Values "global")) }} - - {{- $globalProxyEnv := (include "codefresh-gitops-runtime.get-proxy-env-vars" . | fromYaml) }} - {{- $mergedEnv := mergeOverwrite $globalProxyEnv $eventReporterContext.Values.workflow.sensor.env }} - {{- $_ := set $eventReporterContext.Values.workflow.sensor "env" $mergedEnv }} - - {{- include "event-reporters.workflow-reporter.sensor" $eventReporterContext }} -{{- end }} diff --git a/charts/gitops-runtime/templates/event-reporters/workflow-reporter/serviceaccount.yaml b/charts/gitops-runtime/templates/event-reporters/workflow-reporter/serviceaccount.yaml deleted file mode 100644 index c78179dc..00000000 --- a/charts/gitops-runtime/templates/event-reporters/workflow-reporter/serviceaccount.yaml +++ /dev/null @@ -1,7 +0,0 @@ - -{{- if index (get .Values "argo-workflows") "enabled" }} - {{- $eventReporterContext := deepCopy . }} - {{- $_ := set $eventReporterContext "Values" (deepCopy (get .Values "event-reporters")) }} - {{- $_ := set $eventReporterContext.Values "global" (deepCopy (get .Values "global")) }} - {{- include "event-reporters.workflow-reporter.sa" $eventReporterContext }} -{{- end }} diff --git a/charts/gitops-runtime/values.yaml b/charts/gitops-runtime/values.yaml index 07507740..2f282f56 100644 --- a/charts/gitops-runtime/values.yaml +++ b/charts/gitops-runtime/values.yaml @@ -17,7 +17,9 @@ global: # -- Custom CA certificates bundle for platform access with ssl caCerts: # -- Reference to existing secret - secretKeyRef: {} + secretKeyRef: + name: "" + key: "" # -- Chart managed secret for custom platform CA certificates secret: # -- Whether to create the secret. @@ -337,94 +339,6 @@ argo-rollouts: replicas: 1 installCRDs: true #----------------------------------------------------------------------------------------------------------------------- -# Event reporters -#----------------------------------------------------------------------------------------------------------------------- -event-reporters: - rollout: - serviceAccount: - create: true - eventSource: - replicas: 1 - resources: {} - tolerations: [] - nodeSelector: {} - affinity: {} - sensor: - # -- Set to true to enable logging. Set intervalSeconds to add logging interval to moderate log flow. - logging: - enabled: false - intervalSeconds: 0 - # -- At Least Once - atLeastOnce: true - # -- Retry strategy for events sent to Codefresh - retryStrategy: - # -- Number of retries - steps: 3 - # -- The initial duration, use strings like "2s", "1m" - duration: 0 - # -- Duration is multiplied by factor each retry, if factor is not zero and steps limit has not been reached. Should not be negative - factor: 1.0 - # -- The sleep between each retry is the duration plus an additional amount chosen uniformly at random from the interval between zero and `jitter * duration`. - jitter: 1 - policy: - status: - allow: - - 200 - - 201 - - 204 - - 400 - - 401 - - 404 - replicas: 1 - resources: {} - # -- Environment variables for sensor pods - add DEBUG_LOG: "true" to add debug level logs - env: {} - tolerations: [] - nodeSelector: {} - affinity: {} - workflow: - serviceAccount: - create: true - eventSource: - replicas: 1 - resources: {} - tolerations: [] - nodeSelector: {} - affinity: {} - sensor: - # -- Set to true to enable logging. Set intervalSeconds to add logging interval to moderate log flow. - logging: - enabled: false - intervalSeconds: 0 - # -- At Least Once - atLeastOnce: true - # -- Retry strategy for events sent to Codefresh - retryStrategy: - # -- Number of retries - steps: 3 - # -- The initial duration, use strings like "2s", "1m" - duration: 0 - # -- Duration is multiplied by factor each retry, if factor is not zero and steps limit has not been reached. Should not be negative - factor: 1.0 - # -- The sleep between each retry is the duration plus an additional amount chosen uniformly at random from the interval between zero and `jitter * duration`. - jitter: 1 - policy: - status: - allow: - - 200 - - 201 - - 204 - - 400 - - 401 - - 404 - replicas: 1 - resources: {} - # -- Environment variables for sensor pods - add DEBUG_LOG: "true" to add debug level logs - env: {} - tolerations: [] - nodeSelector: {} - affinity: {} -#----------------------------------------------------------------------------------------------------------------------- # Internal router #----------------------------------------------------------------------------------------------------------------------- internal-router: @@ -843,3 +757,84 @@ argo-api-gateway: periodSeconds: 10 successThreshold: 1 timeoutSeconds: 10 + +event-reporters: + runtime-reporter: + image: + registry: quay.io + repository: codefresh/cf-argocd-extras + tag: c74d94c + nodeSelector: {} + tolerations: [] + affinity: {} + resources: + requests: + memory: "128Mi" + cpu: "100m" + pdb: + enabled: true + minAvailable: "50%" + maxUnavailable: "" + service: + type: ClusterIP + ports: + http: + port: 8088 + targetPort: 8088 + metrics: + port: 8087 + targetPort: 8087 + serviceAccount: + create: true + readinessProbe: + failureThreshold: 3 + initialDelaySeconds: 10 + periodSeconds: 10 + successThreshold: 1 + timeoutSeconds: 10 + livenessProbe: + failureThreshold: 3 + initialDelaySeconds: 10 + periodSeconds: 10 + successThreshold: 1 + timeoutSeconds: 10 + + resources-reporter: + image: + registry: quay.io + repository: codefresh/cf-argocd-extras + tag: c74d94c + nodeSelector: {} + tolerations: [] + affinity: {} + resources: + requests: + memory: "128Mi" + cpu: "100m" + pdb: + enabled: true + minAvailable: "50%" + maxUnavailable: "" + service: + type: ClusterIP + ports: + http: + port: 8088 + targetPort: 8088 + metrics: + port: 8087 + targetPort: 8087 + serviceAccount: + create: true + readinessProbe: + failureThreshold: 3 + initialDelaySeconds: 10 + periodSeconds: 10 + successThreshold: 1 + timeoutSeconds: 10 + livenessProbe: + failureThreshold: 3 + initialDelaySeconds: 10 + periodSeconds: 10 + successThreshold: 1 + timeoutSeconds: 10 From f4e61f80f14b34874395465db1079607265d5446 Mon Sep 17 00:00:00 2001 From: Mikhail Klimko Date: Fri, 19 Sep 2025 17:56:00 +0300 Subject: [PATCH 03/37] refactor cf-argocd-extras --- .../resources-reporter/_env.yaml | 184 ++++++++++++++++++ .../resources-reporter/_helpers.tpl | 47 +++++ .../resources-reporter/configmap.yaml | 20 ++ .../resources-reporter/deployment.yaml | 109 +++++++++++ .../resources-reporter/pdb.yaml | 20 ++ .../resources-reporter/rbac.yaml | 42 ++++ .../resources-reporter/service.yaml | 19 ++ .../runtime-reporter/_env.yaml | 184 ++++++++++++++++++ .../runtime-reporter/_helpers.tpl | 47 +++++ .../runtime-reporter/configmap.yaml | 20 ++ .../runtime-reporter/deployment.yaml | 109 +++++++++++ .../event-reporters/runtime-reporter/pdb.yaml | 20 ++ .../runtime-reporter/rbac.yaml | 42 ++++ .../runtime-reporter/service.yaml | 19 ++ 14 files changed, 882 insertions(+) create mode 100644 charts/gitops-runtime/templates/event-reporters/resources-reporter/_env.yaml create mode 100644 charts/gitops-runtime/templates/event-reporters/resources-reporter/_helpers.tpl create mode 100644 charts/gitops-runtime/templates/event-reporters/resources-reporter/configmap.yaml create mode 100644 charts/gitops-runtime/templates/event-reporters/resources-reporter/deployment.yaml create mode 100644 charts/gitops-runtime/templates/event-reporters/resources-reporter/pdb.yaml create mode 100644 charts/gitops-runtime/templates/event-reporters/resources-reporter/rbac.yaml create mode 100644 charts/gitops-runtime/templates/event-reporters/resources-reporter/service.yaml create mode 100644 charts/gitops-runtime/templates/event-reporters/runtime-reporter/_env.yaml create mode 100644 charts/gitops-runtime/templates/event-reporters/runtime-reporter/_helpers.tpl create mode 100644 charts/gitops-runtime/templates/event-reporters/runtime-reporter/configmap.yaml create mode 100644 charts/gitops-runtime/templates/event-reporters/runtime-reporter/deployment.yaml create mode 100644 charts/gitops-runtime/templates/event-reporters/runtime-reporter/pdb.yaml create mode 100644 charts/gitops-runtime/templates/event-reporters/runtime-reporter/rbac.yaml create mode 100644 charts/gitops-runtime/templates/event-reporters/runtime-reporter/service.yaml diff --git a/charts/gitops-runtime/templates/event-reporters/resources-reporter/_env.yaml b/charts/gitops-runtime/templates/event-reporters/resources-reporter/_env.yaml new file mode 100644 index 00000000..408ac968 --- /dev/null +++ b/charts/gitops-runtime/templates/event-reporters/resources-reporter/_env.yaml @@ -0,0 +1,184 @@ +{{- define "resources-reporter.resources.environment-variables.calculated" }} +HTTP_PROXY: {{ .Values.global.httpProxy | squote}} +HTTPS_PROXY: {{ .Values.global.httpsProxy | squote }} +NO_PROXY: {{ .Values.global.noProxy | squote }} + +{{- if and (eq (index .Values "global" "external-argo-cd" "auth" "type") "token") }} + {{- if not (index .Values "global" "external-argo-cd" "auth" "token") }} +ARGO_CD_TOKEN_SECRET_NAME: {{ required ".Values.global.external-argo-cd.auth.type is set to 'token' therefore Values.global.external-argo-cd.auth.tokenSecretKeyRef.name is required" (index .Values "global" "external-argo-cd" "auth" "tokenSecretKeyRef" "name") }} +ARGO_CD_TOKEN_SECRET_KEY: {{ required ".Values.global.external-argo-cd.auth.type is set to 'token' therefore Values.global.external-argo-cd.auth.tokenSecretKeyRef.key is required" (index .Values "global" "external-argo-cd" "auth" "tokenSecretKeyRef" "key" ) }} + {{- else }} +ARGO_CD_TOKEN_SECRET_NAME: "gitops-runtime-argo-cd-token" +ARGO_CD_TOKEN_SECRET_KEY: "token" + {{- end }} +{{- end }} + +{{- if and (index .Values "global" "external-argo-cd" "server" "rootpath") }} +ARGOCD_SERVER_ROOTPATH: {{ index .Values "global" "external-argo-cd" "server" "rootpath" }} +{{- end }} + +{{- if or .Values.global.codefresh.tls.caCerts.secret.create (and .Values.global.codefresh.tls.caCerts.secretKeyRef.key .Values.global.codefresh.tls.caCerts.secretKeyRef.name) }} + {{- $secretKey := .Values.global.codefresh.tls.caCerts.secret.create | ternary (default "ca-bundle.crt" .Values.global.codefresh.tls.caCerts.secret.key) .Values.global.codefresh.tls.caCerts.secretKeyRef.key }} +CODEFRESH_SSL_CERT_PATH: {{ printf "/app/config/codefresh-tls-certs/%s" $secretKey }} +{{- end }} + +{{- end }} + +{{- define "resources-reporter.resources.environment-variables.defaults" -}} +REPORTER_MODE: resource +APP_QUEUE_SIZE: + valueFrom: + configMapKeyRef: + name: resources-reporter-cmd-params-cm + key: app.queue.size +ARGOCD_APPLICATION_NAMESPACES: + valueFrom: + configMapKeyRef: + name: argocd-cmd-params-cm + key: application.namespaces + optional: true +ARGOCD_SERVER: + valueFrom: + configMapKeyRef: + name: resources-reporter-cmd-params-cm + key: argocd.server +ARGOCD_SERVER_ROOTPATH: + valueFrom: + configMapKeyRef: + name: argocd-cmd-params-cm + key: server.rootpath + optional: true +ARGO_CD_TOKEN_SECRET_NAME: argocd-token +ARGO_CD_TOKEN_SECRET_KEY: token +BINARY_NAME: event-reporter +CODEFRESH_SSL_CERT_PATH: "" +CODEFRESH_TLS_INSECURE: + valueFrom: + configMapKeyRef: + name: argocd-cmd-params-cm + key: codefresh.tls.insecure + optional: true +CODEFRESH_TOKEN: + valueFrom: + secretKeyRef: + name: codefresh-token + key: token +CODEFRESH_URL: + valueFrom: + configMapKeyRef: + key: base-url + name: codefresh-cm +EVENT_REPORTER_REPLICAS: 1 +INSECURE: + valueFrom: + configMapKeyRef: + name: resources-reporter-cmd-params-cm + key: insecure + optional: true +LISTEN_ADDRESS: + valueFrom: + configMapKeyRef: + name: resources-reporter-cmd-params-cm + key: listen.address + optional: true +LOG_FORMAT: + valueFrom: + configMapKeyRef: + name: resources-reporter-cmd-params-cm + key: log.format + optional: true +LOG_LEVEL: + valueFrom: + configMapKeyRef: + name: resources-reporter-cmd-params-cm + key: log.level + optional: true +MAX_APP_RETRIES: + valueFrom: + configMapKeyRef: + name: resources-reporter-cmd-params-cm + key: max.app.retries +METRICS_LISTEN_ADDRESS: + valueFrom: + configMapKeyRef: + name: resources-reporter-cmd-params-cm + key: metrics.listen.address + optional: true +OTEL_EXPORTER_OTLP_TRACES_ENDPOINT: + valueFrom: + configMapKeyRef: + name: resources-reporter-cmd-params-cm + key: otlp.address +REDISDB: + valueFrom: + configMapKeyRef: + name: argocd-cmd-params-cm + key: redis.db + optional: true +REDIS_COMPRESSION: + valueFrom: + configMapKeyRef: + name: argocd-cmd-params-cm + key: redis.compression + optional: true +REDIS_PASSWORD: + valueFrom: + secretKeyRef: + name: argocd-redis + key: auth +REDIS_SERVER: + valueFrom: + configMapKeyRef: + name: argocd-cmd-params-cm + key: redis.server +REDIS_USERNAME: + valueFrom: + secretKeyRef: + name: argocd-redis + key: redis-username + optional: true +REPO_SERVER: + valueFrom: + configMapKeyRef: + name: resources-reporter-cmd-params-cm + key: repo.server +REPO_SERVER_PLAINTEXT: + valueFrom: + configMapKeyRef: + name: resources-reporter-cmd-params-cm + key: repo.server.plaintext + optional: true +REPO_SERVER_STRICT_TLS: + valueFrom: + configMapKeyRef: + name: resources-reporter-cmd-params-cm + key: repo.server.strict.tls + optional: true +REPO_SERVER_TIMEOUT_SECONDS: + valueFrom: + configMapKeyRef: + name: resources-reporter-cmd-params-cm + key: repo.server.timeout.seconds + optional: true +RUNTIME_VERSION: + valueFrom: + configMapKeyRef: + name: codefresh-cm + key: version +SHARDING_ALGORITHM: + valueFrom: + configMapKeyRef: + name: resources-reporter-cmd-params-cm + key: sharding.algorithm + optional: true +SOURCES_SERVER: + valueFrom: + configMapKeyRef: + name: resources-reporter-cmd-params-cm + key: sources.server +THREADINESS: + valueFrom: + configMapKeyRef: + name: resources-reporter-cmd-params-cm + key: threadiness +{{- end -}} diff --git a/charts/gitops-runtime/templates/event-reporters/resources-reporter/_helpers.tpl b/charts/gitops-runtime/templates/event-reporters/resources-reporter/_helpers.tpl new file mode 100644 index 00000000..11145ffa --- /dev/null +++ b/charts/gitops-runtime/templates/event-reporters/resources-reporter/_helpers.tpl @@ -0,0 +1,47 @@ +{{/* +Create a default fully qualified app name. +We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +If release name contains chart name it will be used as a full name. +*/}} +{{- define "resources-reporter.fullname" -}} +{{- print "resources-reporter" }} +{{- end }} + +{{/* +Create chart name and version as used by the chart label. +*/}} +{{- define "resources-reporter.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Common labels +*/}} +{{- define "resources-reporter.labels" -}} +helm.sh/chart: {{ include "resources-reporter.chart" . }} +{{ include "resources-reporter.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +app.kubernetes.io/part-of: resources-reporter +codefresh.io/internal: "true" +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "resources-reporter.selectorLabels" -}} +app.kubernetes.io/name: resources-reporter +{{- end }} + +{{/* +Create the name of the service account to use +*/}} +{{- define "resources-reporter.serviceAccountName" -}} +{{- if .Values.serviceAccount.create }} +{{- default (include "resources-reporter.fullname" .) .Values.serviceAccount.name }} +{{- else }} +{{- default "default" .Values.serviceAccount.name }} +{{- end }} +{{- end }} diff --git a/charts/gitops-runtime/templates/event-reporters/resources-reporter/configmap.yaml b/charts/gitops-runtime/templates/event-reporters/resources-reporter/configmap.yaml new file mode 100644 index 00000000..058f5ed8 --- /dev/null +++ b/charts/gitops-runtime/templates/event-reporters/resources-reporter/configmap.yaml @@ -0,0 +1,20 @@ +{{- define "argo-api-gateway.resources.configmap.defaults"}} +argocd.server: {{ include "codefresh-gitops-runtime.argocd.server.no-protocol-url" . }} +redis.server: {{ include "codefresh-gitops-runtime.argocd.redis.url" . }} +repo.server: {{ include "codefresh-gitops-runtime.argocd.reposerver.url" . }} +app.queue.size: '1000' +max.app.retries: '5' +threadiness: '100' +{{- end }} + +{{- $defaultConfig := (include "argo-api-gateway.resources.configmap.defaults" . | fromYaml ) }} +{{- $overrides := index .Values "argo-api-gateway" "config" | default dict }} +{{- $mergedConfig := mergeOverwrite $defaultConfig $overrides }} +apiVersion: v1 +kind: ConfigMap +metadata: + name: resources-reporter-cmd-params-cm + labels: + {{- include "resources-reporter.labels" . | nindent 4 }} +data: + {{- $mergedConfig | toYaml | nindent 2 }} diff --git a/charts/gitops-runtime/templates/event-reporters/resources-reporter/deployment.yaml b/charts/gitops-runtime/templates/event-reporters/resources-reporter/deployment.yaml new file mode 100644 index 00000000..59410ace --- /dev/null +++ b/charts/gitops-runtime/templates/event-reporters/resources-reporter/deployment.yaml @@ -0,0 +1,109 @@ +{{- $cfCommonTplSemver := printf "cf-common-%s" (index .Subcharts "cf-common").Chart.Version }} +{{- $context := deepCopy . }} +{{- $_ := set $context "Values" (deepCopy (get (index .Values "event-reporters") "resources-reporter")) }} +{{- $_ := set $context.Values "global" (deepCopy (get .Values "global")) }} +{{/* Merge environment variables from calculated, defaults and overwrites */}} +{{- $defaults := (include "resources-reporter.resources.environment-variables.defaults" . | fromYaml) }} +{{- $calculated := (include "resources-reporter.resources.environment-variables.calculated" . | fromYaml) }} +{{- $overrides := $context.Values.env }} +{{- $mergedValues := mergeOverwrite $defaults $calculated $overrides }} +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "resources-reporter.fullname" . }} + labels: + {{- include "resources-reporter.labels" . | nindent 4 }} +spec: + replicas: {{ $context.Values.replicaCount }} + selector: + matchLabels: + {{- include "resources-reporter.selectorLabels" . | nindent 6 }} + template: + metadata: + {{- with $context.Values.podAnnotations }} + annotations: + {{- toYaml . | nindent 8 }} + {{- end }} + labels: + {{- include "resources-reporter.selectorLabels" . | nindent 8 }} + {{- with $context.Values.podLabels }} + {{- toYaml . | nindent 8 }} + {{- end }} + spec: + {{- with $context.Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + serviceAccountName: {{ include "resources-reporter.serviceAccountName" $context }} + securityContext: + {{- toYaml $context.Values.podSecurityContext | nindent 8 }} + containers: + - name: {{ include "resources-reporter.fullname" . }} + securityContext: + {{- toYaml $context.Values.securityContext | nindent 12 }} + {{- $imageContext := deepCopy $context.Values.image }} + image: {{ include (printf "%s.image.name" $cfCommonTplSemver ) (dict "image" $imageContext "context" .) }} + env: {{- include (printf "%s.env-vars" $cfCommonTplSemver ) (dict "Values" $mergedValues "context" .) | nindent 8 }} + imagePullPolicy: {{ $context.Values.image.pullPolicy }} + {{- if $context.Values.command }} + command: + {{- $context.Values.command | toYaml | nindent 8 }} + {{- end }} + {{- with $context.Values.extraArgs }} + args: + {{- . | toYaml | nindent 8 }} + {{- end }} + ports: + {{- range $name, $port := $context.Values.service.ports }} + - name: {{ $name }} + containerPort: {{ $port.targetPort }} + {{- end }} + readinessProbe: + initialDelaySeconds: {{ $context.Values.readinessProbe.initialDelaySeconds }} + periodSeconds: {{ $context.Values.readinessProbe.periodSeconds }} + timeoutSeconds: {{ $context.Values.readinessProbe.timeoutSeconds }} + successThreshold: {{ $context.Values.readinessProbe.successThreshold }} + failureThreshold: {{ $context.Values.readinessProbe.failureThreshold }} + httpGet: + port: http + path: /healthz + livenessProbe: + initialDelaySeconds: {{ $context.Values.livenessProbe.initialDelaySeconds }} + periodSeconds: {{ $context.Values.livenessProbe.periodSeconds }} + timeoutSeconds: {{ $context.Values.livenessProbe.timeoutSeconds }} + successThreshold: {{ $context.Values.livenessProbe.successThreshold }} + failureThreshold: {{ $context.Values.livenessProbe.failureThreshold }} + httpGet: + port: http + path: /healthz?full=true + resources: + {{- toYaml $context.Values.resources | nindent 10 }} + volumeMounts: + {{- if $context.Values.global.codefresh.tls.caCerts.secretKeyRef }} + - name: codefresh-tls + mountPath: /app/config/codefresh-tls + {{- end }} + {{- with $context.Values.extraVolumeMounts }} + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with $context.Values.nodeSelector | default $context.Values.global.nodeSelector }} + nodeSelector: {{ toYaml . | nindent 8 }} + {{- end }} + {{- with $context.Values.tolerations | default $context.Values.global.tolerations }} + tolerations: {{ toYaml . | nindent 6 }} + {{- end }} + {{- with $context.Values.affinity }} + affinity: {{ toYaml . | nindent 8 }} + {{- end }} + {{- with $context.Values.topologySpreadConstraints }} + topologySpreadConstraints: {{- include (printf "%s.tplrender" $cfCommonTplSemver ) (dict "Values" . "context" .) | nindent 8 }} + {{- end }} + volumes: + {{- if $context.Values.global.codefresh.tls.caCerts.secretKeyRef }} + - name: codefresh-tls + secret: + secretName: {{ $context.Values.global.codefresh.tls.caCerts.secretKeyRef.name | default "codefresh-tls-certs" }} + {{- end }} + {{- with $context.Values.extraVolumes }} + {{- toYaml . | nindent 6 }} + {{- end }} diff --git a/charts/gitops-runtime/templates/event-reporters/resources-reporter/pdb.yaml b/charts/gitops-runtime/templates/event-reporters/resources-reporter/pdb.yaml new file mode 100644 index 00000000..dce852d3 --- /dev/null +++ b/charts/gitops-runtime/templates/event-reporters/resources-reporter/pdb.yaml @@ -0,0 +1,20 @@ +{{- $context := deepCopy . }} +{{- $_ := set $context "Values" (deepCopy (get (index .Values "event-reporters") "resources-reporter")) }} +{{- $_ := set $context.Values "global" (deepCopy (get .Values "global")) }} + +{{- if and $context.Values.pdb.enabled }} +apiVersion: policy/v1beta1 +kind: PodDisruptionBudget +metadata: + name: {{ include "resources-reporter.fullname" . }} +spec: + {{- with $context.Values.pdb.minAvailable }} + minAvailable: {{ . }} + {{- end }} + {{- with $context.Values.pdb.maxUnavailable }} + maxUnavailable: {{ . }} + {{- end }} + selector: + matchLabels: + {{- include "resources-reporter.selectorLabels" . | nindent 6 }} +{{- end }} diff --git a/charts/gitops-runtime/templates/event-reporters/resources-reporter/rbac.yaml b/charts/gitops-runtime/templates/event-reporters/resources-reporter/rbac.yaml new file mode 100644 index 00000000..bf4fb714 --- /dev/null +++ b/charts/gitops-runtime/templates/event-reporters/resources-reporter/rbac.yaml @@ -0,0 +1,42 @@ +{{- $context := deepCopy . }} +{{- $_ := set $context "Values" (deepCopy (get (index .Values "event-reporters") "resources-reporter")) }} +{{- $_ := set $context.Values "global" (deepCopy (get .Values "global")) }} +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ include "resources-reporter.serviceAccountName" $context }} + labels: + {{- include "resources-reporter.labels" . | nindent 4 }} +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: {{ include "resources-reporter.fullname" . }} + labels: + {{- include "resources-reporter.labels" . | nindent 4 }} +rules: + - apiGroups: + - '*' + resources: + - '*' + verbs: + - '*' + - nonResourceURLs: + - '*' + verbs: + - '*' +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: {{ include "resources-reporter.fullname" . }} + labels: + {{- include "resources-reporter.labels" . | nindent 4 }} +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: {{ include "resources-reporter.fullname" . }} +subjects: + - kind: ServiceAccount + name: {{ include "resources-reporter.serviceAccountName" $context }} + namespace: {{ .Release.Namespace }} diff --git a/charts/gitops-runtime/templates/event-reporters/resources-reporter/service.yaml b/charts/gitops-runtime/templates/event-reporters/resources-reporter/service.yaml new file mode 100644 index 00000000..4f436206 --- /dev/null +++ b/charts/gitops-runtime/templates/event-reporters/resources-reporter/service.yaml @@ -0,0 +1,19 @@ +{{- $context := deepCopy . }} +{{- $_ := set $context "Values" (deepCopy (get (index .Values "event-reporters") "resources-reporter")) }} +{{- $_ := set $context.Values "global" (deepCopy (get .Values "global")) }} +apiVersion: v1 +kind: Service +metadata: + name: {{ include "resources-reporter.fullname" . }} + labels: + {{- include "resources-reporter.labels" . | nindent 4 }} +spec: + type: ClusterIP + ports: +{{- range $name, $port := $context.Values.service.ports }} + - name: {{ $name }} + port: {{ $port.port }} + targetPort: {{ $port.targetPort }} +{{- end }} + selector: + {{- include "resources-reporter.selectorLabels" . | nindent 4 }} diff --git a/charts/gitops-runtime/templates/event-reporters/runtime-reporter/_env.yaml b/charts/gitops-runtime/templates/event-reporters/runtime-reporter/_env.yaml new file mode 100644 index 00000000..113e7a9d --- /dev/null +++ b/charts/gitops-runtime/templates/event-reporters/runtime-reporter/_env.yaml @@ -0,0 +1,184 @@ +{{- define "runtime-reporter.resources.environment-variables.calculated" }} +HTTP_PROXY: {{ .Values.global.httpProxy | squote}} +HTTPS_PROXY: {{ .Values.global.httpsProxy | squote }} +NO_PROXY: {{ .Values.global.noProxy | squote }} + +{{- if and (eq (index .Values "global" "external-argo-cd" "auth" "type") "token") }} + {{- if not (index .Values "global" "external-argo-cd" "auth" "token") }} +ARGO_CD_TOKEN_SECRET_NAME: {{ required ".Values.global.external-argo-cd.auth.type is set to 'token' therefore Values.global.external-argo-cd.auth.tokenSecretKeyRef.name is required" (index .Values "global" "external-argo-cd" "auth" "tokenSecretKeyRef" "name") }} +ARGO_CD_TOKEN_SECRET_KEY: {{ required ".Values.global.external-argo-cd.auth.type is set to 'token' therefore Values.global.external-argo-cd.auth.tokenSecretKeyRef.key is required" (index .Values "global" "external-argo-cd" "auth" "tokenSecretKeyRef" "key" ) }} + {{- else }} +ARGO_CD_TOKEN_SECRET_NAME: "gitops-runtime-argo-cd-token" +ARGO_CD_TOKEN_SECRET_KEY: "token" + {{- end }} +{{- end }} + +{{- if and (index .Values "global" "external-argo-cd" "server" "rootpath") }} +ARGOCD_SERVER_ROOTPATH: {{ index .Values "global" "external-argo-cd" "server" "rootpath" }} +{{- end }} + +{{- if or .Values.global.codefresh.tls.caCerts.secret.create (and .Values.global.codefresh.tls.caCerts.secretKeyRef.key .Values.global.codefresh.tls.caCerts.secretKeyRef.name) }} + {{- $secretKey := .Values.global.codefresh.tls.caCerts.secret.create | ternary (default "ca-bundle.crt" .Values.global.codefresh.tls.caCerts.secret.key) .Values.global.codefresh.tls.caCerts.secretKeyRef.key }} +CODEFRESH_SSL_CERT_PATH: {{ printf "/app/config/codefresh-tls-certs/%s" $secretKey }} +{{- end }} + +{{- end }} + +{{- define "runtime-reporter.resources.environment-variables.defaults" -}} +REPORTER_MODE: combined +APP_QUEUE_SIZE: + valueFrom: + configMapKeyRef: + name: runtime-reporter-cmd-params-cm + key: app.queue.size +ARGOCD_APPLICATION_NAMESPACES: + valueFrom: + configMapKeyRef: + name: argocd-cmd-params-cm + key: application.namespaces + optional: true +ARGOCD_SERVER: + valueFrom: + configMapKeyRef: + name: runtime-reporter-cmd-params-cm + key: argocd.server +ARGOCD_SERVER_ROOTPATH: + valueFrom: + configMapKeyRef: + name: argocd-cmd-params-cm + key: server.rootpath + optional: true +ARGO_CD_TOKEN_SECRET_NAME: argocd-token +ARGO_CD_TOKEN_SECRET_KEY: token +BINARY_NAME: event-reporter +CODEFRESH_SSL_CERT_PATH: "" +CODEFRESH_TLS_INSECURE: + valueFrom: + configMapKeyRef: + name: argocd-cmd-params-cm + key: codefresh.tls.insecure + optional: true +CODEFRESH_TOKEN: + valueFrom: + secretKeyRef: + name: codefresh-token + key: token +CODEFRESH_URL: + valueFrom: + configMapKeyRef: + key: base-url + name: codefresh-cm +EVENT_REPORTER_REPLICAS: 1 +INSECURE: + valueFrom: + configMapKeyRef: + name: runtime-reporter-cmd-params-cm + key: insecure + optional: true +LISTEN_ADDRESS: + valueFrom: + configMapKeyRef: + name: runtime-reporter-cmd-params-cm + key: listen.address + optional: true +LOG_FORMAT: + valueFrom: + configMapKeyRef: + name: runtime-reporter-cmd-params-cm + key: log.format + optional: true +LOG_LEVEL: + valueFrom: + configMapKeyRef: + name: runtime-reporter-cmd-params-cm + key: log.level + optional: true +MAX_APP_RETRIES: + valueFrom: + configMapKeyRef: + name: runtime-reporter-cmd-params-cm + key: max.app.retries +METRICS_LISTEN_ADDRESS: + valueFrom: + configMapKeyRef: + name: runtime-reporter-cmd-params-cm + key: metrics.listen.address + optional: true +OTEL_EXPORTER_OTLP_TRACES_ENDPOINT: + valueFrom: + configMapKeyRef: + name: runtime-reporter-cmd-params-cm + key: otlp.address +REDISDB: + valueFrom: + configMapKeyRef: + name: argocd-cmd-params-cm + key: redis.db + optional: true +REDIS_COMPRESSION: + valueFrom: + configMapKeyRef: + name: argocd-cmd-params-cm + key: redis.compression + optional: true +REDIS_PASSWORD: + valueFrom: + secretKeyRef: + name: argocd-redis + key: auth +REDIS_SERVER: + valueFrom: + configMapKeyRef: + name: argocd-cmd-params-cm + key: redis.server +REDIS_USERNAME: + valueFrom: + secretKeyRef: + name: argocd-redis + key: redis-username + optional: true +REPO_SERVER: + valueFrom: + configMapKeyRef: + name: runtime-reporter-cmd-params-cm + key: repo.server +REPO_SERVER_PLAINTEXT: + valueFrom: + configMapKeyRef: + name: runtime-reporter-cmd-params-cm + key: repo.server.plaintext + optional: true +REPO_SERVER_STRICT_TLS: + valueFrom: + configMapKeyRef: + name: runtime-reporter-cmd-params-cm + key: repo.server.strict.tls + optional: true +REPO_SERVER_TIMEOUT_SECONDS: + valueFrom: + configMapKeyRef: + name: runtime-reporter-cmd-params-cm + key: repo.server.timeout.seconds + optional: true +RUNTIME_VERSION: + valueFrom: + configMapKeyRef: + name: codefresh-cm + key: version +SHARDING_ALGORITHM: + valueFrom: + configMapKeyRef: + name: runtime-reporter-cmd-params-cm + key: sharding.algorithm + optional: true +SOURCES_SERVER: + valueFrom: + configMapKeyRef: + name: runtime-reporter-cmd-params-cm + key: sources.server +THREADINESS: + valueFrom: + configMapKeyRef: + name: runtime-reporter-cmd-params-cm + key: threadiness +{{- end -}} diff --git a/charts/gitops-runtime/templates/event-reporters/runtime-reporter/_helpers.tpl b/charts/gitops-runtime/templates/event-reporters/runtime-reporter/_helpers.tpl new file mode 100644 index 00000000..a0ed085c --- /dev/null +++ b/charts/gitops-runtime/templates/event-reporters/runtime-reporter/_helpers.tpl @@ -0,0 +1,47 @@ +{{/* +Create a default fully qualified app name. +We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +If release name contains chart name it will be used as a full name. +*/}} +{{- define "runtime-reporter.fullname" -}} +{{- print "runtime-reporter" }} +{{- end }} + +{{/* +Create chart name and version as used by the chart label. +*/}} +{{- define "runtime-reporter.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Common labels +*/}} +{{- define "runtime-reporter.labels" -}} +helm.sh/chart: {{ include "runtime-reporter.chart" . }} +{{ include "runtime-reporter.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +app.kubernetes.io/part-of: runtime-reporter +codefresh.io/internal: "true" +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "runtime-reporter.selectorLabels" -}} +app.kubernetes.io/name: runtime-reporter +{{- end }} + +{{/* +Create the name of the service account to use +*/}} +{{- define "runtime-reporter.serviceAccountName" -}} +{{- if .Values.serviceAccount.create }} +{{- default (include "runtime-reporter.fullname" .) .Values.serviceAccount.name }} +{{- else }} +{{- default "default" .Values.serviceAccount.name }} +{{- end }} +{{- end }} diff --git a/charts/gitops-runtime/templates/event-reporters/runtime-reporter/configmap.yaml b/charts/gitops-runtime/templates/event-reporters/runtime-reporter/configmap.yaml new file mode 100644 index 00000000..162afc79 --- /dev/null +++ b/charts/gitops-runtime/templates/event-reporters/runtime-reporter/configmap.yaml @@ -0,0 +1,20 @@ +{{- define "argo-api-gateway.resources.configmap.defaults"}} +argocd.server: {{ include "codefresh-gitops-runtime.argocd.server.no-protocol-url" . }} +redis.server: {{ include "codefresh-gitops-runtime.argocd.redis.url" . }} +repo.server: {{ include "codefresh-gitops-runtime.argocd.reposerver.url" . }} +app.queue.size: '1000' +max.app.retries: '5' +threadiness: '100' +{{- end }} + +{{- $defaultConfig := (include "argo-api-gateway.resources.configmap.defaults" . | fromYaml ) }} +{{- $overrides := index .Values "argo-api-gateway" "config" | default dict }} +{{- $mergedConfig := mergeOverwrite $defaultConfig $overrides }} +apiVersion: v1 +kind: ConfigMap +metadata: + name: runtime-reporter-cmd-params-cm + labels: + {{- include "runtime-reporter.labels" . | nindent 4 }} +data: + {{- $mergedConfig | toYaml | nindent 2 }} diff --git a/charts/gitops-runtime/templates/event-reporters/runtime-reporter/deployment.yaml b/charts/gitops-runtime/templates/event-reporters/runtime-reporter/deployment.yaml new file mode 100644 index 00000000..63f4223c --- /dev/null +++ b/charts/gitops-runtime/templates/event-reporters/runtime-reporter/deployment.yaml @@ -0,0 +1,109 @@ +{{- $cfCommonTplSemver := printf "cf-common-%s" (index .Subcharts "cf-common").Chart.Version }} +{{- $context := deepCopy . }} +{{- $_ := set $context "Values" (deepCopy (get (index .Values "event-reporters") "runtime-reporter")) }} +{{- $_ := set $context.Values "global" (deepCopy (get .Values "global")) }} +{{/* Merge environment variables from calculated, defaults and overwrites */}} +{{- $defaults := (include "runtime-reporter.resources.environment-variables.defaults" . | fromYaml) }} +{{- $calculated := (include "runtime-reporter.resources.environment-variables.calculated" . | fromYaml) }} +{{- $overrides := $context.Values.env }} +{{- $mergedValues := mergeOverwrite $defaults $calculated $overrides }} +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "runtime-reporter.fullname" . }} + labels: + {{- include "runtime-reporter.labels" . | nindent 4 }} +spec: + replicas: {{ $context.Values.replicaCount }} + selector: + matchLabels: + {{- include "runtime-reporter.selectorLabels" . | nindent 6 }} + template: + metadata: + {{- with $context.Values.podAnnotations }} + annotations: + {{- toYaml . | nindent 8 }} + {{- end }} + labels: + {{- include "runtime-reporter.selectorLabels" . | nindent 8 }} + {{- with $context.Values.podLabels }} + {{- toYaml . | nindent 8 }} + {{- end }} + spec: + {{- with $context.Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + serviceAccountName: {{ include "runtime-reporter.serviceAccountName" $context }} + securityContext: + {{- toYaml $context.Values.podSecurityContext | nindent 8 }} + containers: + - name: {{ include "runtime-reporter.fullname" . }} + securityContext: + {{- toYaml $context.Values.securityContext | nindent 12 }} + {{- $imageContext := deepCopy $context.Values.image }} + image: {{ include (printf "%s.image.name" $cfCommonTplSemver ) (dict "image" $imageContext "context" .) }} + env: {{- include (printf "%s.env-vars" $cfCommonTplSemver ) (dict "Values" $mergedValues "context" .) | nindent 8 }} + imagePullPolicy: {{ $context.Values.image.pullPolicy }} + {{- if $context.Values.command }} + command: + {{- $context.Values.command | toYaml | nindent 8 }} + {{- end }} + {{- with $context.Values.extraArgs }} + args: + {{- . | toYaml | nindent 8 }} + {{- end }} + ports: + {{- range $name, $port := $context.Values.service.ports }} + - name: {{ $name }} + containerPort: {{ $port.targetPort }} + {{- end }} + readinessProbe: + initialDelaySeconds: {{ $context.Values.readinessProbe.initialDelaySeconds }} + periodSeconds: {{ $context.Values.readinessProbe.periodSeconds }} + timeoutSeconds: {{ $context.Values.readinessProbe.timeoutSeconds }} + successThreshold: {{ $context.Values.readinessProbe.successThreshold }} + failureThreshold: {{ $context.Values.readinessProbe.failureThreshold }} + httpGet: + port: http + path: /healthz + livenessProbe: + initialDelaySeconds: {{ $context.Values.livenessProbe.initialDelaySeconds }} + periodSeconds: {{ $context.Values.livenessProbe.periodSeconds }} + timeoutSeconds: {{ $context.Values.livenessProbe.timeoutSeconds }} + successThreshold: {{ $context.Values.livenessProbe.successThreshold }} + failureThreshold: {{ $context.Values.livenessProbe.failureThreshold }} + httpGet: + port: http + path: /healthz?full=true + resources: + {{- toYaml $context.Values.resources | nindent 10 }} + volumeMounts: + {{- if $context.Values.global.codefresh.tls.caCerts.secretKeyRef }} + - name: codefresh-tls + mountPath: /app/config/codefresh-tls + {{- end }} + {{- with $context.Values.extraVolumeMounts }} + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with $context.Values.nodeSelector | default $context.Values.global.nodeSelector }} + nodeSelector: {{ toYaml . | nindent 8 }} + {{- end }} + {{- with $context.Values.tolerations | default $context.Values.global.tolerations }} + tolerations: {{ toYaml . | nindent 6 }} + {{- end }} + {{- with $context.Values.affinity }} + affinity: {{ toYaml . | nindent 8 }} + {{- end }} + {{- with $context.Values.topologySpreadConstraints }} + topologySpreadConstraints: {{- include (printf "%s.tplrender" $cfCommonTplSemver ) (dict "Values" . "context" .) | nindent 8 }} + {{- end }} + volumes: + {{- if $context.Values.global.codefresh.tls.caCerts.secretKeyRef }} + - name: codefresh-tls + secret: + secretName: {{ $context.Values.global.codefresh.tls.caCerts.secretKeyRef.name | default "codefresh-tls-certs" }} + {{- end }} + {{- with $context.Values.extraVolumes }} + {{- toYaml . | nindent 6 }} + {{- end }} diff --git a/charts/gitops-runtime/templates/event-reporters/runtime-reporter/pdb.yaml b/charts/gitops-runtime/templates/event-reporters/runtime-reporter/pdb.yaml new file mode 100644 index 00000000..dc2e5f8c --- /dev/null +++ b/charts/gitops-runtime/templates/event-reporters/runtime-reporter/pdb.yaml @@ -0,0 +1,20 @@ +{{- $context := deepCopy . }} +{{- $_ := set $context "Values" (deepCopy (get (index .Values "event-reporters") "runtime-reporter")) }} +{{- $_ := set $context.Values "global" (deepCopy (get .Values "global")) }} + +{{- if and $context.Values.pdb.enabled }} +apiVersion: policy/v1beta1 +kind: PodDisruptionBudget +metadata: + name: {{ include "runtime-reporter.fullname" . }} +spec: + {{- with $context.Values.pdb.minAvailable }} + minAvailable: {{ . }} + {{- end }} + {{- with $context.Values.pdb.maxUnavailable }} + maxUnavailable: {{ . }} + {{- end }} + selector: + matchLabels: + {{- include "runtime-reporter.selectorLabels" . | nindent 6 }} +{{- end }} diff --git a/charts/gitops-runtime/templates/event-reporters/runtime-reporter/rbac.yaml b/charts/gitops-runtime/templates/event-reporters/runtime-reporter/rbac.yaml new file mode 100644 index 00000000..4e18651a --- /dev/null +++ b/charts/gitops-runtime/templates/event-reporters/runtime-reporter/rbac.yaml @@ -0,0 +1,42 @@ +{{- $context := deepCopy . }} +{{- $_ := set $context "Values" (deepCopy (get (index .Values "event-reporters") "runtime-reporter")) }} +{{- $_ := set $context.Values "global" (deepCopy (get .Values "global")) }} +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ include "runtime-reporter.serviceAccountName" $context }} + labels: + {{- include "runtime-reporter.labels" . | nindent 4 }} +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: {{ include "runtime-reporter.fullname" . }} + labels: + {{- include "runtime-reporter.labels" . | nindent 4 }} +rules: + - apiGroups: + - '*' + resources: + - '*' + verbs: + - '*' + - nonResourceURLs: + - '*' + verbs: + - '*' +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: {{ include "runtime-reporter.fullname" . }} + labels: + {{- include "runtime-reporter.labels" . | nindent 4 }} +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: {{ include "runtime-reporter.fullname" . }} +subjects: + - kind: ServiceAccount + name: {{ include "runtime-reporter.serviceAccountName" $context }} + namespace: {{ .Release.Namespace }} diff --git a/charts/gitops-runtime/templates/event-reporters/runtime-reporter/service.yaml b/charts/gitops-runtime/templates/event-reporters/runtime-reporter/service.yaml new file mode 100644 index 00000000..19231a39 --- /dev/null +++ b/charts/gitops-runtime/templates/event-reporters/runtime-reporter/service.yaml @@ -0,0 +1,19 @@ +{{- $context := deepCopy . }} +{{- $_ := set $context "Values" (deepCopy (get (index .Values "event-reporters") "runtime-reporter")) }} +{{- $_ := set $context.Values "global" (deepCopy (get .Values "global")) }} +apiVersion: v1 +kind: Service +metadata: + name: {{ include "runtime-reporter.fullname" . }} + labels: + {{- include "runtime-reporter.labels" . | nindent 4 }} +spec: + type: ClusterIP + ports: +{{- range $name, $port := $context.Values.service.ports }} + - name: {{ $name }} + port: {{ $port.port }} + targetPort: {{ $port.targetPort }} +{{- end }} + selector: + {{- include "runtime-reporter.selectorLabels" . | nindent 4 }} From 12c4598dd09b27554a456fb8530b47565a6ce3b5 Mon Sep 17 00:00:00 2001 From: Mikhail Klimko Date: Fri, 19 Sep 2025 17:59:29 +0300 Subject: [PATCH 04/37] refactor cf-argocd-extras --- charts/gitops-runtime/templates/_helpers.tpl | 6 +- charts/gitops-runtime/values.yaml | 67 ++------------------ 2 files changed, 9 insertions(+), 64 deletions(-) diff --git a/charts/gitops-runtime/templates/_helpers.tpl b/charts/gitops-runtime/templates/_helpers.tpl index 1b66f710..0ec2f4d3 100644 --- a/charts/gitops-runtime/templates/_helpers.tpl +++ b/charts/gitops-runtime/templates/_helpers.tpl @@ -434,8 +434,8 @@ Output comma separated list of installed runtime components {{- $sealedSecrets := dict "name" "sealed-secrets" "version" (get .Subcharts "sealed-secrets").Chart.AppVersion }} {{- $internalRouter := dict "name" "internal-router" "version" .Chart.AppVersion }} {{- $appProxy := dict "name" "app-proxy" "version" (index (get .Values "app-proxy") "image" "tag") }} - {{- $sourcesServer := dict "name" "sources-server" "version" (get .Values "cf-argocd-extras").sourcesServer.container.image.tag }} - {{- $comptList := list $argoEvents $appProxy $sealedSecrets $internalRouter $sourcesServer }} + {{- $argoApiGateway := dict "name" "argo-api-gateway" "version" (get .Values "argo-api-gateway").image.tag }} + {{- $comptList := list $argoEvents $appProxy $sealedSecrets $internalRouter $argoApiGateway }} {{- if and (index .Values "argo-cd" "enabled") }} {{- $argoCD := dict "name" "argocd" "version" (get .Subcharts "argo-cd").Chart.AppVersion }} {{- $comptList = append $comptList $argoCD }} @@ -461,7 +461,7 @@ Output comma separated list of installed runtime components {{- $comptList = append $comptList $gitopsOperator }} {{- end }} {{- if not (index .Values "argo-cd" "enabled") }} - {{- $eventReporter := dict "name" "event-reporter" "version" (get .Values "cf-argocd-extras").eventReporter.container.image.tag }} + {{- $eventReporter := dict "name" "event-reporter" "version" (index (get .Values "event-reporters") "runtime-reporter" "image" "tag") }} {{- $comptList = append $comptList $eventReporter }} {{- end }} {{- $comptList | toYaml }} diff --git a/charts/gitops-runtime/values.yaml b/charts/gitops-runtime/values.yaml index 2f282f56..8effa5fa 100644 --- a/charts/gitops-runtime/values.yaml +++ b/charts/gitops-runtime/values.yaml @@ -664,67 +664,12 @@ gitops-operator: enabled: false minAvailable: 1 maxUnavailable: "" -#----------------------------------------------------------------------------------------------------------------------- -# cf-argocd-extras -#----------------------------------------------------------------------------------------------------------------------- -# -- Codefresh extra services for ArgoCD -cf-argocd-extras: - eventReporter: - enabled: true - container: - image: - registry: quay.io - repository: codefresh/cf-argocd-extras - tag: c74d94c - nodeSelector: {} - tolerations: [] - affinity: {} - resources: - requests: - memory: "128Mi" - cpu: "100m" - pdb: - # -- Enable PDB for event-reporter - enabled: false - minAvailable: "50%" - maxUnavailable: "" - serviceMonitor: - main: - # -- Enable ServiceMonitor for event reporter - enabled: false - # -- Sources server configuration - sourcesServer: - enabled: true - container: - image: - registry: quay.io - repository: codefresh/cf-argocd-extras - tag: c74d94c - nodeSelector: {} - tolerations: [] - affinity: {} - resources: - requests: - memory: "128Mi" - cpu: "100m" - hpa: - # -- Enable HPA for sources server - enabled: false - minReplicas: 1 - maxReplicas: 10 - targetCPUUtilizationPercentage: 70 - pdb: - # -- Enable PDB for sources server - enabled: false - minAvailable: "50%" - maxUnavailable: "" - argo-api-gateway: image: registry: quay.io - repository: codefresh/cf-argocd-extras - tag: c74d94c + repository: codefresh/dev/cf-argocd-extras + tag: cr-30629-resource-reporter-workqueu-2-66d7459 nodeSelector: {} tolerations: [] affinity: {} @@ -762,8 +707,8 @@ event-reporters: runtime-reporter: image: registry: quay.io - repository: codefresh/cf-argocd-extras - tag: c74d94c + repository: codefresh/dev/cf-argocd-extras + tag: cr-30629-resource-reporter-workqueu-2-66d7459 nodeSelector: {} tolerations: [] affinity: {} @@ -802,8 +747,8 @@ event-reporters: resources-reporter: image: registry: quay.io - repository: codefresh/cf-argocd-extras - tag: c74d94c + repository: codefresh/dev/cf-argocd-extras + tag: cr-30629-resource-reporter-workqueu-2-66d7459 nodeSelector: {} tolerations: [] affinity: {} From 0d5806f7b447571f76d2b3f8c4dc74017359369a Mon Sep 17 00:00:00 2001 From: Mikhail Klimko Date: Fri, 19 Sep 2025 18:13:54 +0300 Subject: [PATCH 05/37] refactor cf-argocd-extras --- charts/gitops-runtime/templates/argo-api-gateway/pdb.yaml | 2 +- .../templates/event-reporters/resources-reporter/pdb.yaml | 2 +- .../templates/event-reporters/runtime-reporter/pdb.yaml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/charts/gitops-runtime/templates/argo-api-gateway/pdb.yaml b/charts/gitops-runtime/templates/argo-api-gateway/pdb.yaml index 75b69c6f..2f89fb9f 100644 --- a/charts/gitops-runtime/templates/argo-api-gateway/pdb.yaml +++ b/charts/gitops-runtime/templates/argo-api-gateway/pdb.yaml @@ -3,7 +3,7 @@ {{- $_ := set $context.Values "global" (deepCopy (get .Values "global")) }} {{- if and $context.Values.pdb.enabled }} -apiVersion: policy/v1beta1 +apiVersion: policy/v1 kind: PodDisruptionBudget metadata: name: {{ include "argo-api-gateway.fullname" . }} diff --git a/charts/gitops-runtime/templates/event-reporters/resources-reporter/pdb.yaml b/charts/gitops-runtime/templates/event-reporters/resources-reporter/pdb.yaml index dce852d3..f4467153 100644 --- a/charts/gitops-runtime/templates/event-reporters/resources-reporter/pdb.yaml +++ b/charts/gitops-runtime/templates/event-reporters/resources-reporter/pdb.yaml @@ -3,7 +3,7 @@ {{- $_ := set $context.Values "global" (deepCopy (get .Values "global")) }} {{- if and $context.Values.pdb.enabled }} -apiVersion: policy/v1beta1 +apiVersion: policy/v1 kind: PodDisruptionBudget metadata: name: {{ include "resources-reporter.fullname" . }} diff --git a/charts/gitops-runtime/templates/event-reporters/runtime-reporter/pdb.yaml b/charts/gitops-runtime/templates/event-reporters/runtime-reporter/pdb.yaml index dc2e5f8c..f9a8a80b 100644 --- a/charts/gitops-runtime/templates/event-reporters/runtime-reporter/pdb.yaml +++ b/charts/gitops-runtime/templates/event-reporters/runtime-reporter/pdb.yaml @@ -3,7 +3,7 @@ {{- $_ := set $context.Values "global" (deepCopy (get .Values "global")) }} {{- if and $context.Values.pdb.enabled }} -apiVersion: policy/v1beta1 +apiVersion: policy/v1 kind: PodDisruptionBudget metadata: name: {{ include "runtime-reporter.fullname" . }} From 7325050f4f3f8ff4b8a9a737501912db92849ce3 Mon Sep 17 00:00:00 2001 From: Mikhail Klimko Date: Mon, 22 Sep 2025 09:43:41 +0300 Subject: [PATCH 06/37] refactor cf-argocd-extras --- .../templates/event-reporters/resources-reporter/_env.yaml | 1 + .../event-reporters/resources-reporter/configmap.yaml | 7 ++++--- .../templates/event-reporters/runtime-reporter/_env.yaml | 1 + .../event-reporters/runtime-reporter/configmap.yaml | 7 ++++--- charts/gitops-runtime/values.yaml | 5 ++--- 5 files changed, 12 insertions(+), 9 deletions(-) diff --git a/charts/gitops-runtime/templates/event-reporters/resources-reporter/_env.yaml b/charts/gitops-runtime/templates/event-reporters/resources-reporter/_env.yaml index 408ac968..0eaa29c2 100644 --- a/charts/gitops-runtime/templates/event-reporters/resources-reporter/_env.yaml +++ b/charts/gitops-runtime/templates/event-reporters/resources-reporter/_env.yaml @@ -109,6 +109,7 @@ OTEL_EXPORTER_OTLP_TRACES_ENDPOINT: configMapKeyRef: name: resources-reporter-cmd-params-cm key: otlp.address + optional: true REDISDB: valueFrom: configMapKeyRef: diff --git a/charts/gitops-runtime/templates/event-reporters/resources-reporter/configmap.yaml b/charts/gitops-runtime/templates/event-reporters/resources-reporter/configmap.yaml index 058f5ed8..89604b20 100644 --- a/charts/gitops-runtime/templates/event-reporters/resources-reporter/configmap.yaml +++ b/charts/gitops-runtime/templates/event-reporters/resources-reporter/configmap.yaml @@ -1,14 +1,15 @@ -{{- define "argo-api-gateway.resources.configmap.defaults"}} +{{- define "resources-reporter.resources.configmap.defaults" }} argocd.server: {{ include "codefresh-gitops-runtime.argocd.server.no-protocol-url" . }} redis.server: {{ include "codefresh-gitops-runtime.argocd.redis.url" . }} repo.server: {{ include "codefresh-gitops-runtime.argocd.reposerver.url" . }} +sources.server: http://argo-api-gateway app.queue.size: '1000' max.app.retries: '5' threadiness: '100' {{- end }} -{{- $defaultConfig := (include "argo-api-gateway.resources.configmap.defaults" . | fromYaml ) }} -{{- $overrides := index .Values "argo-api-gateway" "config" | default dict }} +{{- $defaultConfig := (include "resources-reporter.resources.configmap.defaults" . | fromYaml ) }} +{{- $overrides := index .Values "event-reporters" "resources-reporter" "config" | default dict }} {{- $mergedConfig := mergeOverwrite $defaultConfig $overrides }} apiVersion: v1 kind: ConfigMap diff --git a/charts/gitops-runtime/templates/event-reporters/runtime-reporter/_env.yaml b/charts/gitops-runtime/templates/event-reporters/runtime-reporter/_env.yaml index 113e7a9d..8172f126 100644 --- a/charts/gitops-runtime/templates/event-reporters/runtime-reporter/_env.yaml +++ b/charts/gitops-runtime/templates/event-reporters/runtime-reporter/_env.yaml @@ -109,6 +109,7 @@ OTEL_EXPORTER_OTLP_TRACES_ENDPOINT: configMapKeyRef: name: runtime-reporter-cmd-params-cm key: otlp.address + optional: true REDISDB: valueFrom: configMapKeyRef: diff --git a/charts/gitops-runtime/templates/event-reporters/runtime-reporter/configmap.yaml b/charts/gitops-runtime/templates/event-reporters/runtime-reporter/configmap.yaml index 162afc79..a12b0e3f 100644 --- a/charts/gitops-runtime/templates/event-reporters/runtime-reporter/configmap.yaml +++ b/charts/gitops-runtime/templates/event-reporters/runtime-reporter/configmap.yaml @@ -1,14 +1,15 @@ -{{- define "argo-api-gateway.resources.configmap.defaults"}} +{{- define "runtime-reporter.resources.configmap.defaults"}} argocd.server: {{ include "codefresh-gitops-runtime.argocd.server.no-protocol-url" . }} redis.server: {{ include "codefresh-gitops-runtime.argocd.redis.url" . }} repo.server: {{ include "codefresh-gitops-runtime.argocd.reposerver.url" . }} +sources.server: http://argo-api-gateway app.queue.size: '1000' max.app.retries: '5' threadiness: '100' {{- end }} -{{- $defaultConfig := (include "argo-api-gateway.resources.configmap.defaults" . | fromYaml ) }} -{{- $overrides := index .Values "argo-api-gateway" "config" | default dict }} +{{- $defaultConfig := (include "runtime-reporter.resources.configmap.defaults" . | fromYaml ) }} +{{- $overrides := index .Values "event-reporters" "runtime-reporter" "config" | default dict }} {{- $mergedConfig := mergeOverwrite $defaultConfig $overrides }} apiVersion: v1 kind: ConfigMap diff --git a/charts/gitops-runtime/values.yaml b/charts/gitops-runtime/values.yaml index 8effa5fa..4125adc0 100644 --- a/charts/gitops-runtime/values.yaml +++ b/charts/gitops-runtime/values.yaml @@ -17,9 +17,7 @@ global: # -- Custom CA certificates bundle for platform access with ssl caCerts: # -- Reference to existing secret - secretKeyRef: - name: "" - key: "" + secretKeyRef: {} # -- Chart managed secret for custom platform CA certificates secret: # -- Whether to create the secret. @@ -196,6 +194,7 @@ global: httpsProxy: '' # -- global NO_PROXY for all components noProxy: '' + imageRegistry: "" # ------------------------------------------------------------------------------------------------------------------------- # Installer # ------------------------------------------------------------------------------------------------------------------------- From c697fb2a24c51deeed5ed909d69600c39f06b0cb Mon Sep 17 00:00:00 2001 From: Mikhail Klimko Date: Mon, 22 Sep 2025 11:32:38 +0300 Subject: [PATCH 07/37] refactor cf-argocd-extras --- .../resources-reporter/configmap.yaml | 5 +- .../resources-reporter/deployment.yaml | 5 +- .../resources-reporter/pdb.yaml | 4 +- .../resources-reporter/rbac.yaml | 4 +- .../resources-reporter/service.yaml | 4 +- .../runtime-reporter/configmap.yaml | 5 +- .../runtime-reporter/deployment.yaml | 5 +- .../event-reporters/runtime-reporter/pdb.yaml | 4 +- .../runtime-reporter/rbac.yaml | 4 +- .../runtime-reporter/service.yaml | 4 +- charts/gitops-runtime/values.yaml | 124 ++++++++++++------ 11 files changed, 117 insertions(+), 51 deletions(-) diff --git a/charts/gitops-runtime/templates/event-reporters/resources-reporter/configmap.yaml b/charts/gitops-runtime/templates/event-reporters/resources-reporter/configmap.yaml index 89604b20..dbb35e66 100644 --- a/charts/gitops-runtime/templates/event-reporters/resources-reporter/configmap.yaml +++ b/charts/gitops-runtime/templates/event-reporters/resources-reporter/configmap.yaml @@ -9,8 +9,9 @@ threadiness: '100' {{- end }} {{- $defaultConfig := (include "resources-reporter.resources.configmap.defaults" . | fromYaml ) }} -{{- $overrides := index .Values "event-reporters" "resources-reporter" "config" | default dict }} -{{- $mergedConfig := mergeOverwrite $defaultConfig $overrides }} +{{- $globalOverrides := index .Values "global" "event-reporters" "config" | default dict }} +{{- $reporterOverrides := index .Values "event-reporters" "resources-reporter" "config" | default dict }} +{{- $mergedConfig := mergeOverwrite $defaultConfig $globalOverrides $reporterOverrides }} apiVersion: v1 kind: ConfigMap metadata: diff --git a/charts/gitops-runtime/templates/event-reporters/resources-reporter/deployment.yaml b/charts/gitops-runtime/templates/event-reporters/resources-reporter/deployment.yaml index 59410ace..f60c2d87 100644 --- a/charts/gitops-runtime/templates/event-reporters/resources-reporter/deployment.yaml +++ b/charts/gitops-runtime/templates/event-reporters/resources-reporter/deployment.yaml @@ -1,7 +1,10 @@ {{- $cfCommonTplSemver := printf "cf-common-%s" (index .Subcharts "cf-common").Chart.Version }} {{- $context := deepCopy . }} -{{- $_ := set $context "Values" (deepCopy (get (index .Values "event-reporters") "resources-reporter")) }} +{{- $_ := set $context "Values" (deepCopy (get (index .Values "global") "event-reporters")) }} {{- $_ := set $context.Values "global" (deepCopy (get .Values "global")) }} +{{/* Merge .Values.event-reporters. with .Values.global.event-reporters */}} +{{- $valuesOverrides := index .Values "event-reporters" "resources-reporter" }} +{{- $_ := mergeOverwrite $context.Values $valuesOverrides | set $context "Values" }} {{/* Merge environment variables from calculated, defaults and overwrites */}} {{- $defaults := (include "resources-reporter.resources.environment-variables.defaults" . | fromYaml) }} {{- $calculated := (include "resources-reporter.resources.environment-variables.calculated" . | fromYaml) }} diff --git a/charts/gitops-runtime/templates/event-reporters/resources-reporter/pdb.yaml b/charts/gitops-runtime/templates/event-reporters/resources-reporter/pdb.yaml index f4467153..b9bf12d6 100644 --- a/charts/gitops-runtime/templates/event-reporters/resources-reporter/pdb.yaml +++ b/charts/gitops-runtime/templates/event-reporters/resources-reporter/pdb.yaml @@ -1,6 +1,8 @@ {{- $context := deepCopy . }} -{{- $_ := set $context "Values" (deepCopy (get (index .Values "event-reporters") "resources-reporter")) }} +{{- $_ := set $context "Values" (deepCopy (get (index .Values "global") "event-reporters")) }} {{- $_ := set $context.Values "global" (deepCopy (get .Values "global")) }} +{{- $valuesOverrides := index .Values "event-reporters" "resources-reporter" }} +{{- $_ := mergeOverwrite $context.Values $valuesOverrides | set $context "Values" }} {{- if and $context.Values.pdb.enabled }} apiVersion: policy/v1 diff --git a/charts/gitops-runtime/templates/event-reporters/resources-reporter/rbac.yaml b/charts/gitops-runtime/templates/event-reporters/resources-reporter/rbac.yaml index bf4fb714..09bc551e 100644 --- a/charts/gitops-runtime/templates/event-reporters/resources-reporter/rbac.yaml +++ b/charts/gitops-runtime/templates/event-reporters/resources-reporter/rbac.yaml @@ -1,6 +1,8 @@ {{- $context := deepCopy . }} -{{- $_ := set $context "Values" (deepCopy (get (index .Values "event-reporters") "resources-reporter")) }} +{{- $_ := set $context "Values" (deepCopy (get (index .Values "global") "event-reporters")) }} {{- $_ := set $context.Values "global" (deepCopy (get .Values "global")) }} +{{- $valuesOverrides := index .Values "event-reporters" "resources-reporter" }} +{{- $_ := mergeOverwrite $context.Values $valuesOverrides | set $context "Values" }} apiVersion: v1 kind: ServiceAccount metadata: diff --git a/charts/gitops-runtime/templates/event-reporters/resources-reporter/service.yaml b/charts/gitops-runtime/templates/event-reporters/resources-reporter/service.yaml index 4f436206..eabd4096 100644 --- a/charts/gitops-runtime/templates/event-reporters/resources-reporter/service.yaml +++ b/charts/gitops-runtime/templates/event-reporters/resources-reporter/service.yaml @@ -1,6 +1,8 @@ {{- $context := deepCopy . }} -{{- $_ := set $context "Values" (deepCopy (get (index .Values "event-reporters") "resources-reporter")) }} +{{- $_ := set $context "Values" (deepCopy (get (index .Values "global") "event-reporters")) }} {{- $_ := set $context.Values "global" (deepCopy (get .Values "global")) }} +{{- $valuesOverrides := index .Values "event-reporters" "resources-reporter" }} +{{- $_ := mergeOverwrite $context.Values $valuesOverrides | set $context "Values" }} apiVersion: v1 kind: Service metadata: diff --git a/charts/gitops-runtime/templates/event-reporters/runtime-reporter/configmap.yaml b/charts/gitops-runtime/templates/event-reporters/runtime-reporter/configmap.yaml index a12b0e3f..27e677ed 100644 --- a/charts/gitops-runtime/templates/event-reporters/runtime-reporter/configmap.yaml +++ b/charts/gitops-runtime/templates/event-reporters/runtime-reporter/configmap.yaml @@ -9,8 +9,9 @@ threadiness: '100' {{- end }} {{- $defaultConfig := (include "runtime-reporter.resources.configmap.defaults" . | fromYaml ) }} -{{- $overrides := index .Values "event-reporters" "runtime-reporter" "config" | default dict }} -{{- $mergedConfig := mergeOverwrite $defaultConfig $overrides }} +{{- $globalOverrides := index .Values "global" "event-reporters" "config" | default dict }} +{{- $reporterOverrides := index .Values "event-reporters" "runtime-reporter" "config" | default dict }} +{{- $mergedConfig := mergeOverwrite $defaultConfig $globalOverrides $reporterOverrides }} apiVersion: v1 kind: ConfigMap metadata: diff --git a/charts/gitops-runtime/templates/event-reporters/runtime-reporter/deployment.yaml b/charts/gitops-runtime/templates/event-reporters/runtime-reporter/deployment.yaml index 63f4223c..955a71b4 100644 --- a/charts/gitops-runtime/templates/event-reporters/runtime-reporter/deployment.yaml +++ b/charts/gitops-runtime/templates/event-reporters/runtime-reporter/deployment.yaml @@ -1,7 +1,10 @@ {{- $cfCommonTplSemver := printf "cf-common-%s" (index .Subcharts "cf-common").Chart.Version }} {{- $context := deepCopy . }} -{{- $_ := set $context "Values" (deepCopy (get (index .Values "event-reporters") "runtime-reporter")) }} +{{- $_ := set $context "Values" (deepCopy (get (index .Values "global") "event-reporters")) }} {{- $_ := set $context.Values "global" (deepCopy (get .Values "global")) }} +{{/* Merge .Values.event-reporters. with .Values.global.event-reporters */}} +{{- $valuesOverrides := index .Values "event-reporters" "runtime-reporter" }} +{{- $_ := mergeOverwrite $context.Values $valuesOverrides | set $context "Values" }} {{/* Merge environment variables from calculated, defaults and overwrites */}} {{- $defaults := (include "runtime-reporter.resources.environment-variables.defaults" . | fromYaml) }} {{- $calculated := (include "runtime-reporter.resources.environment-variables.calculated" . | fromYaml) }} diff --git a/charts/gitops-runtime/templates/event-reporters/runtime-reporter/pdb.yaml b/charts/gitops-runtime/templates/event-reporters/runtime-reporter/pdb.yaml index f9a8a80b..2ec29f28 100644 --- a/charts/gitops-runtime/templates/event-reporters/runtime-reporter/pdb.yaml +++ b/charts/gitops-runtime/templates/event-reporters/runtime-reporter/pdb.yaml @@ -1,6 +1,8 @@ {{- $context := deepCopy . }} -{{- $_ := set $context "Values" (deepCopy (get (index .Values "event-reporters") "runtime-reporter")) }} +{{- $_ := set $context "Values" (deepCopy (get (index .Values "global") "event-reporters")) }} {{- $_ := set $context.Values "global" (deepCopy (get .Values "global")) }} +{{- $valuesOverrides := index .Values "event-reporters" "runtime-reporter" }} +{{- $_ := mergeOverwrite $context.Values $valuesOverrides | set $context "Values" }} {{- if and $context.Values.pdb.enabled }} apiVersion: policy/v1 diff --git a/charts/gitops-runtime/templates/event-reporters/runtime-reporter/rbac.yaml b/charts/gitops-runtime/templates/event-reporters/runtime-reporter/rbac.yaml index 4e18651a..3931a2fb 100644 --- a/charts/gitops-runtime/templates/event-reporters/runtime-reporter/rbac.yaml +++ b/charts/gitops-runtime/templates/event-reporters/runtime-reporter/rbac.yaml @@ -1,6 +1,8 @@ {{- $context := deepCopy . }} -{{- $_ := set $context "Values" (deepCopy (get (index .Values "event-reporters") "runtime-reporter")) }} +{{- $_ := set $context "Values" (deepCopy (get (index .Values "global") "event-reporters")) }} {{- $_ := set $context.Values "global" (deepCopy (get .Values "global")) }} +{{- $valuesOverrides := index .Values "event-reporters" "runtime-reporter" }} +{{- $_ := mergeOverwrite $context.Values $valuesOverrides | set $context "Values" }} apiVersion: v1 kind: ServiceAccount metadata: diff --git a/charts/gitops-runtime/templates/event-reporters/runtime-reporter/service.yaml b/charts/gitops-runtime/templates/event-reporters/runtime-reporter/service.yaml index 19231a39..2772f146 100644 --- a/charts/gitops-runtime/templates/event-reporters/runtime-reporter/service.yaml +++ b/charts/gitops-runtime/templates/event-reporters/runtime-reporter/service.yaml @@ -1,6 +1,8 @@ {{- $context := deepCopy . }} -{{- $_ := set $context "Values" (deepCopy (get (index .Values "event-reporters") "runtime-reporter")) }} +{{- $_ := set $context "Values" (deepCopy (get (index .Values "global") "event-reporters")) }} {{- $_ := set $context.Values "global" (deepCopy (get .Values "global")) }} +{{- $valuesOverrides := index .Values "event-reporters" "runtime-reporter" }} +{{- $_ := mergeOverwrite $context.Values $valuesOverrides | set $context "Values" }} apiVersion: v1 kind: Service metadata: diff --git a/charts/gitops-runtime/values.yaml b/charts/gitops-runtime/values.yaml index 4125adc0..aa3651d2 100644 --- a/charts/gitops-runtime/values.yaml +++ b/charts/gitops-runtime/values.yaml @@ -195,6 +195,48 @@ global: # -- global NO_PROXY for all components noProxy: '' imageRegistry: "" + + event-reporters: + image: + registry: quay.io + repository: codefresh/dev/cf-argocd-extras + tag: cr-30629-resource-reporter-workqueu-2-66d7459 + nodeSelector: {} + tolerations: [] + affinity: {} + resources: + requests: + memory: "128Mi" + cpu: "100m" + pdb: + enabled: true + minAvailable: "50%" + maxUnavailable: "" + service: + type: ClusterIP + ports: + http: + port: 8088 + targetPort: 8088 + metrics: + port: 8087 + targetPort: 8087 + serviceAccount: + create: true + readinessProbe: + failureThreshold: 3 + initialDelaySeconds: 10 + periodSeconds: 10 + successThreshold: 1 + timeoutSeconds: 10 + livenessProbe: + failureThreshold: 3 + initialDelaySeconds: 10 + periodSeconds: 10 + successThreshold: 1 + timeoutSeconds: 10 + config: {} + # ------------------------------------------------------------------------------------------------------------------------- # Installer # ------------------------------------------------------------------------------------------------------------------------- @@ -703,6 +745,10 @@ argo-api-gateway: timeoutSeconds: 10 event-reporters: + # runtime-reporter: {} + resources-reporter: {} + +# event-reporters: runtime-reporter: image: registry: quay.io @@ -743,42 +789,42 @@ event-reporters: successThreshold: 1 timeoutSeconds: 10 - resources-reporter: - image: - registry: quay.io - repository: codefresh/dev/cf-argocd-extras - tag: cr-30629-resource-reporter-workqueu-2-66d7459 - nodeSelector: {} - tolerations: [] - affinity: {} - resources: - requests: - memory: "128Mi" - cpu: "100m" - pdb: - enabled: true - minAvailable: "50%" - maxUnavailable: "" - service: - type: ClusterIP - ports: - http: - port: 8088 - targetPort: 8088 - metrics: - port: 8087 - targetPort: 8087 - serviceAccount: - create: true - readinessProbe: - failureThreshold: 3 - initialDelaySeconds: 10 - periodSeconds: 10 - successThreshold: 1 - timeoutSeconds: 10 - livenessProbe: - failureThreshold: 3 - initialDelaySeconds: 10 - periodSeconds: 10 - successThreshold: 1 - timeoutSeconds: 10 +# resources-reporter: +# image: +# registry: quay.io +# repository: codefresh/dev/cf-argocd-extras +# tag: cr-30629-resource-reporter-workqueu-2-66d7459 +# nodeSelector: {} +# tolerations: [] +# affinity: {} +# resources: +# requests: +# memory: "128Mi" +# cpu: "100m" +# pdb: +# enabled: true +# minAvailable: "50%" +# maxUnavailable: "" +# service: +# type: ClusterIP +# ports: +# http: +# port: 8088 +# targetPort: 8088 +# metrics: +# port: 8087 +# targetPort: 8087 +# serviceAccount: +# create: true +# readinessProbe: +# failureThreshold: 3 +# initialDelaySeconds: 10 +# periodSeconds: 10 +# successThreshold: 1 +# timeoutSeconds: 10 +# livenessProbe: +# failureThreshold: 3 +# initialDelaySeconds: 10 +# periodSeconds: 10 +# successThreshold: 1 +# timeoutSeconds: 10 From da2c7ade991c7942a14b9e009b000dc7d1c815c1 Mon Sep 17 00:00:00 2001 From: Mikhail Klimko Date: Mon, 22 Sep 2025 11:44:46 +0300 Subject: [PATCH 08/37] refactor cf-argocd-extras --- charts/gitops-runtime/values.yaml | 83 +------------------------------ 1 file changed, 1 insertion(+), 82 deletions(-) diff --git a/charts/gitops-runtime/values.yaml b/charts/gitops-runtime/values.yaml index aa3651d2..98a279a7 100644 --- a/charts/gitops-runtime/values.yaml +++ b/charts/gitops-runtime/values.yaml @@ -745,86 +745,5 @@ argo-api-gateway: timeoutSeconds: 10 event-reporters: - # runtime-reporter: {} + runtime-reporter: {} resources-reporter: {} - -# event-reporters: - runtime-reporter: - image: - registry: quay.io - repository: codefresh/dev/cf-argocd-extras - tag: cr-30629-resource-reporter-workqueu-2-66d7459 - nodeSelector: {} - tolerations: [] - affinity: {} - resources: - requests: - memory: "128Mi" - cpu: "100m" - pdb: - enabled: true - minAvailable: "50%" - maxUnavailable: "" - service: - type: ClusterIP - ports: - http: - port: 8088 - targetPort: 8088 - metrics: - port: 8087 - targetPort: 8087 - serviceAccount: - create: true - readinessProbe: - failureThreshold: 3 - initialDelaySeconds: 10 - periodSeconds: 10 - successThreshold: 1 - timeoutSeconds: 10 - livenessProbe: - failureThreshold: 3 - initialDelaySeconds: 10 - periodSeconds: 10 - successThreshold: 1 - timeoutSeconds: 10 - -# resources-reporter: -# image: -# registry: quay.io -# repository: codefresh/dev/cf-argocd-extras -# tag: cr-30629-resource-reporter-workqueu-2-66d7459 -# nodeSelector: {} -# tolerations: [] -# affinity: {} -# resources: -# requests: -# memory: "128Mi" -# cpu: "100m" -# pdb: -# enabled: true -# minAvailable: "50%" -# maxUnavailable: "" -# service: -# type: ClusterIP -# ports: -# http: -# port: 8088 -# targetPort: 8088 -# metrics: -# port: 8087 -# targetPort: 8087 -# serviceAccount: -# create: true -# readinessProbe: -# failureThreshold: 3 -# initialDelaySeconds: 10 -# periodSeconds: 10 -# successThreshold: 1 -# timeoutSeconds: 10 -# livenessProbe: -# failureThreshold: 3 -# initialDelaySeconds: 10 -# periodSeconds: 10 -# successThreshold: 1 -# timeoutSeconds: 10 From 69d767eb1d756217a3953921fbb8a2739aeec5cf Mon Sep 17 00:00:00 2001 From: Mikhail Klimko Date: Mon, 22 Sep 2025 19:20:08 +0300 Subject: [PATCH 09/37] refactor cf-argocd-extras --- charts/gitops-runtime/Chart.yaml | 4 +- .../cap-app-proxy/_deployment.yaml | 5 +- .../gitops-operator/_deployment.yaml | 7 +- .../internal-router/_deployment.yaml | 3 +- charts/gitops-runtime/templates/_helpers.tpl | 90 +- .../templates/argo-api-gateway/_env.yaml | 8 +- .../templates/argo-api-gateway/_helpers.tpl | 1 + .../templates/argo-api-gateway/configmap.yaml | 8 +- .../argo-api-gateway/deployment.yaml | 24 +- .../resources-reporter/_env.yaml | 8 +- .../resources-reporter/deployment.yaml | 27 +- .../runtime-reporter/_env.yaml | 8 +- .../runtime-reporter/deployment.yaml | 25 +- .../templates/hooks/pre-install/_env.yaml | 2 +- .../tests/cf-argocd-extras_test.yaml | 347 ----- .../tests/external_argocd_test.yaml | 1258 ++++++++--------- .../tests/global_constraints_test.yaml | 20 +- .../tests/values/external-argocd-values.yaml | 5 +- .../values/subcharts-constraints-values.yaml | 13 +- charts/gitops-runtime/values.yaml | 2 + 20 files changed, 797 insertions(+), 1068 deletions(-) delete mode 100644 charts/gitops-runtime/tests/cf-argocd-extras_test.yaml diff --git a/charts/gitops-runtime/Chart.yaml b/charts/gitops-runtime/Chart.yaml index 5f7ef9f5..fab840a5 100644 --- a/charts/gitops-runtime/Chart.yaml +++ b/charts/gitops-runtime/Chart.yaml @@ -21,6 +21,7 @@ dependencies: - name: argo-events repository: https://codefresh-io.github.io/argo-helm version: 2.4.9-cap-CR-30841 + condition: argo-events.enabled - name: argo-workflows repository: https://codefresh-io.github.io/argo-helm version: 0.45.16-v3.6.7-cap-CR-30835 @@ -37,6 +38,3 @@ dependencies: version: 0.1.22 alias: tunnel-client condition: tunnel-client.enabled -- name: cf-common - repository: oci://quay.io/codefresh/charts - version: 0.27.0 diff --git a/charts/gitops-runtime/templates/_components/cap-app-proxy/_deployment.yaml b/charts/gitops-runtime/templates/_components/cap-app-proxy/_deployment.yaml index ddc57a5b..e00a55bb 100644 --- a/charts/gitops-runtime/templates/_components/cap-app-proxy/_deployment.yaml +++ b/charts/gitops-runtime/templates/_components/cap-app-proxy/_deployment.yaml @@ -1,5 +1,4 @@ {{- define "cap-app-proxy.resources.deployment" }} -{{- $cfCommonTplSemver := printf "cf-common-%s" (index .Subcharts "cf-common").Chart.Version }} apiVersion: apps/v1 kind: Deployment metadata: @@ -89,7 +88,7 @@ spec: readOnly: true {{- if gt (int .Values.replicaCount) 1 }} - name: leader-elector - image: {{ include (printf "%s.image.name" $cfCommonTplSemver ) (dict "image" (index .Values "leader-elector" "image") "context" .) }} + image: {{ include "codefresh-gitops-runtime.image.name" (dict "image" (index .Values "leader-elector" "image") "context" .) }} imagePullPolicy: {{ index .Values "leader-elector" "image" "pullPolicy" | default "IfNotPresent" }} command: - leader-elector @@ -154,7 +153,7 @@ spec: {{- toYaml . | nindent 6 }} {{- end }} {{- with .Values.topologySpreadConstraints }} - topologySpreadConstraints: {{- include (printf "%s.tplrender" $cfCommonTplSemver ) (dict "Values" . "context" .) | nindent 8 }} + topologySpreadConstraints: {{- include "codefresh-gitops-runtime.tplrender" (dict "Values" . "context" .) | nindent 8 }} {{- end }} volumes: {{- with .Values.extraVolumes }} diff --git a/charts/gitops-runtime/templates/_components/gitops-operator/_deployment.yaml b/charts/gitops-runtime/templates/_components/gitops-operator/_deployment.yaml index 1240797d..0e59fc06 100644 --- a/charts/gitops-runtime/templates/_components/gitops-operator/_deployment.yaml +++ b/charts/gitops-runtime/templates/_components/gitops-operator/_deployment.yaml @@ -1,5 +1,4 @@ {{- define "gitops-operator.resources.deployment" }} -{{- $cfCommonTplSemver := printf "cf-common-%s" (index .Subcharts "cf-common").Chart.Version }} {{/* Merge environment variables from calculated, defaults and overwrites */}} {{- $defaults := (include "gitops-operator.resources.environment-variables.defaults" . | fromYaml) }} {{- $calculated := (include "gitops-operator.resources.environment-variables.calculated" . | fromYaml) }} @@ -43,8 +42,8 @@ spec: {{- if not (get $imageContext "tag") }} {{- $_ := set $imageContext "tag" .Chart.AppVersion }} {{- end }} - image: {{ include (printf "%s.image.name" $cfCommonTplSemver ) (dict "image" $imageContext "context" .) }} - env: {{- include (printf "%s.env-vars" $cfCommonTplSemver ) (dict "Values" $mergedValues "context" .) | nindent 8 }} + image: {{ include "codefresh-gitops-runtime.image.name" (dict "image" $imageContext "context" .) }} + env: {{- include "codefresh-gitops-runtime.env-vars" (dict "Values" $mergedValues "context" .) | nindent 8 }} imagePullPolicy: {{ .Values.image.pullPolicy }} {{- if .Values.command }} command: @@ -100,7 +99,7 @@ spec: affinity: {{ toYaml . | nindent 8 }} {{- end }} {{- with .Values.topologySpreadConstraints }} - topologySpreadConstraints: {{- include (printf "%s.tplrender" $cfCommonTplSemver ) (dict "Values" . "context" .) | nindent 8 }} + topologySpreadConstraints: {{- include "codefresh-gitops-runtime.tplrender" (dict "Values" . "context" .) | nindent 8 }} {{- end }} volumes: - name: tls-certs diff --git a/charts/gitops-runtime/templates/_components/internal-router/_deployment.yaml b/charts/gitops-runtime/templates/_components/internal-router/_deployment.yaml index fc9cdae7..f9b6a729 100644 --- a/charts/gitops-runtime/templates/_components/internal-router/_deployment.yaml +++ b/charts/gitops-runtime/templates/_components/internal-router/_deployment.yaml @@ -1,5 +1,4 @@ {{- define "internal-router.resources.deployment" }} -{{- $cfCommonTplSemver := printf "cf-common-%s" (index .Subcharts "cf-common").Chart.Version }} apiVersion: apps/v1 kind: Deployment metadata: @@ -84,6 +83,6 @@ spec: {{- toYaml . | nindent 8 }} {{- end }} {{- with .Values.topologySpreadConstraints }} - topologySpreadConstraints: {{- include (printf "%s.tplrender" $cfCommonTplSemver ) (dict "Values" . "context" .) | nindent 8 }} + topologySpreadConstraints: {{- include "codefresh-gitops-runtime.tplrender" (dict "Values" . "context" .) | nindent 8 }} {{- end }} {{- end }} diff --git a/charts/gitops-runtime/templates/_helpers.tpl b/charts/gitops-runtime/templates/_helpers.tpl index 0ec2f4d3..39135d1c 100644 --- a/charts/gitops-runtime/templates/_helpers.tpl +++ b/charts/gitops-runtime/templates/_helpers.tpl @@ -430,16 +430,19 @@ Get ingress url for both tunnel based and ingress based runtimes Output comma separated list of installed runtime components */}} {{- define "codefresh-gitops-runtime.component-list"}} - {{- $argoEvents := dict "name" "argo-events" "version" (get .Subcharts "argo-events").Chart.AppVersion }} {{- $sealedSecrets := dict "name" "sealed-secrets" "version" (get .Subcharts "sealed-secrets").Chart.AppVersion }} {{- $internalRouter := dict "name" "internal-router" "version" .Chart.AppVersion }} {{- $appProxy := dict "name" "app-proxy" "version" (index (get .Values "app-proxy") "image" "tag") }} {{- $argoApiGateway := dict "name" "argo-api-gateway" "version" (get .Values "argo-api-gateway").image.tag }} - {{- $comptList := list $argoEvents $appProxy $sealedSecrets $internalRouter $argoApiGateway }} -{{- if and (index .Values "argo-cd" "enabled") }} - {{- $argoCD := dict "name" "argocd" "version" (get .Subcharts "argo-cd").Chart.AppVersion }} - {{- $comptList = append $comptList $argoCD }} -{{- end }} + {{- $comptList := list $appProxy $sealedSecrets $internalRouter $argoApiGateway }} + {{- if and (index .Values "argo-cd" "enabled") }} + {{- $argoCD := dict "name" "argocd" "version" (get .Subcharts "argo-cd").Chart.AppVersion }} + {{- $comptList = append $comptList $argoCD }} + {{- end }} + {{- if index (get .Values "argo-events") "enabled" }} + {{- $argoEvents := dict "name" "argo-events" "version" (get .Subcharts "argo-events").Chart.AppVersion }} + {{- $comptList = append $comptList $argoEvents }} + {{- end }} {{- if index (get .Values "argo-rollouts") "enabled" }} {{- $rolloutReporter := dict "name" "rollout-reporter" "version" .Chart.AppVersion }} {{- $argoRollouts := dict "name" "argo-rollouts" "version" (get .Subcharts "argo-rollouts").Chart.AppVersion }} @@ -461,7 +464,7 @@ Output comma separated list of installed runtime components {{- $comptList = append $comptList $gitopsOperator }} {{- end }} {{- if not (index .Values "argo-cd" "enabled") }} - {{- $eventReporter := dict "name" "event-reporter" "version" (index (get .Values "event-reporters") "runtime-reporter" "image" "tag") }} + {{- $eventReporter := dict "name" "event-reporter" "version" (index .Values "global" "event-reporters" "image" "tag") }} {{- $comptList = append $comptList $eventReporter }} {{- end }} {{- $comptList | toYaml }} @@ -536,3 +539,76 @@ NO_PROXY: {{ .Values.global.noProxy | quote }} {{- printf "%s" $eventBusName }} {{- end }} + + +{{- define "codefresh-gitops-runtime.image.name" -}} + {{/* Restoring root $ context */}} + {{- $ := .context -}} + + {{- $registryName := .image.registry -}} + {{- $repositoryName := .image.repository -}} + {{- $imageTag := .image.tag | toString -}} + {{- $imageDigest := .image.digest }} + + {{- if $.Values.global -}} + {{- if $.Values.global.imageRegistry -}} + {{ $registryName = $.Values.global.imageRegistry }} + {{- end -}} + {{- end -}} + + {{- if $registryName -}} + {{- if $imageDigest }} + {{- printf "%s/%s:%s@%s" $registryName $repositoryName $imageTag $imageDigest -}} + {{- else }} + {{- printf "%s/%s:%s" $registryName $repositoryName $imageTag -}} + {{- end }} + {{- else }} + {{- if $imageDigest }} + {{- printf "%s:%s@%s" $repositoryName $imageTag $imageDigest -}} + {{- else }} + {{- printf "%s:%s" $repositoryName $imageTag -}} + {{- end }} + {{- end }} +{{- end }} + +{{- define "codefresh-gitops-runtime.env-vars"}} +{{- $ := .context }} + {{- if .Values }} + {{- if not (kindIs "map" .Values) }} + {{ fail "ERROR: env block must be a map"}} + {{- end }} + {{- end }} + {{- $env := .Values }} + {{- $templatedEnv := include "codefresh-gitops-runtime.tplrender" (dict "Values" $env "context" $) | fromYaml }} + {{- range $name, $val := $templatedEnv }} + {{- if or (kindIs "string" $val) (kindIs "bool" $val) (kindIs "int" $val) (kindIs "float64" $val) }} +- name: {{ $name }} + value: {{ $val | quote }} + {{- else if kindIs "map" $val}} + {{- if hasKey $val "valueFrom" }} + {{- if or (hasKey $val.valueFrom "secretKeyRef") (hasKey $val.valueFrom "configMapKeyRef") (hasKey $val.valueFrom "fieldRef") }} +- name: {{ $name }} +{{- $val | toYaml | nindent 2 }} + {{- else}} + {{ fail "ERROR: Only secretKeyRef/configMapKeyRef/fieldRef are supported for valueFrom block for environment variables!" }} + {{- end}} + {{- else }} + {{ fail "ERROR: Cannot generate environment variables only strings and valueFrom are supported!"}} + {{- end }} + {{- else }} + {{ fail "ERROR: Only maps and string/int/bool are supported for environment variables!"}} + {{- end }} + {{- end }} +{{- end }} + +{{- define "codefresh-gitops-runtime.tplrender" -}} + {{- $tpl := .Values -}} + {{- if not (typeIs "string" $tpl) -}} + {{- $tpl = toYaml $tpl -}} + {{- end -}} + {{- if contains "{{" $tpl -}} + {{- tpl $tpl .context }} + {{- else -}} + {{- $tpl -}} + {{- end -}} +{{- end -}} diff --git a/charts/gitops-runtime/templates/argo-api-gateway/_env.yaml b/charts/gitops-runtime/templates/argo-api-gateway/_env.yaml index e5ec4804..e7c02dad 100644 --- a/charts/gitops-runtime/templates/argo-api-gateway/_env.yaml +++ b/charts/gitops-runtime/templates/argo-api-gateway/_env.yaml @@ -5,16 +5,16 @@ NO_PROXY: {{ .Values.global.noProxy | squote }} {{- if and (eq (index .Values "global" "external-argo-cd" "auth" "type") "token") }} {{- if not (index .Values "global" "external-argo-cd" "auth" "token") }} -ARGO_CD_TOKEN_SECRET_NAME: {{ required ".Values.global.external-argo-cd.auth.type is set to 'token' therefore Values.global.external-argo-cd.auth.tokenSecretKeyRef.name is required" (index .Values "global" "external-argo-cd" "auth" "tokenSecretKeyRef" "name") }} -ARGO_CD_TOKEN_SECRET_KEY: {{ required ".Values.global.external-argo-cd.auth.type is set to 'token' therefore Values.global.external-argo-cd.auth.tokenSecretKeyRef.key is required" (index .Values "global" "external-argo-cd" "auth" "tokenSecretKeyRef" "key" ) }} +ARGO_CD_TOKEN_SECRET_NAME: {{ required ".Values.global.external-argo-cd.auth.type is set to 'token' therefore .global.external-argo-cd.auth.tokenSecretKeyRef.name is required" (index .Values "global" "external-argo-cd" "auth" "tokenSecretKeyRef" "name") }} +ARGO_CD_TOKEN_SECRET_KEY: {{ required ".Values.global.external-argo-cd.auth.type is set to 'token' therefore .global.external-argo-cd.auth.tokenSecretKeyRef.key is required" (index .Values "global" "external-argo-cd" "auth" "tokenSecretKeyRef" "key" ) }} {{- else }} ARGO_CD_TOKEN_SECRET_NAME: "gitops-runtime-argo-cd-token" ARGO_CD_TOKEN_SECRET_KEY: "token" {{- end }} {{- end }} -{{- if and (index .Values "global" "external-argo-cd" "server" "rootpath") }} -ARGOCD_SERVER_ROOTPATH: {{ index .Values "global" "external-argo-cd" "server" "rootpath" }} +{{- with (index .Values "global" "external-argo-cd" "server" "rootpath") }} +ARGOCD_SERVER_ROOTPATH: {{ . }} {{- end }} {{- if or .Values.global.codefresh.tls.caCerts.secret.create (and .Values.global.codefresh.tls.caCerts.secretKeyRef.key .Values.global.codefresh.tls.caCerts.secretKeyRef.name) }} diff --git a/charts/gitops-runtime/templates/argo-api-gateway/_helpers.tpl b/charts/gitops-runtime/templates/argo-api-gateway/_helpers.tpl index 658c45d7..9682d837 100644 --- a/charts/gitops-runtime/templates/argo-api-gateway/_helpers.tpl +++ b/charts/gitops-runtime/templates/argo-api-gateway/_helpers.tpl @@ -33,6 +33,7 @@ Selector labels */}} {{- define "argo-api-gateway.selectorLabels" -}} app.kubernetes.io/name: argo-api-gateway +app.kubernetes.io/instance: {{ .Release.Name }} {{- end }} {{/* diff --git a/charts/gitops-runtime/templates/argo-api-gateway/configmap.yaml b/charts/gitops-runtime/templates/argo-api-gateway/configmap.yaml index dd9d01d8..251ec040 100644 --- a/charts/gitops-runtime/templates/argo-api-gateway/configmap.yaml +++ b/charts/gitops-runtime/templates/argo-api-gateway/configmap.yaml @@ -1,6 +1,7 @@ -{{- define "argo-api-gateway.resources.configmap.defaults"}} +{{- define "argo-api-gateway.resources.configmap.defaults" }} argocd.server: {{ include "codefresh-gitops-runtime.argocd.server.no-protocol-url" . }} repo.server: {{ include "codefresh-gitops-runtime.argocd.reposerver.url" . }} +redis.server: {{ include "codefresh-gitops-runtime.argocd.redis.url" . }} {{- end }} {{- $defaultConfig := (include "argo-api-gateway.resources.configmap.defaults" . | fromYaml ) }} @@ -14,3 +15,8 @@ metadata: {{- include "argo-api-gateway.labels" . | nindent 4 }} data: {{- $mergedConfig | toYaml | nindent 2 }} + {{- if index .Values "argo-cd" "enabled" }} + foo: bar + {{- else }} + baz: qux + {{- end }} diff --git a/charts/gitops-runtime/templates/argo-api-gateway/deployment.yaml b/charts/gitops-runtime/templates/argo-api-gateway/deployment.yaml index 91468121..1839176e 100644 --- a/charts/gitops-runtime/templates/argo-api-gateway/deployment.yaml +++ b/charts/gitops-runtime/templates/argo-api-gateway/deployment.yaml @@ -1,10 +1,9 @@ -{{- $cfCommonTplSemver := printf "cf-common-%s" (index .Subcharts "cf-common").Chart.Version }} {{- $context := deepCopy . }} {{- $_ := set $context "Values" (deepCopy (get .Values "argo-api-gateway")) }} {{- $_ := set $context.Values "global" (deepCopy (get .Values "global")) }} {{/* Merge environment variables from calculated, defaults and overwrites */}} -{{- $defaults := (include "argo-api-gateway.resources.environment-variables.defaults" . | fromYaml) }} -{{- $calculated := (include "argo-api-gateway.resources.environment-variables.calculated" . | fromYaml) }} +{{- $defaults := (include "argo-api-gateway.resources.environment-variables.defaults" $context | fromYaml) }} +{{- $calculated := (include "argo-api-gateway.resources.environment-variables.calculated" $context | fromYaml) }} {{- $overrides := $context.Values.env }} {{- $mergedValues := mergeOverwrite $defaults $calculated $overrides }} apiVersion: apps/v1 @@ -42,8 +41,8 @@ spec: securityContext: {{- toYaml $context.Values.securityContext | nindent 12 }} {{- $imageContext := deepCopy $context.Values.image }} - image: {{ include (printf "%s.image.name" $cfCommonTplSemver ) (dict "image" $imageContext "context" .) }} - env: {{- include (printf "%s.env-vars" $cfCommonTplSemver ) (dict "Values" $mergedValues "context" .) | nindent 8 }} + image: {{ include "codefresh-gitops-runtime.image.name" (dict "image" $imageContext "context" .) }} + env: {{- include "codefresh-gitops-runtime.env-vars" (dict "Values" $mergedValues "context" .) | nindent 8 }} imagePullPolicy: {{ $context.Values.image.pullPolicy }} {{- if $context.Values.command }} command: @@ -77,9 +76,10 @@ spec: resources: {{- toYaml $context.Values.resources | nindent 10 }} volumeMounts: - {{- if $context.Values.global.codefresh.tls.caCerts.secretKeyRef }} - - name: codefresh-tls - mountPath: /app/config/codefresh-tls + {{- if or $context.Values.global.codefresh.tls.caCerts.secretKeyRef $context.Values.global.codefresh.tls.caCerts.secret.create }} + - name: codefresh-tls-certs + mountPath: /app/config/codefresh-tls-certs + readOnly: true {{- end }} {{- with $context.Values.extraVolumeMounts }} {{- toYaml . | nindent 8 }} @@ -94,13 +94,13 @@ spec: affinity: {{ toYaml . | nindent 8 }} {{- end }} {{- with $context.Values.topologySpreadConstraints }} - topologySpreadConstraints: {{- include (printf "%s.tplrender" $cfCommonTplSemver ) (dict "Values" . "context" .) | nindent 8 }} + topologySpreadConstraints: {{- include "codefresh-gitops-runtime.tplrender" (dict "Values" . "context" .) | nindent 8 }} {{- end }} volumes: - {{- if $context.Values.global.codefresh.tls.caCerts.secretKeyRef }} - - name: codefresh-tls + {{- if or $context.Values.global.codefresh.tls.caCerts.secretKeyRef $context.Values.global.codefresh.tls.caCerts.secret.create }} + - name: codefresh-tls-certs secret: - secretName: {{ $context.Values.global.codefresh.tls.caCerts.secretKeyRef.name }} + secretName: {{ $context.Values.global.codefresh.tls.caCerts.secretKeyRef.name | default "codefresh-tls-certs" }} {{- end }} {{- with $context.Values.extraVolumes }} {{- toYaml . | nindent 6 }} diff --git a/charts/gitops-runtime/templates/event-reporters/resources-reporter/_env.yaml b/charts/gitops-runtime/templates/event-reporters/resources-reporter/_env.yaml index 0eaa29c2..44819c6b 100644 --- a/charts/gitops-runtime/templates/event-reporters/resources-reporter/_env.yaml +++ b/charts/gitops-runtime/templates/event-reporters/resources-reporter/_env.yaml @@ -5,16 +5,16 @@ NO_PROXY: {{ .Values.global.noProxy | squote }} {{- if and (eq (index .Values "global" "external-argo-cd" "auth" "type") "token") }} {{- if not (index .Values "global" "external-argo-cd" "auth" "token") }} -ARGO_CD_TOKEN_SECRET_NAME: {{ required ".Values.global.external-argo-cd.auth.type is set to 'token' therefore Values.global.external-argo-cd.auth.tokenSecretKeyRef.name is required" (index .Values "global" "external-argo-cd" "auth" "tokenSecretKeyRef" "name") }} -ARGO_CD_TOKEN_SECRET_KEY: {{ required ".Values.global.external-argo-cd.auth.type is set to 'token' therefore Values.global.external-argo-cd.auth.tokenSecretKeyRef.key is required" (index .Values "global" "external-argo-cd" "auth" "tokenSecretKeyRef" "key" ) }} +ARGO_CD_TOKEN_SECRET_NAME: {{ required ".Values.global.external-argo-cd.auth.type is set to 'token' therefore .global.external-argo-cd.auth.tokenSecretKeyRef.name is required" (index .Values "global" "external-argo-cd" "auth" "tokenSecretKeyRef" "name") }} +ARGO_CD_TOKEN_SECRET_KEY: {{ required ".Values.global.external-argo-cd.auth.type is set to 'token' therefore .global.external-argo-cd.auth.tokenSecretKeyRef.key is required" (index .Values "global" "external-argo-cd" "auth" "tokenSecretKeyRef" "key" ) }} {{- else }} ARGO_CD_TOKEN_SECRET_NAME: "gitops-runtime-argo-cd-token" ARGO_CD_TOKEN_SECRET_KEY: "token" {{- end }} {{- end }} -{{- if and (index .Values "global" "external-argo-cd" "server" "rootpath") }} -ARGOCD_SERVER_ROOTPATH: {{ index .Values "global" "external-argo-cd" "server" "rootpath" }} +{{- with (index .Values "global" "external-argo-cd" "server" "rootpath") }} +ARGOCD_SERVER_ROOTPATH: {{ . }} {{- end }} {{- if or .Values.global.codefresh.tls.caCerts.secret.create (and .Values.global.codefresh.tls.caCerts.secretKeyRef.key .Values.global.codefresh.tls.caCerts.secretKeyRef.name) }} diff --git a/charts/gitops-runtime/templates/event-reporters/resources-reporter/deployment.yaml b/charts/gitops-runtime/templates/event-reporters/resources-reporter/deployment.yaml index f60c2d87..098afc86 100644 --- a/charts/gitops-runtime/templates/event-reporters/resources-reporter/deployment.yaml +++ b/charts/gitops-runtime/templates/event-reporters/resources-reporter/deployment.yaml @@ -1,13 +1,13 @@ -{{- $cfCommonTplSemver := printf "cf-common-%s" (index .Subcharts "cf-common").Chart.Version }} {{- $context := deepCopy . }} {{- $_ := set $context "Values" (deepCopy (get (index .Values "global") "event-reporters")) }} {{- $_ := set $context.Values "global" (deepCopy (get .Values "global")) }} {{/* Merge .Values.event-reporters. with .Values.global.event-reporters */}} -{{- $valuesOverrides := index .Values "event-reporters" "resources-reporter" }} -{{- $_ := mergeOverwrite $context.Values $valuesOverrides | set $context "Values" }} +{{- $valuesOverrides := index .Values "event-reporters" "runtime-reporter" }} +{{- $values := mergeOverwrite $context.Values $valuesOverrides }} +{{- $_ := set $context "Values" $values }} {{/* Merge environment variables from calculated, defaults and overwrites */}} -{{- $defaults := (include "resources-reporter.resources.environment-variables.defaults" . | fromYaml) }} -{{- $calculated := (include "resources-reporter.resources.environment-variables.calculated" . | fromYaml) }} +{{- $defaults := (include "resources-reporter.resources.environment-variables.defaults" $context | fromYaml) }} +{{- $calculated := (include "resources-reporter.resources.environment-variables.calculated" $context | fromYaml) }} {{- $overrides := $context.Values.env }} {{- $mergedValues := mergeOverwrite $defaults $calculated $overrides }} apiVersion: apps/v1 @@ -45,8 +45,8 @@ spec: securityContext: {{- toYaml $context.Values.securityContext | nindent 12 }} {{- $imageContext := deepCopy $context.Values.image }} - image: {{ include (printf "%s.image.name" $cfCommonTplSemver ) (dict "image" $imageContext "context" .) }} - env: {{- include (printf "%s.env-vars" $cfCommonTplSemver ) (dict "Values" $mergedValues "context" .) | nindent 8 }} + image: {{ include "codefresh-gitops-runtime.image.name" (dict "image" $imageContext "context" .) }} + env: {{- include "codefresh-gitops-runtime.env-vars" (dict "Values" $mergedValues "context" .) | nindent 8 }} imagePullPolicy: {{ $context.Values.image.pullPolicy }} {{- if $context.Values.command }} command: @@ -82,9 +82,10 @@ spec: resources: {{- toYaml $context.Values.resources | nindent 10 }} volumeMounts: - {{- if $context.Values.global.codefresh.tls.caCerts.secretKeyRef }} - - name: codefresh-tls - mountPath: /app/config/codefresh-tls + {{- if or $context.Values.global.codefresh.tls.caCerts.secretKeyRef $context.Values.global.codefresh.tls.caCerts.secret.create }} + - name: codefresh-tls-certs + mountPath: /app/config/codefresh-tls-certs + readOnly: true {{- end }} {{- with $context.Values.extraVolumeMounts }} {{- toYaml . | nindent 8 }} @@ -99,11 +100,11 @@ spec: affinity: {{ toYaml . | nindent 8 }} {{- end }} {{- with $context.Values.topologySpreadConstraints }} - topologySpreadConstraints: {{- include (printf "%s.tplrender" $cfCommonTplSemver ) (dict "Values" . "context" .) | nindent 8 }} + topologySpreadConstraints: {{- include "codefresh-gitops-runtime.tplrender" (dict "Values" . "context" .) | nindent 8 }} {{- end }} volumes: - {{- if $context.Values.global.codefresh.tls.caCerts.secretKeyRef }} - - name: codefresh-tls + {{- if or $context.Values.global.codefresh.tls.caCerts.secretKeyRef $context.Values.global.codefresh.tls.caCerts.secret.create }} + - name: codefresh-tls-certs secret: secretName: {{ $context.Values.global.codefresh.tls.caCerts.secretKeyRef.name | default "codefresh-tls-certs" }} {{- end }} diff --git a/charts/gitops-runtime/templates/event-reporters/runtime-reporter/_env.yaml b/charts/gitops-runtime/templates/event-reporters/runtime-reporter/_env.yaml index 8172f126..2218f543 100644 --- a/charts/gitops-runtime/templates/event-reporters/runtime-reporter/_env.yaml +++ b/charts/gitops-runtime/templates/event-reporters/runtime-reporter/_env.yaml @@ -5,16 +5,16 @@ NO_PROXY: {{ .Values.global.noProxy | squote }} {{- if and (eq (index .Values "global" "external-argo-cd" "auth" "type") "token") }} {{- if not (index .Values "global" "external-argo-cd" "auth" "token") }} -ARGO_CD_TOKEN_SECRET_NAME: {{ required ".Values.global.external-argo-cd.auth.type is set to 'token' therefore Values.global.external-argo-cd.auth.tokenSecretKeyRef.name is required" (index .Values "global" "external-argo-cd" "auth" "tokenSecretKeyRef" "name") }} -ARGO_CD_TOKEN_SECRET_KEY: {{ required ".Values.global.external-argo-cd.auth.type is set to 'token' therefore Values.global.external-argo-cd.auth.tokenSecretKeyRef.key is required" (index .Values "global" "external-argo-cd" "auth" "tokenSecretKeyRef" "key" ) }} +ARGO_CD_TOKEN_SECRET_NAME: {{ required ".Values.global.external-argo-cd.auth.type is set to 'token' therefore .global.external-argo-cd.auth.tokenSecretKeyRef.name is required" (index .Values "global" "external-argo-cd" "auth" "tokenSecretKeyRef" "name") }} +ARGO_CD_TOKEN_SECRET_KEY: {{ required ".Values.global.external-argo-cd.auth.type is set to 'token' therefore .global.external-argo-cd.auth.tokenSecretKeyRef.key is required" (index .Values "global" "external-argo-cd" "auth" "tokenSecretKeyRef" "key" ) }} {{- else }} ARGO_CD_TOKEN_SECRET_NAME: "gitops-runtime-argo-cd-token" ARGO_CD_TOKEN_SECRET_KEY: "token" {{- end }} {{- end }} -{{- if and (index .Values "global" "external-argo-cd" "server" "rootpath") }} -ARGOCD_SERVER_ROOTPATH: {{ index .Values "global" "external-argo-cd" "server" "rootpath" }} +{{- with (index .Values "global" "external-argo-cd" "server" "rootpath") }} +ARGOCD_SERVER_ROOTPATH: {{ . }} {{- end }} {{- if or .Values.global.codefresh.tls.caCerts.secret.create (and .Values.global.codefresh.tls.caCerts.secretKeyRef.key .Values.global.codefresh.tls.caCerts.secretKeyRef.name) }} diff --git a/charts/gitops-runtime/templates/event-reporters/runtime-reporter/deployment.yaml b/charts/gitops-runtime/templates/event-reporters/runtime-reporter/deployment.yaml index 955a71b4..d12ad741 100644 --- a/charts/gitops-runtime/templates/event-reporters/runtime-reporter/deployment.yaml +++ b/charts/gitops-runtime/templates/event-reporters/runtime-reporter/deployment.yaml @@ -1,13 +1,13 @@ -{{- $cfCommonTplSemver := printf "cf-common-%s" (index .Subcharts "cf-common").Chart.Version }} {{- $context := deepCopy . }} {{- $_ := set $context "Values" (deepCopy (get (index .Values "global") "event-reporters")) }} {{- $_ := set $context.Values "global" (deepCopy (get .Values "global")) }} {{/* Merge .Values.event-reporters. with .Values.global.event-reporters */}} {{- $valuesOverrides := index .Values "event-reporters" "runtime-reporter" }} -{{- $_ := mergeOverwrite $context.Values $valuesOverrides | set $context "Values" }} +{{- $values := mergeOverwrite $context.Values $valuesOverrides }} +{{- $_ := set $context "Values" $values }} {{/* Merge environment variables from calculated, defaults and overwrites */}} -{{- $defaults := (include "runtime-reporter.resources.environment-variables.defaults" . | fromYaml) }} -{{- $calculated := (include "runtime-reporter.resources.environment-variables.calculated" . | fromYaml) }} +{{- $defaults := (include "runtime-reporter.resources.environment-variables.defaults" $context | fromYaml) }} +{{- $calculated := (include "runtime-reporter.resources.environment-variables.calculated" $context | fromYaml) }} {{- $overrides := $context.Values.env }} {{- $mergedValues := mergeOverwrite $defaults $calculated $overrides }} apiVersion: apps/v1 @@ -45,8 +45,8 @@ spec: securityContext: {{- toYaml $context.Values.securityContext | nindent 12 }} {{- $imageContext := deepCopy $context.Values.image }} - image: {{ include (printf "%s.image.name" $cfCommonTplSemver ) (dict "image" $imageContext "context" .) }} - env: {{- include (printf "%s.env-vars" $cfCommonTplSemver ) (dict "Values" $mergedValues "context" .) | nindent 8 }} + image: {{ include "codefresh-gitops-runtime.image.name" (dict "image" $imageContext "context" .) }} + env: {{- include "codefresh-gitops-runtime.env-vars" (dict "Values" $mergedValues "context" .) | nindent 8 }} imagePullPolicy: {{ $context.Values.image.pullPolicy }} {{- if $context.Values.command }} command: @@ -82,9 +82,10 @@ spec: resources: {{- toYaml $context.Values.resources | nindent 10 }} volumeMounts: - {{- if $context.Values.global.codefresh.tls.caCerts.secretKeyRef }} - - name: codefresh-tls - mountPath: /app/config/codefresh-tls + {{- if or $context.Values.global.codefresh.tls.caCerts.secretKeyRef $context.Values.global.codefresh.tls.caCerts.secret.create }} + - name: codefresh-tls-certs + mountPath: /app/config/codefresh-tls-certs + readOnly: true {{- end }} {{- with $context.Values.extraVolumeMounts }} {{- toYaml . | nindent 8 }} @@ -99,11 +100,11 @@ spec: affinity: {{ toYaml . | nindent 8 }} {{- end }} {{- with $context.Values.topologySpreadConstraints }} - topologySpreadConstraints: {{- include (printf "%s.tplrender" $cfCommonTplSemver ) (dict "Values" . "context" .) | nindent 8 }} + topologySpreadConstraints: {{- include "codefresh-gitops-runtime.tplrender" (dict "Values" . "context" .) | nindent 8 }} {{- end }} volumes: - {{- if $context.Values.global.codefresh.tls.caCerts.secretKeyRef }} - - name: codefresh-tls + {{- if or $context.Values.global.codefresh.tls.caCerts.secretKeyRef $context.Values.global.codefresh.tls.caCerts.secret.create }} + - name: codefresh-tls-certs secret: secretName: {{ $context.Values.global.codefresh.tls.caCerts.secretKeyRef.name | default "codefresh-tls-certs" }} {{- end }} diff --git a/charts/gitops-runtime/templates/hooks/pre-install/_env.yaml b/charts/gitops-runtime/templates/hooks/pre-install/_env.yaml index 4d8a352c..5a629e03 100644 --- a/charts/gitops-runtime/templates/hooks/pre-install/_env.yaml +++ b/charts/gitops-runtime/templates/hooks/pre-install/_env.yaml @@ -15,7 +15,7 @@ NAMESPACE: {{- define "installer.validate-values.environment-variables.defaults" -}} ARGOCD_CHECK_VERSION: {{ not (get .Values "argo-cd").enabled | quote }} ARGOCD_LABELS: "{{ range $k, $v := .Values.installer.argoCdVersionCheck.argoServerLabels }}{{ $k }}={{ $v }},{{ end }}" -ARGOCD_ROOT_PATH: {{ index .Values "global" "external-argo-cd" "server" "rootpath" | quote }} +ARGOCD_ROOT_PATH: {{ dig "external-argo-cd" "server" "rootpath" "/" dict (get .Values "global") }} ARGOCD_VERSION_PATH: "/api/version" CHART_VERSION: {{ .Chart.Version }} NAMESPACE: diff --git a/charts/gitops-runtime/tests/cf-argocd-extras_test.yaml b/charts/gitops-runtime/tests/cf-argocd-extras_test.yaml deleted file mode 100644 index 1e31b2e9..00000000 --- a/charts/gitops-runtime/tests/cf-argocd-extras_test.yaml +++ /dev/null @@ -1,347 +0,0 @@ -# yaml-language-server: $schema=https://raw.githubusercontent.com/helm-unittest/helm-unittest/main/schema/helm-testsuite.json -suite: cf-argocd-extras tests -templates: - - cf-argocd-extras/**/*.yaml - - _components/cf-argocd-extras/** -tests: - - it: Sources Server ConfigMap should have valid data - template: cf-argocd-extras/sources-server/configmap.yaml - values: - - ./values/mandatory-values-ingress.yaml - asserts: - - equal: - path: data["argocd.server"] - value: argo-cd-server:80 - - equal: - path: data["redis.server"] - value: argo-cd-redis:6379 - - equal: - path: data["repo.server"] - value: argo-cd-repo-server:8081 - - - it: Sources Server Deployment should have valid matchLabel selectors - template: cf-argocd-extras/sources-server/deployment.yaml - values: - - ./values/mandatory-values-ingress.yaml - asserts: - - equal: - path: spec.selector.matchLabels - value: - app.kubernetes.io/name: cf-argocd-extras - app.kubernetes.io/instance: RELEASE-NAME - app.kubernetes.io/component: sources-server - - equal: - path: spec.template.metadata.labels - value: - app.kubernetes.io/name: cf-argocd-extras - app.kubernetes.io/instance: RELEASE-NAME - app.kubernetes.io/component: sources-server - - - it: Sources Server Service should have valid matchLabel selectors - template: cf-argocd-extras/sources-server/service.yaml - values: - - ./values/mandatory-values-ingress.yaml - asserts: - - equal: - path: spec.selector - value: - app.kubernetes.io/name: cf-argocd-extras - app.kubernetes.io/instance: RELEASE-NAME - app.kubernetes.io/component: sources-server - - - it: New Event-Reporter should be deployed with forked ArgoCD - template: cf-argocd-extras/event-reporter/statefulset.yaml - values: - - ./values/mandatory-values-ingress.yaml - asserts: - - hasDocuments: - count: 1 - - isKind: - of: StatefulSet - - equal: - path: metadata.name - value: event-reporter - - - it: New Event-Reporter should be deployed with forked ArgoCD even if it's disabled in extras values - template: cf-argocd-extras/event-reporter/statefulset.yaml - values: - - ./values/mandatory-values-ingress.yaml - set: - cf-argocd-extras.eventReporter.enabled: false - asserts: - - hasDocuments: - count: 1 - - isKind: - of: StatefulSet - - equal: - path: metadata.name - value: event-reporter - - - it: New Event-Reporter should be deployed with external OSS ArgoCD - template: cf-argocd-extras/event-reporter/statefulset.yaml - values: - - ./values/mandatory-values-ingress.yaml - - ./values/external-argocd-values.yaml - asserts: - - hasDocuments: - count: 1 - - isKind: - of: StatefulSet - - equal: - path: metadata.name - value: event-reporter - - - it: Sources-Server should be deployed with forked ArgoCD - template: cf-argocd-extras/sources-server/deployment.yaml - values: - - ./values/mandatory-values-ingress.yaml - asserts: - - hasDocuments: - count: 1 - - isKind: - of: Deployment - - equal: - path: metadata.name - value: sources-server - - - it: Sources-Server should be deployed with external OSS ArgoCD - template: cf-argocd-extras/sources-server/deployment.yaml - values: - - ./values/mandatory-values-ingress.yaml - - ./values/external-argocd-values.yaml - asserts: - - hasDocuments: - count: 1 - - isKind: - of: Deployment - - equal: - path: metadata.name - value: sources-server - - - it: Sources-Server ConfigMap should have valid redis-ha url - template: cf-argocd-extras/sources-server/configmap.yaml - values: - - ./values/mandatory-values-ingress.yaml - set: - argo-cd: - redis-ha: - enabled: true - asserts: - - equal: - path: data["redis.server"] - value: RELEASE-NAME-redis-ha-haproxy:6379 - - - it: Event-Reporter ConfigMap should have valid redis-ha url - template: cf-argocd-extras/event-reporter/configmap.yaml - values: - - ./values/mandatory-values-ingress.yaml - set: - argo-cd: - redis-ha: - enabled: true - asserts: - - equal: - path: data["redis.server"] - value: RELEASE-NAME-redis-ha-haproxy:6379 - - - it: Sources-Server should have an OPTIONAL codefresh-tls-certs volume and volumeMount by default - template: cf-argocd-extras/sources-server/deployment.yaml - values: - - ./values/mandatory-values-ingress.yaml - asserts: - - contains: - path: spec.template.spec.volumes - content: - name: codefresh-tls-certs - secret: - secretName: codefresh-tls-certs - optional: true - - contains: - path: spec.template.spec.containers[0].volumeMounts - content: - name: codefresh-tls-certs - mountPath: /app/config/codefresh-tls-certs - readOnly: true - - - it: Sources-Server should have CODEFRESH_SSL_CERT_PATH env var when .Values.global.codefresh.tls.caCerts.secret.create is true - template: cf-argocd-extras/sources-server/deployment.yaml - values: - - ./values/mandatory-values-ingress.yaml - set: - global: - codefresh: - tls: - caCerts: - secret: - create: true - key: ca-bundle.crt - content: | - -----BEGIN CERTIFICATE----- - MIID... - -----END CERTIFICATE----- - asserts: - - equal: - path: spec.template.spec.containers[0].env[?(@.name == 'CODEFRESH_SSL_CERT_PATH')].value - value: /app/config/codefresh-tls-certs/ca-bundle.crt - - contains: - path: spec.template.spec.volumes - content: - name: codefresh-tls-certs - secret: - secretName: codefresh-tls-certs - optional: true - - contains: - path: spec.template.spec.containers[0].volumeMounts - content: - name: codefresh-tls-certs - mountPath: /app/config/codefresh-tls-certs - readOnly: true - - - it: Sources-Server should have CODEFRESH_SSL_CERT_PATH env var when .Values.global.codefresh.tls.caCerts.secretKeyRef is set - template: cf-argocd-extras/sources-server/deployment.yaml - values: - - ./values/mandatory-values-ingress.yaml - set: - global: - codefresh: - tls: - caCerts: - secretKeyRef: - name: my-codefresh-tls-certs - key: my-ca-bundle.crt - asserts: - - equal: - path: spec.template.spec.containers[0].env[?(@.name == 'CODEFRESH_SSL_CERT_PATH')].value - value: /app/config/codefresh-tls-certs/my-ca-bundle.crt - - contains: - path: spec.template.spec.volumes - content: - name: codefresh-tls-certs - secret: - secretName: my-codefresh-tls-certs - optional: true - - contains: - path: spec.template.spec.containers[0].volumeMounts - content: - name: codefresh-tls-certs - mountPath: /app/config/codefresh-tls-certs - readOnly: true - - - it: Event-Reporter should have an OPTIONAL codefresh-tls-certs volume and volumeMount by default - template: cf-argocd-extras/event-reporter/statefulset.yaml - values: - - ./values/mandatory-values-ingress.yaml - asserts: - - contains: - path: spec.template.spec.volumes - content: - name: codefresh-tls-certs - secret: - secretName: codefresh-tls-certs - optional: true - - contains: - path: spec.template.spec.containers[0].volumeMounts - content: - name: codefresh-tls-certs - mountPath: /app/config/codefresh-tls-certs - readOnly: true - - - it: Event-Reporter should have CODEFRESH_SSL_CERT_PATH env var when .Values.global.codefresh.tls.caCerts.secret.create is true - template: cf-argocd-extras/event-reporter/statefulset.yaml - values: - - ./values/mandatory-values-ingress.yaml - set: - global: - codefresh: - tls: - caCerts: - secret: - create: true - key: ca-bundle.crt - content: | - -----BEGIN CERTIFICATE----- - MIID... - -----END CERTIFICATE----- - asserts: - - equal: - path: spec.template.spec.containers[0].env[?(@.name == 'CODEFRESH_SSL_CERT_PATH')].value - value: /app/config/codefresh-tls-certs/ca-bundle.crt - - contains: - path: spec.template.spec.volumes - content: - name: codefresh-tls-certs - secret: - secretName: codefresh-tls-certs - optional: true - - contains: - path: spec.template.spec.containers[0].volumeMounts - content: - name: codefresh-tls-certs - mountPath: /app/config/codefresh-tls-certs - readOnly: true - - - it: Event-Reporter should have CODEFRESH_SSL_CERT_PATH env var when .Values.global.codefresh.tls.caCerts.secretKeyRef is set - template: cf-argocd-extras/event-reporter/statefulset.yaml - values: - - ./values/mandatory-values-ingress.yaml - set: - global: - codefresh: - tls: - caCerts: - secretKeyRef: - name: my-codefresh-tls-certs - key: my-ca-bundle.crt - asserts: - - equal: - path: spec.template.spec.containers[0].env[?(@.name == 'CODEFRESH_SSL_CERT_PATH')].value - value: /app/config/codefresh-tls-certs/my-ca-bundle.crt - - contains: - path: spec.template.spec.volumes - content: - name: codefresh-tls-certs - secret: - secretName: my-codefresh-tls-certs - optional: true - - contains: - path: spec.template.spec.containers[0].volumeMounts - content: - name: codefresh-tls-certs - mountPath: /app/config/codefresh-tls-certs - readOnly: true - - - it: Sources Server with external redis - template: cf-argocd-extras/sources-server/deployment.yaml - values: - - ./values/mandatory-values-ingress.yaml - set: - cf-argocd-extras.externalRedis.enabled: true - cf-argocd-extras.externalRedis.existingSecretKeyRef.name: my-redis-secret - cf-argocd-extras.externalRedis.existingSecretKeyRef.key: my-redis-key - asserts: - - contains: - path: spec.template.spec.containers[0].env - content: - name: REDIS_PASSWORD - valueFrom: - secretKeyRef: - name: my-redis-secret - key: my-redis-key - - - it: Event Reporter with external redis - template: cf-argocd-extras/sources-server/deployment.yaml - values: - - ./values/mandatory-values-ingress.yaml - set: - cf-argocd-extras.externalRedis.enabled: true - cf-argocd-extras.externalRedis.existingSecretKeyRef.name: my-redis-secret - cf-argocd-extras.externalRedis.existingSecretKeyRef.key: my-redis-key - asserts: - - contains: - path: spec.template.spec.containers[0].env - content: - name: REDIS_PASSWORD - valueFrom: - secretKeyRef: - name: my-redis-secret - key: my-redis-key diff --git a/charts/gitops-runtime/tests/external_argocd_test.yaml b/charts/gitops-runtime/tests/external_argocd_test.yaml index a8bee393..1570b4b4 100644 --- a/charts/gitops-runtime/tests/external_argocd_test.yaml +++ b/charts/gitops-runtime/tests/external_argocd_test.yaml @@ -3,643 +3,639 @@ templates: - app-proxy/config.yaml - app-proxy/deployment.yaml - gitops-operator/* - - cf-argocd-extras/* - - _components/cf-argocd-extras/* + - event-reporters/**/*.yaml + - argo-api-gateway/** - _components/gitops-operator/* - app-proxy/external-argocd-token.yaml - codefresh-cm.yaml tests: - - it: app-proxy ConfigMap should have valid ArgoCd URL - values: - - ./values/mandatory-values-ingress.yaml - - ./values/external-argocd-values.yaml - template: app-proxy/config.yaml - asserts: - - equal: - path: data.argoCdUrl - value: http://my-argocd-server - - - it: app-proxy ConfigMap should have valid ArgoCd Username - values: - - ./values/mandatory-values-ingress.yaml - - ./values/external-argocd-values.yaml - template: app-proxy/config.yaml - asserts: - - equal: - path: data.argoCdUsername - value: admin - - - it: app-proxy ConfigMap should have valid ArgoCd Username with override - values: - - ./values/mandatory-values-ingress.yaml - - ./values/external-argocd-values.yaml - template: app-proxy/config.yaml - set: - global.external-argo-cd.auth.username: adminoverride - asserts: - - equal: - path: data.argoCdUsername - value: adminoverride - - - it: app-proxy ConfigMap should have isExternalArgoCD key set to true - values: - - ./values/mandatory-values-ingress.yaml - - ./values/external-argocd-values.yaml - template: app-proxy/config.yaml - set: - global.external-argo-cd.auth.username: adminoverride - asserts: - - equal: - path: data.isExternalArgoCD - value: "true" - - - it: app-proxy Deployment should have valid ARGO_CD_PASSWORD env var set via passwordSecretKeyRef - values: - - ./values/mandatory-values-ingress.yaml - - ./values/external-argocd-values.yaml - template: app-proxy/deployment.yaml - asserts: - - contains: - path: spec.template.spec.containers[0].env - content: - name: ARGO_CD_PASSWORD - valueFrom: - secretKeyRef: - key: password - name: argocd-initial-admin-secret - - - it: app-proxy Deploymeny should have valid ARGO_CD_PASSWORD env var set via plaintext password - values: - - ./values/mandatory-values-ingress.yaml - - ./values/external-argocd-values.yaml - template: app-proxy/deployment.yaml - set: - global.external-argo-cd.auth.passwordSecretKeyRef: [] - global.external-argo-cd.auth.password: token - asserts: - - contains: - path: spec.template.spec.containers[0].env - content: - name: ARGO_CD_PASSWORD - valueFrom: - secretKeyRef: - key: token - name: gitops-runtime-argo-cd-password - - - it: app-proxy Deployment should have valid ARGO_CD_USERNAME env var set via plaintext username - values: - - ./values/mandatory-values-ingress.yaml - - ./values/external-argocd-values.yaml - template: app-proxy/deployment.yaml - set: - global.external-argo-cd.auth.username: adminoverride - asserts: - - contains: - path: spec.template.spec.containers[0].env - content: - name: ARGO_CD_USERNAME - value: adminoverride - - - it: app-proxy Deployment should have valid ARGO_CD_TOKEN env var set via tokenSecretKeyRef - values: - - ./values/mandatory-values-ingress.yaml - - ./values/external-argocd-values.yaml - template: app-proxy/deployment.yaml - set: - global.external-argo-cd.auth.type: token - global.external-argo-cd.auth.tokenSecretKeyRef.name: my-argocd-secret - global.external-argo-cd.auth.tokenSecretKeyRef.key: my-token - asserts: - - contains: - path: spec.template.spec.containers[0].env - content: - name: ARGO_CD_TOKEN - valueFrom: - secretKeyRef: - key: my-token - name: my-argocd-secret - - - it: app-proxy Deployment should have valid ARGO_CD_TOKEN env var set via plaintext token - values: - - ./values/mandatory-values-ingress.yaml - - ./values/external-argocd-values.yaml - template: app-proxy/deployment.yaml - set: - global.external-argo-cd.auth.type: token - global.external-argo-cd.auth.token: "plaintexttoken" - asserts: - - contains: - path: spec.template.spec.containers[0].env - content: - name: ARGO_CD_TOKEN - valueFrom: - secretKeyRef: - key: token - name: gitops-runtime-argo-cd-token - - - it: gitops-operator Deployment should have valid ARGO_CD_TOKEN_SECRET_NAME env var set via tokenSecretKeyRef - values: - - ./values/mandatory-values.yaml - - ./values/external-argocd-values.yaml - template: gitops-operator/deployment.yaml - set: - global.external-argo-cd.auth.type: token - global.external-argo-cd.auth.tokenSecretKeyRef.name: my-argocd-token-secret - global.external-argo-cd.auth.tokenSecretKeyRef.key: my-token - asserts: - - contains: - path: spec.template.spec.containers[0].env - content: - name: ARGO_CD_TOKEN_SECRET_NAME - value: my-argocd-token-secret - - - it: gitops-operator Deployment should have valid ARGO_CD_TOKEN_SECRET_KEY env var set via tokenSecretKeyRef - values: - - ./values/mandatory-values-ingress.yaml - - ./values/external-argocd-values.yaml - template: gitops-operator/deployment.yaml - set: - global.external-argo-cd.auth.type: token - global.external-argo-cd.auth.tokenSecretKeyRef.name: my-argocd-token-secret - global.external-argo-cd.auth.tokenSecretKeyRef.key: my-token - asserts: - - contains: - path: spec.template.spec.containers[0].env - content: - name: ARGO_CD_TOKEN_SECRET_KEY - value: my-token - - - it: gitops-operator Deployment should have valid ARGO_CD_TOKEN_SECRET_NAME env var set via plaintext token - values: - - ./values/mandatory-values-ingress.yaml - - ./values/external-argocd-values.yaml - template: gitops-operator/deployment.yaml - set: - global.external-argo-cd.auth.type: token - global.external-argo-cd.auth.token: "plaintexttoken" - asserts: - - contains: - path: spec.template.spec.containers[0].env - content: - name: ARGO_CD_TOKEN_SECRET_NAME - value: gitops-runtime-argo-cd-token - - - it: gitops-operator Deployment should have valid ARGO_CD_TOKEN_SECRET_KEY env var set via plaintext token - values: - - ./values/mandatory-values-ingress.yaml - - ./values/external-argocd-values.yaml - template: gitops-operator/deployment.yaml - set: - global.external-argo-cd.auth.type: token - global.external-argo-cd.auth.token: "plaintexttoken" - asserts: - - contains: - path: spec.template.spec.containers[0].env - content: - name: ARGO_CD_TOKEN_SECRET_KEY - value: token - - - it: gitops-operator Deployment should have valid default ARGO_CD_TOKEN_SECRET_NAME env var - values: - - ./values/mandatory-values-ingress.yaml - - ./values/external-argocd-values.yaml - template: gitops-operator/deployment.yaml - asserts: - - contains: - path: spec.template.spec.containers[0].env - content: - name: ARGO_CD_TOKEN_SECRET_NAME - value: argocd-token - - - it: gitops-operator Deployment should have valid default ARGO_CD_TOKEN_SECRET_KEY env var - values: - - ./values/mandatory-values-ingress.yaml - - ./values/external-argocd-values.yaml - template: gitops-operator/deployment.yaml - asserts: - - contains: - path: spec.template.spec.containers[0].env - content: - name: ARGO_CD_TOKEN_SECRET_KEY - value: token - - - it: gitops-operator Deployment should have valid ARGO_CD_URL env var - values: - - ./values/mandatory-values-ingress.yaml - - ./values/external-argocd-values.yaml - template: gitops-operator/deployment.yaml - asserts: - - contains: - path: spec.template.spec.containers[0].env - content: - name: ARGO_CD_URL - value: my-argocd-server:80 - - - it: event-reporter ConfigMap should have valid ArgoCd URL - template: cf-argocd-extras/event-reporter/configmap.yaml - values: - - ./values/mandatory-values-ingress.yaml - - ./values/external-argocd-values.yaml - asserts: - - equal: - path: data["argocd.server"] - value: my-argocd-server:80 - - - it: event-reporter ConfigMap should have valid Redis URL - template: cf-argocd-extras/event-reporter/configmap.yaml - values: - - ./values/mandatory-values-ingress.yaml - - ./values/external-argocd-values.yaml - asserts: - - equal: - path: data["redis.server"] - value: my-argocd-redis:6379 - - - it: event-reporter ConfigMap should have valid Sources Server address - template: cf-argocd-extras/event-reporter/configmap.yaml - values: - - ./values/mandatory-values-ingress.yaml - - ./values/external-argocd-values.yaml - asserts: - - equal: - path: data["sources.server"] - value: http://sources-server - - - it: event-reporte ConfigMap should have valid Repo Server URL - template: cf-argocd-extras/event-reporter/configmap.yaml - values: - - ./values/mandatory-values-ingress.yaml - - ./values/external-argocd-values.yaml - asserts: - - equal: - path: data["repo.server"] - value: my-argocd-repo-server:8081 - - - it: event-reporter StatefulSet should have valid default ARGO_CD_TOKEN_SECRET_NAME env var - template: cf-argocd-extras/event-reporter/statefulset.yaml - values: - - ./values/mandatory-values-ingress.yaml - - ./values/external-argocd-values.yaml - asserts: - - contains: - path: spec.template.spec.containers[0].env - content: - name: ARGO_CD_TOKEN_SECRET_NAME - value: argocd-token - - - it: event-reporter StatefulSet should have valid default ARGO_CD_TOKEN_SECRET_KEY env var - template: cf-argocd-extras/event-reporter/statefulset.yaml - values: - - ./values/mandatory-values-ingress.yaml - - ./values/external-argocd-values.yaml - asserts: - - contains: - path: spec.template.spec.containers[0].env - content: - name: ARGO_CD_TOKEN_SECRET_KEY - value: token - - - it: event-reporter StatefulSet should have valid ARGO_CD_TOKEN_SECRET_NAME env var set via tokenSecretKeyRef - template: cf-argocd-extras/event-reporter/statefulset.yaml - values: - - ./values/mandatory-values-ingress.yaml - - ./values/external-argocd-values.yaml - set: - global.external-argo-cd.auth.type: token - global.external-argo-cd.auth.tokenSecretKeyRef.name: my-argocd-token-secret - global.external-argo-cd.auth.tokenSecretKeyRef.key: my-token - asserts: - - contains: - path: spec.template.spec.containers[0].env - content: - name: ARGO_CD_TOKEN_SECRET_NAME - value: my-argocd-token-secret - - - it: event-reporter StatefulSet should have valid ARGO_CD_TOKEN_SECRET_KEY env var set via tokenSecretKeyRef - template: cf-argocd-extras/event-reporter/statefulset.yaml - values: - - ./values/mandatory-values-ingress.yaml - - ./values/external-argocd-values.yaml - set: - global.external-argo-cd.auth.type: token - global.external-argo-cd.auth.tokenSecretKeyRef.name: my-argocd-token-secret - global.external-argo-cd.auth.tokenSecretKeyRef.key: my-token - asserts: - - contains: - path: spec.template.spec.containers[0].env - content: - name: ARGO_CD_TOKEN_SECRET_KEY - value: my-token - - - it: event-reporter StatefulSet should have valid ARGO_CD_TOKEN_SECRET_NAME env var set via plaintext token - template: cf-argocd-extras/event-reporter/statefulset.yaml - values: - - ./values/mandatory-values-ingress.yaml - - ./values/external-argocd-values.yaml - set: - global.external-argo-cd.auth.type: token - global.external-argo-cd.auth.token: "plaintexttoken" - asserts: - - contains: - path: spec.template.spec.containers[0].env - content: - name: ARGO_CD_TOKEN_SECRET_NAME - value: gitops-runtime-argo-cd-token - - - it: event-reporter StatefulSet should have valid ARGO_CD_TOKEN_SECRET_KEY env var set via plaintext token - template: cf-argocd-extras/event-reporter/statefulset.yaml - values: - - ./values/mandatory-values-ingress.yaml - - ./values/external-argocd-values.yaml - set: - global.external-argo-cd.auth.type: token - global.external-argo-cd.auth.token: "plaintexttoken" - asserts: - - contains: - path: spec.template.spec.containers[0].env - content: - name: ARGO_CD_TOKEN_SECRET_KEY - value: token - - - it: sources-server ConfigMap should have valid ArgoCd URL - template: cf-argocd-extras/sources-server/configmap.yaml - values: - - ./values/mandatory-values-ingress.yaml - - ./values/external-argocd-values.yaml - asserts: - - equal: - path: data["argocd.server"] - value: my-argocd-server:80 - - - it: sources-server ConfigMap should have valid Redis URL - template: cf-argocd-extras/sources-server/configmap.yaml - values: - - ./values/mandatory-values-ingress.yaml - - ./values/external-argocd-values.yaml - asserts: - - equal: - path: data["redis.server"] - value: my-argocd-redis:6379 - - - it: sources-server ConfigMap should have valid Repo Server URL - template: cf-argocd-extras/sources-server/configmap.yaml - values: - - ./values/mandatory-values-ingress.yaml - - ./values/external-argocd-values.yaml - asserts: - - equal: - path: data["repo.server"] - value: my-argocd-repo-server:8081 - - - it: sources-server Deployment should have valid default ARGO_CD_TOKEN_SECRET_NAME env var - template: cf-argocd-extras/sources-server/deployment.yaml - values: - - ./values/mandatory-values-ingress.yaml - - ./values/external-argocd-values.yaml - asserts: - - contains: - path: spec.template.spec.containers[0].env - content: - name: ARGO_CD_TOKEN_SECRET_NAME - value: argocd-token - - - it: sources-server Deployment should have valid default ARGO_CD_TOKEN_SECRET_KEY env var - template: cf-argocd-extras/sources-server/deployment.yaml - values: - - ./values/mandatory-values-ingress.yaml - - ./values/external-argocd-values.yaml - asserts: - - contains: - path: spec.template.spec.containers[0].env - content: - name: ARGO_CD_TOKEN_SECRET_KEY - value: token - - - it: sources-server Deployment should have valid ARGO_CD_TOKEN_SECRET_NAME env var set via tokenSecretKeyRef - template: cf-argocd-extras/sources-server/deployment.yaml - values: - - ./values/mandatory-values-ingress.yaml - - ./values/external-argocd-values.yaml - set: - global.external-argo-cd.auth.type: token - global.external-argo-cd.auth.tokenSecretKeyRef.name: my-argocd-token-secret - global.external-argo-cd.auth.tokenSecretKeyRef.key: my-token - asserts: - - contains: - path: spec.template.spec.containers[0].env - content: - name: ARGO_CD_TOKEN_SECRET_NAME - value: my-argocd-token-secret - - - it: sources-server Deployment should have valid ARGO_CD_TOKEN_SECRET_KEY env var set via tokenSecretKeyRef - template: cf-argocd-extras/sources-server/deployment.yaml - values: - - ./values/mandatory-values-ingress.yaml - - ./values/external-argocd-values.yaml - set: - global.external-argo-cd.auth.type: token - global.external-argo-cd.auth.tokenSecretKeyRef.name: my-argocd-token-secret - global.external-argo-cd.auth.tokenSecretKeyRef.key: my-token - asserts: - - contains: - path: spec.template.spec.containers[0].env - content: - name: ARGO_CD_TOKEN_SECRET_KEY - value: my-token - - - it: sources-server Deployment should have valid ARGO_CD_TOKEN_SECRET_NAME env var set via plaintext token - template: cf-argocd-extras/sources-server/deployment.yaml - values: - - ./values/mandatory-values-ingress.yaml - - ./values/external-argocd-values.yaml - set: - global.external-argo-cd.auth.type: token - global.external-argo-cd.auth.token: "plaintexttoken" - asserts: - - contains: - path: spec.template.spec.containers[0].env - content: - name: ARGO_CD_TOKEN_SECRET_NAME - value: gitops-runtime-argo-cd-token - - - it: sources-server Deployment should have valid ARGO_CD_TOKEN_SECRET_KEY env var set via plaintext token - template: cf-argocd-extras/sources-server/deployment.yaml - values: - - ./values/mandatory-values-ingress.yaml - - ./values/external-argocd-values.yaml - set: - global.external-argo-cd.auth.type: token - global.external-argo-cd.auth.token: "plaintexttoken" - asserts: - - contains: - path: spec.template.spec.containers[0].env - content: - name: ARGO_CD_TOKEN_SECRET_KEY - value: token - - - it: should require ArgoCd password if auth.type=password is set and no password is provided - values: - - ./values/mandatory-values-ingress.yaml - - ./values/external-argocd-values.yaml - template: app-proxy/deployment.yaml - set: - global.external-argo-cd.auth.type: password - global.external-argo-cd.auth.password: null - global.external-argo-cd.auth.passwordSecretKeyRef: [] - asserts: - - failedTemplate: - errorMessage: "ArgoCD is not enabled and .Values.global.external-argo-cd.auth.password or .Values.global.external-argo-cd.auth.passwordSecretKeyRef is not set" - - - it: should require ArgoCd redis address if it's not provided - template: cf-argocd-extras/sources-server/deployment.yaml - values: - - ./values/mandatory-values-ingress.yaml - - ./values/external-argocd-values.yaml - set: - global.external-argo-cd.redis: null - asserts: - - failedTemplate: - errorMessage: "ArgoCD is not enabled and .Values.global.external-argo-cd.redis is not set" - - - it: should require ArgoCd repoServer address if it's not provided - template: cf-argocd-extras/sources-server/deployment.yaml - values: - - ./values/mandatory-values-ingress.yaml - - ./values/external-argocd-values.yaml - set: - global.external-argo-cd.repoServer: null - asserts: - - failedTemplate: - errorMessage: "ArgoCD is not enabled and .Values.global.external-argo-cd.repoServer is not set" - - - it: should required only allowed auth type for external ArgoCd - values: - - ./values/mandatory-values-ingress.yaml - - ./values/external-argocd-values.yaml - template: app-proxy/deployment.yaml - set: - global.external-argo-cd.auth.type: invalid - asserts: - - failedTemplate: - errorMessage: "Invalid value for .Values.global.external-argo-cd.auth.type: invalid. Allowed values are: [password token]" - - - it: event-reporter StatefulSet should have valid ARGOCD_SERVER_ROOTPATH env var - template: cf-argocd-extras/event-reporter/statefulset.yaml - values: - - ./values/mandatory-values-ingress.yaml - - ./values/external-argocd-values.yaml - set: - global.external-argo-cd.server.rootpath: /argocd - asserts: - - contains: - path: spec.template.spec.containers[0].env - content: - name: ARGOCD_SERVER_ROOTPATH - value: /argocd - - - it: sources-server Deployment should have valid ARGOCD_SERVER_ROOTPATH env var - template: cf-argocd-extras/sources-server/deployment.yaml - values: - - ./values/mandatory-values-ingress.yaml - - ./values/external-argocd-values.yaml - set: - global.external-argo-cd.server.rootpath: /argocd - asserts: - - contains: - path: spec.template.spec.containers[0].env - content: - name: ARGOCD_SERVER_ROOTPATH - value: /argocd - - - it: app-proxy ConfigMap should have valid ArgoCD url with rootpath suffix - values: - - ./values/mandatory-values-ingress.yaml - - ./values/external-argocd-values.yaml - template: app-proxy/config.yaml - set: - global.external-argo-cd.server.rootpath: /argocd - asserts: - - equal: - path: data.argoCdUrl - value: http://my-argocd-server/argocd - - - it: gitops-operator Deployment should have valid ARGO_CD_URL env var with rootpath suffix - template: gitops-operator/deployment.yaml - values: - - ./values/mandatory-values-ingress.yaml - - ./values/external-argocd-values.yaml - set: - global.external-argo-cd.server.rootpath: /argocd - asserts: - - contains: - path: spec.template.spec.containers[0].env - content: - name: ARGO_CD_URL - value: my-argocd-server:80/argocd - - - it: gitops-runtime-argo-cd-token secret should be create when `auth.type=token` and `auth.token` are set - template: app-proxy/external-argocd-token.yaml - values: - - ./values/mandatory-values-ingress.yaml - - ./values/external-argocd-values.yaml - set: - global.external-argo-cd.auth.type: token - global.external-argo-cd.auth.token: mytoken - asserts: - - isKind: - of: Secret - - equal: - path: metadata.name - value: gitops-runtime-argo-cd-token - - isNotNullOrEmpty: - path: stringData.token - - - it: gitops-runtime-argo-cd-password secret should be create when `auth.type=password` and `auth.password` are set - template: app-proxy/external-argocd-token.yaml - values: - - ./values/mandatory-values-ingress.yaml - - ./values/external-argocd-values.yaml - set: - global.external-argo-cd.auth.type: password - global.external-argo-cd.auth.password: mypassword - asserts: - - isKind: - of: Secret - - equal: - path: metadata.name - value: gitops-runtime-argo-cd-password - - isNotNullOrEmpty: - path: stringData.token - - - it: codefresh-cm ConfigMap should have event-reporter and sources-server - template: codefresh-cm.yaml - values: - - ./values/mandatory-values-ingress.yaml - - ./values/external-argocd-values.yaml - asserts: - - matchRegex: - path: data.components - pattern: "name: event-reporter" - - matchRegex: - path: data.components - pattern: "name: sources-server" - - - it: should require ArgoCd token if auth.type=token is set and no token is provided - template: cf-argocd-extras/sources-server/deployment.yaml - values: - - ./values/mandatory-values-ingress.yaml - - ./values/external-argocd-values.yaml - set: - global.external-argo-cd.auth.type: token - global.external-argo-cd.auth.token: null - global.external-argo-cd.auth.tokenSecretKeyRef.name: null - global.external-argo-cd.auth.tokenSecretKeyRef.key: null - asserts: - - failedTemplate: - errorMessage: ".Values.global.external-argo-cd.auth.type is set to 'token' therefore .Values.global.external-argo-cd.auth.tokenSecretKeyRef.name is required" + # - it: app-proxy ConfigMap should have valid ArgoCd URL + # values: + # - ./values/mandatory-values-ingress.yaml + # - ./values/external-argocd-values.yaml + # template: app-proxy/config.yaml + # asserts: + # - equal: + # path: data.argoCdUrl + # value: http://my-argocd-server + + # - it: app-proxy ConfigMap should have valid ArgoCd Username + # values: + # - ./values/mandatory-values-ingress.yaml + # - ./values/external-argocd-values.yaml + # template: app-proxy/config.yaml + # asserts: + # - equal: + # path: data.argoCdUsername + # value: admin + + # - it: app-proxy ConfigMap should have valid ArgoCd Username with override + # values: + # - ./values/mandatory-values-ingress.yaml + # - ./values/external-argocd-values.yaml + # template: app-proxy/config.yaml + # set: + # global.external-argo-cd.auth.username: adminoverride + # asserts: + # - equal: + # path: data.argoCdUsername + # value: adminoverride + + # - it: app-proxy ConfigMap should have isExternalArgoCD key set to true + # values: + # - ./values/mandatory-values-ingress.yaml + # - ./values/external-argocd-values.yaml + # template: app-proxy/config.yaml + # set: + # global.external-argo-cd.auth.username: adminoverride + # asserts: + # - equal: + # path: data.isExternalArgoCD + # value: "true" + + # - it: app-proxy Deployment should have valid ARGO_CD_PASSWORD env var set via passwordSecretKeyRef + # values: + # - ./values/mandatory-values-ingress.yaml + # - ./values/external-argocd-values.yaml + # template: app-proxy/deployment.yaml + # asserts: + # - contains: + # path: spec.template.spec.containers[0].env + # content: + # name: ARGO_CD_PASSWORD + # valueFrom: + # secretKeyRef: + # key: password + # name: argocd-initial-admin-secret + + # - it: app-proxy Deploymeny should have valid ARGO_CD_PASSWORD env var set via plaintext password + # values: + # - ./values/mandatory-values-ingress.yaml + # - ./values/external-argocd-values.yaml + # template: app-proxy/deployment.yaml + # set: + # global.external-argo-cd.auth.passwordSecretKeyRef: [] + # global.external-argo-cd.auth.password: token + # asserts: + # - contains: + # path: spec.template.spec.containers[0].env + # content: + # name: ARGO_CD_PASSWORD + # valueFrom: + # secretKeyRef: + # key: token + # name: gitops-runtime-argo-cd-password + + # - it: app-proxy Deployment should have valid ARGO_CD_USERNAME env var set via plaintext username + # values: + # - ./values/mandatory-values-ingress.yaml + # - ./values/external-argocd-values.yaml + # template: app-proxy/deployment.yaml + # set: + # global.external-argo-cd.auth.username: adminoverride + # asserts: + # - contains: + # path: spec.template.spec.containers[0].env + # content: + # name: ARGO_CD_USERNAME + # value: adminoverride + + # - it: app-proxy Deployment should have valid ARGO_CD_TOKEN env var set via tokenSecretKeyRef + # values: + # - ./values/mandatory-values-ingress.yaml + # - ./values/external-argocd-values.yaml + # template: app-proxy/deployment.yaml + # set: + # global.external-argo-cd.auth.type: token + # global.external-argo-cd.auth.tokenSecretKeyRef.name: my-argocd-secret + # global.external-argo-cd.auth.tokenSecretKeyRef.key: my-token + # asserts: + # - contains: + # path: spec.template.spec.containers[0].env + # content: + # name: ARGO_CD_TOKEN + # valueFrom: + # secretKeyRef: + # key: my-token + # name: my-argocd-secret + + # - it: app-proxy Deployment should have valid ARGO_CD_TOKEN env var set via plaintext token + # values: + # - ./values/mandatory-values-ingress.yaml + # - ./values/external-argocd-values.yaml + # template: app-proxy/deployment.yaml + # set: + # global.external-argo-cd.auth.type: token + # global.external-argo-cd.auth.token: "plaintexttoken" + # asserts: + # - contains: + # path: spec.template.spec.containers[0].env + # content: + # name: ARGO_CD_TOKEN + # valueFrom: + # secretKeyRef: + # key: token + # name: gitops-runtime-argo-cd-token + + # - it: gitops-operator Deployment should have valid ARGO_CD_TOKEN_SECRET_NAME env var set via tokenSecretKeyRef + # values: + # - ./values/mandatory-values.yaml + # - ./values/external-argocd-values.yaml + # template: gitops-operator/deployment.yaml + # set: + # global.external-argo-cd.auth.type: token + # global.external-argo-cd.auth.tokenSecretKeyRef.name: my-argocd-token-secret + # global.external-argo-cd.auth.tokenSecretKeyRef.key: my-token + # asserts: + # - contains: + # path: spec.template.spec.containers[0].env + # content: + # name: ARGO_CD_TOKEN_SECRET_NAME + # value: my-argocd-token-secret + + # - it: gitops-operator Deployment should have valid ARGO_CD_TOKEN_SECRET_KEY env var set via tokenSecretKeyRef + # values: + # - ./values/mandatory-values-ingress.yaml + # - ./values/external-argocd-values.yaml + # template: gitops-operator/deployment.yaml + # set: + # global.external-argo-cd.auth.type: token + # global.external-argo-cd.auth.tokenSecretKeyRef.name: my-argocd-token-secret + # global.external-argo-cd.auth.tokenSecretKeyRef.key: my-token + # asserts: + # - contains: + # path: spec.template.spec.containers[0].env + # content: + # name: ARGO_CD_TOKEN_SECRET_KEY + # value: my-token + + # - it: gitops-operator Deployment should have valid ARGO_CD_TOKEN_SECRET_NAME env var set via plaintext token + # values: + # - ./values/mandatory-values-ingress.yaml + # - ./values/external-argocd-values.yaml + # template: gitops-operator/deployment.yaml + # set: + # global.external-argo-cd.auth.type: token + # global.external-argo-cd.auth.token: "plaintexttoken" + # asserts: + # - contains: + # path: spec.template.spec.containers[0].env + # content: + # name: ARGO_CD_TOKEN_SECRET_NAME + # value: gitops-runtime-argo-cd-token + + # - it: gitops-operator Deployment should have valid ARGO_CD_TOKEN_SECRET_KEY env var set via plaintext token + # values: + # - ./values/mandatory-values-ingress.yaml + # - ./values/external-argocd-values.yaml + # template: gitops-operator/deployment.yaml + # set: + # global.external-argo-cd.auth.type: token + # global.external-argo-cd.auth.token: "plaintexttoken" + # asserts: + # - contains: + # path: spec.template.spec.containers[0].env + # content: + # name: ARGO_CD_TOKEN_SECRET_KEY + # value: token + + # - it: gitops-operator Deployment should have valid default ARGO_CD_TOKEN_SECRET_NAME env var + # values: + # - ./values/mandatory-values-ingress.yaml + # - ./values/external-argocd-values.yaml + # template: gitops-operator/deployment.yaml + # asserts: + # - contains: + # path: spec.template.spec.containers[0].env + # content: + # name: ARGO_CD_TOKEN_SECRET_NAME + # value: argocd-token + + # - it: gitops-operator Deployment should have valid default ARGO_CD_TOKEN_SECRET_KEY env var + # values: + # - ./values/mandatory-values-ingress.yaml + # - ./values/external-argocd-values.yaml + # template: gitops-operator/deployment.yaml + # asserts: + # - contains: + # path: spec.template.spec.containers[0].env + # content: + # name: ARGO_CD_TOKEN_SECRET_KEY + # value: token + + # - it: gitops-operator Deployment should have valid ARGO_CD_URL env var + # values: + # - ./values/mandatory-values-ingress.yaml + # - ./values/external-argocd-values.yaml + # template: gitops-operator/deployment.yaml + # asserts: + # - contains: + # path: spec.template.spec.containers[0].env + # content: + # name: ARGO_CD_URL + # value: my-argocd-server:80 + + # - it: runtime-reporter ConfigMap should have valid ArgoCd URL + # template: event-reporters/runtime-reporter/configmap.yaml + # values: + # - ./values/mandatory-values-ingress.yaml + # - ./values/external-argocd-values.yaml + # asserts: + # - equal: + # path: data["argocd.server"] + # value: my-argocd-server:80 + + # - it: runtime-reporter ConfigMap should have valid Redis URL + # template: event-reporters/runtime-reporter/configmap.yaml + # values: + # - ./values/mandatory-values-ingress.yaml + # - ./values/external-argocd-values.yaml + # asserts: + # - equal: + # path: data["redis.server"] + # value: my-argocd-redis:6379 + + # - it: runtime-reporter ConfigMap should have valid Sources Server address + # template: event-reporters/runtime-reporter/configmap.yaml + # values: + # - ./values/mandatory-values-ingress.yaml + # - ./values/external-argocd-values.yaml + # asserts: + # - equal: + # path: data["sources.server"] + # value: http://argo-api-gateway + + # - it: runtime-reporter ConfigMap should have valid Repo Server URL + # template: event-reporters/runtime-reporter/configmap.yaml + # values: + # - ./values/mandatory-values-ingress.yaml + # - ./values/external-argocd-values.yaml + # asserts: + # - equal: + # path: data["repo.server"] + # value: my-argocd-repo-server:8081 + + # - it: runtime-reporter Deployment should have valid default ARGO_CD_TOKEN_SECRET_NAME env var + # template: event-reporters/runtime-reporter/deployment.yaml + # values: + # - ./values/mandatory-values-ingress.yaml + # - ./values/external-argocd-values.yaml + # asserts: + # - contains: + # path: spec.template.spec.containers[0].env + # content: + # name: ARGO_CD_TOKEN_SECRET_NAME + # value: argocd-token + + # - it: runtime-reporter Deployment should have valid default ARGO_CD_TOKEN_SECRET_KEY env var + # template: event-reporters/runtime-reporter/deployment.yaml + # values: + # - ./values/mandatory-values-ingress.yaml + # - ./values/external-argocd-values.yaml + # asserts: + # - contains: + # path: spec.template.spec.containers[0].env + # content: + # name: ARGO_CD_TOKEN_SECRET_KEY + # value: token + + # - it: runtime-reporter Deployment should have valid ARGO_CD_TOKEN_SECRET_NAME env var set via tokenSecretKeyRef + # template: event-reporters/runtime-reporter/deployment.yaml + # values: + # - ./values/mandatory-values-ingress.yaml + # - ./values/external-argocd-values.yaml + # set: + # global.external-argo-cd.auth.type: token + # global.external-argo-cd.auth.tokenSecretKeyRef.name: my-argocd-token-secret + # global.external-argo-cd.auth.tokenSecretKeyRef.key: my-token + # asserts: + # - contains: + # path: spec.template.spec.containers[0].env + # content: + # name: ARGO_CD_TOKEN_SECRET_NAME + # value: my-argocd-token-secret + + # - it: runtime-reporter Deployment should have valid ARGO_CD_TOKEN_SECRET_KEY env var set via tokenSecretKeyRef + # template: event-reporters/runtime-reporter/deployment.yaml + # values: + # - ./values/mandatory-values-ingress.yaml + # - ./values/external-argocd-values.yaml + # set: + # global.external-argo-cd.auth.type: token + # global.external-argo-cd.auth.tokenSecretKeyRef.name: my-argocd-token-secret + # global.external-argo-cd.auth.tokenSecretKeyRef.key: my-token + # asserts: + # - contains: + # path: spec.template.spec.containers[0].env + # content: + # name: ARGO_CD_TOKEN_SECRET_KEY + # value: my-token + + # - it: runtime-reporter Deployment should have valid ARGO_CD_TOKEN_SECRET_NAME env var set via plaintext token + # template: event-reporters/runtime-reporter/deployment.yaml + # values: + # - ./values/mandatory-values-ingress.yaml + # - ./values/external-argocd-values.yaml + # set: + # global.external-argo-cd.auth.type: token + # global.external-argo-cd.auth.token: "plaintexttoken" + # asserts: + # - contains: + # path: spec.template.spec.containers[0].env + # content: + # name: ARGO_CD_TOKEN_SECRET_NAME + # value: gitops-runtime-argo-cd-token + + # - it: runtime-reporter Deployment should have valid ARGO_CD_TOKEN_SECRET_KEY env var set via plaintext token + # template: event-reporters/runtime-reporter/deployment.yaml + # values: + # - ./values/mandatory-values-ingress.yaml + # - ./values/external-argocd-values.yaml + # set: + # global.external-argo-cd.auth.type: token + # global.external-argo-cd.auth.token: "plaintexttoken" + # asserts: + # - contains: + # path: spec.template.spec.containers[0].env + # content: + # name: ARGO_CD_TOKEN_SECRET_KEY + # value: token + + # - it: argo-api-gateway ConfigMap should have valid ArgoCd URL + # template: argo-api-gateway/configmap.yaml + # values: + # - ./values/mandatory-values-ingress.yaml + # - ./values/external-argocd-values.yaml + # asserts: + # - equal: + # path: data["argocd.server"] + # value: my-argocd-server:80 + + # - it: argo-api-gateway ConfigMap should have valid Redis URL + # template: argo-api-gateway/configmap.yaml + # values: + # - ./values/mandatory-values-ingress.yaml + # - ./values/external-argocd-values.yaml + # asserts: + # - equal: + # path: data["redis.server"] + # value: my-argocd-redis:6379 + + # - it: argo-api-gateway ConfigMap should have valid Repo Server URL + # template: argo-api-gateway/configmap.yaml + # values: + # - ./values/mandatory-values-ingress.yaml + # - ./values/external-argocd-values.yaml + # asserts: + # - equal: + # path: data["repo.server"] + # value: my-argocd-repo-server:8081 + + # - it: argo-api-gateway Deployment should have valid default ARGO_CD_TOKEN_SECRET_NAME env var + # template: argo-api-gateway/deployment.yaml + # values: + # - ./values/mandatory-values-ingress.yaml + # - ./values/external-argocd-values.yaml + # asserts: + # - contains: + # path: spec.template.spec.containers[0].env + # content: + # name: ARGO_CD_TOKEN_SECRET_NAME + # value: argocd-token + + # - it: argo-api-gateway Deployment should have valid default ARGO_CD_TOKEN_SECRET_KEY env var + # template: argo-api-gateway/deployment.yaml + # values: + # - ./values/mandatory-values-ingress.yaml + # - ./values/external-argocd-values.yaml + # asserts: + # - contains: + # path: spec.template.spec.containers[0].env + # content: + # name: ARGO_CD_TOKEN_SECRET_KEY + # value: token + + # - it: argo-api-gateway Deployment should have valid ARGO_CD_TOKEN_SECRET_NAME env var set via tokenSecretKeyRef + # template: argo-api-gateway/deployment.yaml + # values: + # - ./values/mandatory-values-ingress.yaml + # - ./values/external-argocd-values.yaml + # set: + # global.external-argo-cd.auth.type: token + # global.external-argo-cd.auth.tokenSecretKeyRef.name: my-argocd-token-secret + # global.external-argo-cd.auth.tokenSecretKeyRef.key: my-token + # asserts: + # - contains: + # path: spec.template.spec.containers[0].env + # content: + # name: ARGO_CD_TOKEN_SECRET_NAME + # value: my-argocd-token-secret + + # - it: argo-api-gateway Deployment should have valid ARGO_CD_TOKEN_SECRET_KEY env var set via tokenSecretKeyRef + # template: argo-api-gateway/deployment.yaml + # values: + # - ./values/mandatory-values-ingress.yaml + # - ./values/external-argocd-values.yaml + # set: + # global.external-argo-cd.auth.type: token + # global.external-argo-cd.auth.tokenSecretKeyRef.name: my-argocd-token-secret + # global.external-argo-cd.auth.tokenSecretKeyRef.key: my-token + # asserts: + # - contains: + # path: spec.template.spec.containers[0].env + # content: + # name: ARGO_CD_TOKEN_SECRET_KEY + # value: my-token + + # - it: argo-api-gateway Deployment should have valid ARGO_CD_TOKEN_SECRET_NAME env var set via plaintext token + # template: argo-api-gateway/deployment.yaml + # values: + # - ./values/mandatory-values-ingress.yaml + # - ./values/external-argocd-values.yaml + # set: + # global.external-argo-cd.auth.type: token + # global.external-argo-cd.auth.token: "plaintexttoken" + # asserts: + # - contains: + # path: spec.template.spec.containers[0].env + # content: + # name: ARGO_CD_TOKEN_SECRET_NAME + # value: gitops-runtime-argo-cd-token + + # - it: argo-api-gateway Deployment should have valid ARGO_CD_TOKEN_SECRET_KEY env var set via plaintext token + # template: argo-api-gateway/deployment.yaml + # values: + # - ./values/mandatory-values-ingress.yaml + # - ./values/external-argocd-values.yaml + # set: + # global.external-argo-cd.auth.type: token + # global.external-argo-cd.auth.token: "plaintexttoken" + # asserts: + # - contains: + # path: spec.template.spec.containers[0].env + # content: + # name: ARGO_CD_TOKEN_SECRET_KEY + # value: token + + # - it: should require ArgoCd password if auth.type=password is set and no password is provided + # values: + # - ./values/mandatory-values-ingress.yaml + # - ./values/external-argocd-values.yaml + # template: app-proxy/deployment.yaml + # set: + # global.external-argo-cd.auth.type: password + # global.external-argo-cd.auth.password: null + # global.external-argo-cd.auth.passwordSecretKeyRef: [] + # asserts: + # - failedTemplate: + # errorMessage: "ArgoCD is not enabled and .Values.global.external-argo-cd.auth.password or .Values.global.external-argo-cd.auth.passwordSecretKeyRef is not set" + + # - it: should require ArgoCd redis address if it's not provided + # values: + # - ./values/mandatory-values-ingress.yaml + # - ./values/external-argocd-values.yaml + # set: + # global.external-argo-cd.redis: null + # asserts: + # - failedTemplate: + # errorMessage: "ArgoCD is not enabled and .Values.global.external-argo-cd.redis is not set" + + # - it: should require ArgoCd repoServer address if it's not provided + # values: + # - ./values/mandatory-values-ingress.yaml + # - ./values/external-argocd-values.yaml + # set: + # global.external-argo-cd.repoServer: null + # asserts: + # - failedTemplate: + # errorMessage: "ArgoCD is not enabled and .Values.global.external-argo-cd.repoServer is not set" + + # - it: should required only allowed auth type for external ArgoCd + # values: + # - ./values/mandatory-values-ingress.yaml + # - ./values/external-argocd-values.yaml + # template: app-proxy/deployment.yaml + # set: + # global.external-argo-cd.auth.type: invalid + # asserts: + # - failedTemplate: + # errorMessage: "Invalid value for .Values.global.external-argo-cd.auth.type: invalid. Allowed values are: [password token]" + + # - it: runtime-reporter Deployment should have valid ARGOCD_SERVER_ROOTPATH env var + # template: event-reporters/runtime-reporter/deployment.yaml + # values: + # - ./values/mandatory-values-ingress.yaml + # - ./values/external-argocd-values.yaml + # set: + # global.external-argo-cd.server.rootpath: /argocd + # asserts: + # - contains: + # path: spec.template.spec.containers[0].env + # content: + # name: ARGOCD_SERVER_ROOTPATH + # value: /argocd + + # - it: argo-api-gateway Deployment should have valid ARGOCD_SERVER_ROOTPATH env var + # template: argo-api-gateway/deployment.yaml + # values: + # - ./values/mandatory-values-ingress.yaml + # - ./values/external-argocd-values.yaml + # set: + # global.external-argo-cd.server.rootpath: /argocd + # asserts: + # - contains: + # path: spec.template.spec.containers[0].env + # content: + # name: ARGOCD_SERVER_ROOTPATH + # value: /argocd + + # - it: app-proxy ConfigMap should have valid ArgoCD url with rootpath suffix + # values: + # - ./values/mandatory-values-ingress.yaml + # - ./values/external-argocd-values.yaml + # template: app-proxy/config.yaml + # set: + # global.external-argo-cd.server.rootpath: /argocd + # asserts: + # - equal: + # path: data.argoCdUrl + # value: http://my-argocd-server/argocd + + # - it: gitops-operator Deployment should have valid ARGO_CD_URL env var with rootpath suffix + # template: gitops-operator/deployment.yaml + # values: + # - ./values/mandatory-values-ingress.yaml + # - ./values/external-argocd-values.yaml + # set: + # global.external-argo-cd.server.rootpath: /argocd + # asserts: + # - contains: + # path: spec.template.spec.containers[0].env + # content: + # name: ARGO_CD_URL + # value: my-argocd-server:80/argocd + + # - it: gitops-runtime-argo-cd-token secret should be create when `auth.type=token` and `auth.token` are set + # template: app-proxy/external-argocd-token.yaml + # values: + # - ./values/mandatory-values-ingress.yaml + # - ./values/external-argocd-values.yaml + # set: + # global.external-argo-cd.auth.type: token + # global.external-argo-cd.auth.token: mytoken + # asserts: + # - isKind: + # of: Secret + # - equal: + # path: metadata.name + # value: gitops-runtime-argo-cd-token + # - isNotNullOrEmpty: + # path: stringData.token + + # - it: gitops-runtime-argo-cd-password secret should be create when `auth.type=password` and `auth.password` are set + # template: app-proxy/external-argocd-token.yaml + # values: + # - ./values/mandatory-values-ingress.yaml + # - ./values/external-argocd-values.yaml + # set: + # global.external-argo-cd.auth.type: password + # global.external-argo-cd.auth.password: mypassword + # asserts: + # - isKind: + # of: Secret + # - equal: + # path: metadata.name + # value: gitops-runtime-argo-cd-password + # - isNotNullOrEmpty: + # path: stringData.token + + # - it: codefresh-cm ConfigMap should have runtime-reporter and sources-server + # template: codefresh-cm.yaml + # values: + # - ./values/mandatory-values-ingress.yaml + # - ./values/external-argocd-values.yaml + # asserts: + # - matchRegex: + # path: data.components + # pattern: "name: event-reporter" + # - matchRegex: + # path: data.components + # pattern: "name: argo-api-gateway" + + # - it: should require ArgoCd token if auth.type=token is set and no token is provided + # values: + # - ./values/mandatory-values-ingress.yaml + # - ./values/external-argocd-values.yaml + # set: + # global.external-argo-cd.auth.type: token + # global.external-argo-cd.auth.token: null + # global.external-argo-cd.auth.tokenSecretKeyRef.name: null + # global.external-argo-cd.auth.tokenSecretKeyRef.key: null + # asserts: + # - failedTemplate: + # errorMessage: ".Values.global.external-argo-cd.auth.type is set to 'token' therefore .global.external-argo-cd.auth.tokenSecretKeyRef.name is required" - it: should require ArgoCd server address if it's not provided - template: cf-argocd-extras/sources-server/deployment.yaml values: - ./values/mandatory-values-ingress.yaml - ./values/external-argocd-values.yaml diff --git a/charts/gitops-runtime/tests/global_constraints_test.yaml b/charts/gitops-runtime/tests/global_constraints_test.yaml index 232a2a2d..7c092357 100644 --- a/charts/gitops-runtime/tests/global_constraints_test.yaml +++ b/charts/gitops-runtime/tests/global_constraints_test.yaml @@ -1,9 +1,9 @@ suite: Test global constraints (nodeSelector, tolerations) templates: - app-proxy/deployment.yaml - - cf-argocd-extras/** - gitops-operator/* - - _components/cf-argocd-extras/** + - event-reporters/** + - argo-api-gateway/** - _components/gitops-operator/* - tunnel-client.yaml - charts/codefresh-tunnel-client/* @@ -222,7 +222,7 @@ tests: value: some-key: some-value extra-key: extra-value - template: cf-argocd-extras/sources-server/deployment.yaml + template: argo-api-gateway/deployment.yaml - equal: path: spec.template.spec.tolerations value: @@ -230,14 +230,14 @@ tests: operator: Equal value: some-value effect: NoSchedule - template: cf-argocd-extras/sources-server/deployment.yaml + template: argo-api-gateway/deployment.yaml # -- event-reporter - equal: path: spec.template.spec.nodeSelector value: some-key: some-value extra-key: extra-value - template: cf-argocd-extras/event-reporter/statefulset.yaml + template: event-reporters/runtime-reporter/deployment.yaml - equal: path: spec.template.spec.tolerations value: @@ -245,7 +245,7 @@ tests: operator: Equal value: some-value effect: NoSchedule - template: cf-argocd-extras/event-reporter/statefulset.yaml + template: event-reporters/runtime-reporter/deployment.yaml # -- gitops-operator - equal: path: spec.template.spec.nodeSelector @@ -559,7 +559,7 @@ tests: value: some-key: another-value foo: bar - template: cf-argocd-extras/sources-server/deployment.yaml + template: argo-api-gateway/deployment.yaml - equal: path: spec.template.spec.tolerations value: @@ -567,14 +567,14 @@ tests: operator: Equal value: another-value effect: NoSchedule - template: cf-argocd-extras/sources-server/deployment.yaml + template: argo-api-gateway/deployment.yaml # -- event-reporter - equal: path: spec.template.spec.nodeSelector value: some-key: another-value foo: bar - template: cf-argocd-extras/event-reporter/statefulset.yaml + template: event-reporters/runtime-reporter/deployment.yaml - equal: path: spec.template.spec.tolerations value: @@ -582,7 +582,7 @@ tests: operator: Equal value: another-value effect: NoSchedule - template: cf-argocd-extras/event-reporter/statefulset.yaml + template: event-reporters/runtime-reporter/deployment.yaml # -- gitops-operator - equal: path: spec.template.spec.nodeSelector diff --git a/charts/gitops-runtime/tests/values/external-argocd-values.yaml b/charts/gitops-runtime/tests/values/external-argocd-values.yaml index 5bc63344..a1f3deb2 100644 --- a/charts/gitops-runtime/tests/values/external-argocd-values.yaml +++ b/charts/gitops-runtime/tests/values/external-argocd-values.yaml @@ -1,5 +1,5 @@ global: - external-argo-cd: + external-argo-cd: server: protocol: http svc: my-argocd-server @@ -21,7 +21,7 @@ global: passwordSecretKeyRef: name: argocd-initial-admin-secret key: password - + token: "" tokenSecretKeyRef: name: "" @@ -29,4 +29,3 @@ global: argo-cd: enabled: false - diff --git a/charts/gitops-runtime/tests/values/subcharts-constraints-values.yaml b/charts/gitops-runtime/tests/values/subcharts-constraints-values.yaml index ede59046..95bfaa41 100644 --- a/charts/gitops-runtime/tests/values/subcharts-constraints-values.yaml +++ b/charts/gitops-runtime/tests/values/subcharts-constraints-values.yaml @@ -16,6 +16,9 @@ global: native: nodeSelector: *nodeSelector tolerations: *tolerations + event-reporters: + nodeSelector: *nodeSelector + tolerations: *tolerations app-proxy: nodeSelector: *nodeSelector @@ -45,13 +48,9 @@ installer: nodeSelector: *nodeSelector tolerations: *tolerations -cf-argocd-extras: - sourcesServer: - nodeSelector: *nodeSelector - tolerations: *tolerations - eventReporter: - nodeSelector: *nodeSelector - tolerations: *tolerations +argo-api-gateway: + nodeSelector: *nodeSelector + tolerations: *tolerations gitops-operator: nodeSelector: *nodeSelector diff --git a/charts/gitops-runtime/values.yaml b/charts/gitops-runtime/values.yaml index 98a279a7..8c2e742d 100644 --- a/charts/gitops-runtime/values.yaml +++ b/charts/gitops-runtime/values.yaml @@ -197,6 +197,7 @@ global: imageRegistry: "" event-reporters: + replicaCount: 2 image: registry: quay.io repository: codefresh/dev/cf-argocd-extras @@ -324,6 +325,7 @@ argo-cd: # Argo Events #----------------------------------------------------------------------------------------------------------------------- argo-events: + enabled: false fullnameOverride: argo-events crds: install: false From 962b1ae88f1e21866c1dacd153ca95cc1a99a3fa Mon Sep 17 00:00:00 2001 From: Mikhail Klimko Date: Mon, 22 Sep 2025 20:03:20 +0300 Subject: [PATCH 10/37] refactor cf-argocd-extras --- .../templates/argo-api-gateway/_env.yaml | 4 +- .../resources-reporter/_env.yaml | 4 +- .../runtime-reporter/_env.yaml | 4 +- .../templates/hooks/pre-install/_env.yaml | 2 +- .../tests/argo-api-gateway_test.yaml | 148 ++ ...o-projects-templates-integration_test.yaml | 15 - .../gitops-runtime/tests/custom-ca_test.yaml | 125 -- .../tests/event-reporters-sensors_test.yaml | 311 ---- .../tests/event-reporters_test.yaml | 155 ++ .../tests/external_argo_rollouts_test.yaml | 88 -- .../tests/external_argocd_test.yaml | 1250 ++++++++--------- .../tests/global_constraints_test.yaml | 174 +-- .../tests/rollouts-enabled-disabled_test.yaml | 26 - .../workflows-enabled-disabled_test.yaml | 35 - 14 files changed, 942 insertions(+), 1399 deletions(-) create mode 100644 charts/gitops-runtime/tests/argo-api-gateway_test.yaml delete mode 100644 charts/gitops-runtime/tests/event-reporters-sensors_test.yaml create mode 100644 charts/gitops-runtime/tests/event-reporters_test.yaml delete mode 100644 charts/gitops-runtime/tests/external_argo_rollouts_test.yaml delete mode 100644 charts/gitops-runtime/tests/rollouts-enabled-disabled_test.yaml diff --git a/charts/gitops-runtime/templates/argo-api-gateway/_env.yaml b/charts/gitops-runtime/templates/argo-api-gateway/_env.yaml index e7c02dad..aaf85cfc 100644 --- a/charts/gitops-runtime/templates/argo-api-gateway/_env.yaml +++ b/charts/gitops-runtime/templates/argo-api-gateway/_env.yaml @@ -13,9 +13,7 @@ ARGO_CD_TOKEN_SECRET_KEY: "token" {{- end }} {{- end }} -{{- with (index .Values "global" "external-argo-cd" "server" "rootpath") }} -ARGOCD_SERVER_ROOTPATH: {{ . }} -{{- end }} +ARGOCD_SERVER_ROOTPATH: {{ dig "server" "rootpath" "/" (index .Values "global" "external-argo-cd") | quote }} {{- if or .Values.global.codefresh.tls.caCerts.secret.create (and .Values.global.codefresh.tls.caCerts.secretKeyRef.key .Values.global.codefresh.tls.caCerts.secretKeyRef.name) }} {{- $secretKey := .Values.global.codefresh.tls.caCerts.secret.create | ternary (default "ca-bundle.crt" .Values.global.codefresh.tls.caCerts.secret.key) .Values.global.codefresh.tls.caCerts.secretKeyRef.key }} diff --git a/charts/gitops-runtime/templates/event-reporters/resources-reporter/_env.yaml b/charts/gitops-runtime/templates/event-reporters/resources-reporter/_env.yaml index 44819c6b..e64a3014 100644 --- a/charts/gitops-runtime/templates/event-reporters/resources-reporter/_env.yaml +++ b/charts/gitops-runtime/templates/event-reporters/resources-reporter/_env.yaml @@ -13,9 +13,7 @@ ARGO_CD_TOKEN_SECRET_KEY: "token" {{- end }} {{- end }} -{{- with (index .Values "global" "external-argo-cd" "server" "rootpath") }} -ARGOCD_SERVER_ROOTPATH: {{ . }} -{{- end }} +ARGOCD_SERVER_ROOTPATH: {{ dig "server" "rootpath" "/" (index .Values "global" "external-argo-cd") | quote }} {{- if or .Values.global.codefresh.tls.caCerts.secret.create (and .Values.global.codefresh.tls.caCerts.secretKeyRef.key .Values.global.codefresh.tls.caCerts.secretKeyRef.name) }} {{- $secretKey := .Values.global.codefresh.tls.caCerts.secret.create | ternary (default "ca-bundle.crt" .Values.global.codefresh.tls.caCerts.secret.key) .Values.global.codefresh.tls.caCerts.secretKeyRef.key }} diff --git a/charts/gitops-runtime/templates/event-reporters/runtime-reporter/_env.yaml b/charts/gitops-runtime/templates/event-reporters/runtime-reporter/_env.yaml index 2218f543..8fdf7f2d 100644 --- a/charts/gitops-runtime/templates/event-reporters/runtime-reporter/_env.yaml +++ b/charts/gitops-runtime/templates/event-reporters/runtime-reporter/_env.yaml @@ -13,9 +13,7 @@ ARGO_CD_TOKEN_SECRET_KEY: "token" {{- end }} {{- end }} -{{- with (index .Values "global" "external-argo-cd" "server" "rootpath") }} -ARGOCD_SERVER_ROOTPATH: {{ . }} -{{- end }} +ARGOCD_SERVER_ROOTPATH: {{ dig "server" "rootpath" "/" (index .Values "global" "external-argo-cd") | quote }} {{- if or .Values.global.codefresh.tls.caCerts.secret.create (and .Values.global.codefresh.tls.caCerts.secretKeyRef.key .Values.global.codefresh.tls.caCerts.secretKeyRef.name) }} {{- $secretKey := .Values.global.codefresh.tls.caCerts.secret.create | ternary (default "ca-bundle.crt" .Values.global.codefresh.tls.caCerts.secret.key) .Values.global.codefresh.tls.caCerts.secretKeyRef.key }} diff --git a/charts/gitops-runtime/templates/hooks/pre-install/_env.yaml b/charts/gitops-runtime/templates/hooks/pre-install/_env.yaml index 5a629e03..92a6e3dd 100644 --- a/charts/gitops-runtime/templates/hooks/pre-install/_env.yaml +++ b/charts/gitops-runtime/templates/hooks/pre-install/_env.yaml @@ -15,7 +15,7 @@ NAMESPACE: {{- define "installer.validate-values.environment-variables.defaults" -}} ARGOCD_CHECK_VERSION: {{ not (get .Values "argo-cd").enabled | quote }} ARGOCD_LABELS: "{{ range $k, $v := .Values.installer.argoCdVersionCheck.argoServerLabels }}{{ $k }}={{ $v }},{{ end }}" -ARGOCD_ROOT_PATH: {{ dig "external-argo-cd" "server" "rootpath" "/" dict (get .Values "global") }} +ARGOCD_SERVER_ROOTPATH: {{ dig "server" "rootpath" "/" (index .Values "global" "external-argo-cd") | quote }} ARGOCD_VERSION_PATH: "/api/version" CHART_VERSION: {{ .Chart.Version }} NAMESPACE: diff --git a/charts/gitops-runtime/tests/argo-api-gateway_test.yaml b/charts/gitops-runtime/tests/argo-api-gateway_test.yaml new file mode 100644 index 00000000..6d23efa2 --- /dev/null +++ b/charts/gitops-runtime/tests/argo-api-gateway_test.yaml @@ -0,0 +1,148 @@ +# yaml-language-server: $schema=https://raw.githubusercontent.com/helm-unittest/helm-unittest/main/schema/helm-testsuite.json +suite: argo-api-gateway tests +templates: + - argo-api-gateway/** +tests: + - it: Argo Api Gateway ConfigMap should have valid data + template: argo-api-gateway/configmap.yaml + values: + - ./values/mandatory-values-ingress.yaml + asserts: + - equal: + path: data["argocd.server"] + value: argo-cd-server:80 + - equal: + path: data["redis.server"] + value: argo-cd-redis:6379 + - equal: + path: data["repo.server"] + value: argo-cd-repo-server:8081 + + - it: Argo Api Gateway Deployment should have valid matchLabel selectors + template: argo-api-gateway/deployment.yaml + values: + - ./values/mandatory-values-ingress.yaml + asserts: + - equal: + path: spec.selector.matchLabels + value: + app.kubernetes.io/name: argo-api-gateway + app.kubernetes.io/instance: RELEASE-NAME + - equal: + path: spec.template.metadata.labels + value: + app.kubernetes.io/name: argo-api-gateway + app.kubernetes.io/instance: RELEASE-NAME + + - it: Argo Api Gateway Service should have valid matchLabel selectors + template: argo-api-gateway/service.yaml + values: + - ./values/mandatory-values-ingress.yaml + asserts: + - equal: + path: spec.selector + value: + app.kubernetes.io/name: argo-api-gateway + app.kubernetes.io/instance: RELEASE-NAME + + - it: Argo Api Gateway should be deployed with forked ArgoCD + template: argo-api-gateway/deployment.yaml + values: + - ./values/mandatory-values-ingress.yaml + asserts: + - hasDocuments: + count: 1 + - isKind: + of: Deployment + - equal: + path: metadata.name + value: argo-api-gateway + + - it: Argo Api Gateway should be deployed with external OSS ArgoCD + template: argo-api-gateway/deployment.yaml + values: + - ./values/mandatory-values-ingress.yaml + - ./values/external-argocd-values.yaml + asserts: + - hasDocuments: + count: 1 + - isKind: + of: Deployment + - equal: + path: metadata.name + value: argo-api-gateway + + - it: Argo Api Gateway ConfigMap should have valid redis-ha url + template: argo-api-gateway/configmap.yaml + values: + - ./values/mandatory-values-ingress.yaml + set: + argo-cd: + redis-ha: + enabled: true + asserts: + - equal: + path: data["redis.server"] + value: RELEASE-NAME-redis-ha-haproxy:6379 + + - it: Argo Api Gateway should have CODEFRESH_SSL_CERT_PATH env var when .Values.global.codefresh.tls.caCerts.secret.create is true + template: argo-api-gateway/deployment.yaml + values: + - ./values/mandatory-values-ingress.yaml + set: + global: + codefresh: + tls: + caCerts: + secret: + create: true + key: ca-bundle.crt + content: | + -----BEGIN CERTIFICATE----- + MIID... + -----END CERTIFICATE----- + asserts: + - equal: + path: spec.template.spec.containers[0].env[?(@.name == 'CODEFRESH_SSL_CERT_PATH')].value + value: /app/config/codefresh-tls-certs/ca-bundle.crt + - contains: + path: spec.template.spec.volumes + content: + name: codefresh-tls-certs + secret: + secretName: codefresh-tls-certs + - contains: + path: spec.template.spec.containers[0].volumeMounts + content: + name: codefresh-tls-certs + mountPath: /app/config/codefresh-tls-certs + readOnly: true + + - it: Argo Api Gateway should have CODEFRESH_SSL_CERT_PATH env var when .Values.global.codefresh.tls.caCerts.secretKeyRef is set + template: argo-api-gateway/deployment.yaml + values: + - ./values/mandatory-values-ingress.yaml + set: + global: + codefresh: + tls: + caCerts: + secretKeyRef: + name: my-codefresh-tls-certs + key: my-ca-bundle.crt + asserts: + - equal: + path: spec.template.spec.containers[0].env[?(@.name == 'CODEFRESH_SSL_CERT_PATH')].value + value: /app/config/codefresh-tls-certs/my-ca-bundle.crt + - contains: + path: spec.template.spec.volumes + content: + name: codefresh-tls-certs + secret: + secretName: my-codefresh-tls-certs + - contains: + path: spec.template.spec.containers[0].volumeMounts + content: + name: codefresh-tls-certs + mountPath: /app/config/codefresh-tls-certs + readOnly: true diff --git a/charts/gitops-runtime/tests/argo-projects-templates-integration_test.yaml b/charts/gitops-runtime/tests/argo-projects-templates-integration_test.yaml index 7b79c4fc..7e315693 100644 --- a/charts/gitops-runtime/tests/argo-projects-templates-integration_test.yaml +++ b/charts/gitops-runtime/tests/argo-projects-templates-integration_test.yaml @@ -105,18 +105,3 @@ tests: - equal: path: data.argoWorkflowsUrl value: https://argo-test-server:2746 -# ------------------------------------------------------------------------------------------ -# Argo rollouts -# Affected templates - rollouts reporter clusterrolebinding -# ------------------------------------------------------------------------------------------ -- it: test rollout reporter ClusterRoleBinding to argo rollouts role - template: 'event-reporters/rollout-reporter/clusterrolebinding.yaml' - values: - - ./values/mandatory-values.yaml - set: - argo-rollouts.enabled: true - argo-rollouts.fullnameOverride: rollouts-test - asserts: - - equal: - path: roleRef.name - value: rollouts-test diff --git a/charts/gitops-runtime/tests/custom-ca_test.yaml b/charts/gitops-runtime/tests/custom-ca_test.yaml index b7b2cab3..5929e4b5 100644 --- a/charts/gitops-runtime/tests/custom-ca_test.yaml +++ b/charts/gitops-runtime/tests/custom-ca_test.yaml @@ -4,8 +4,6 @@ templates: - tls-custom-ca/codefresh-tls-certs.yaml - tls-custom-ca/workflow-pipelines-git-webhooks.yaml - app-proxy/deployment.yaml - - event-reporters/workflow-reporter/sensor.yaml - - event-reporters/rollout-reporter/sensor.yaml - hooks/pre-uninstall/delete-runtime-from-platform.yaml - gitops-operator/* - _components/gitops-operator/* @@ -213,129 +211,6 @@ tests: name: SSL_CERT_FILE value: /app/config/codefresh-tls-certs/ca-bundle.crt -- it: rollout reporter sensor - check chart created secret with default key - template: event-reporters/rollout-reporter/sensor.yaml - values: - - ./values/mandatory-values.yaml - set: - global.codefresh.tls.caCerts.secret.annotations.test: 'test' - global.codefresh.tls.caCerts.secret.create: true - global.codefresh.tls.caCerts.secret.content: | - -----BEGIN CERTIFICATE----- - ... encoded certificate data here ... - -----END CERTIFICATE----- - asserts: - - equal: - path: spec.triggers[0].template.http.tls - value: - caCertSecret: - name: codefresh-tls-certs - key: ca-bundle.crt - -- it: workflow reporter sensor - check chart created secret with default key - template: event-reporters/workflow-reporter/sensor.yaml - values: - - ./values/mandatory-values.yaml - set: - global.codefresh.tls.caCerts.secret.annotations.test: 'test' - global.codefresh.tls.caCerts.secret.create: true - global.codefresh.tls.caCerts.secret.content: | - -----BEGIN CERTIFICATE----- - ... encoded certificate data here ... - -----END CERTIFICATE----- - asserts: - - equal: - path: spec.triggers[0].template.http.tls - value: - caCertSecret: - name: codefresh-tls-certs - key: ca-bundle.crt - -- it: rollout reporter sensor - secretKeyRef - template: event-reporters/rollout-reporter/sensor.yaml - values: - - ./values/mandatory-values.yaml - set: - global.codefresh.tls.caCerts.secretKeyRef.name: my-secret - global.codefresh.tls.caCerts.secretKeyRef.key: my-key - asserts: - - equal: - path: spec.triggers[0].template.http.tls - value: - caCertSecret: - name: my-secret - key: my-key - -- it: workflow reporter sensor - secretKeyRef - template: event-reporters/workflow-reporter/sensor.yaml - values: - - ./values/mandatory-values.yaml - set: - global.codefresh.tls.caCerts.secretKeyRef.name: my-secret - global.codefresh.tls.caCerts.secretKeyRef.key: my-key - asserts: - - equal: - path: spec.triggers[0].template.http.tls - value: - caCertSecret: - name: my-secret - key: my-key - -- it: rollout reporter sensor - check chart created secret with custom key - template: event-reporters/rollout-reporter/sensor.yaml - values: - - ./values/mandatory-values.yaml - set: - global.codefresh.tls.caCerts.secret.annotations.test: 'test' - global.codefresh.tls.caCerts.secret.create: true - global.codefresh.tls.caCerts.secret.key: my-key - global.codefresh.tls.caCerts.secret.content: | - -----BEGIN CERTIFICATE----- - ... encoded certificate data here ... - -----END CERTIFICATE----- - asserts: - - equal: - path: spec.triggers[0].template.http.tls - value: - caCertSecret: - name: codefresh-tls-certs - key: my-key - -- it: workflow reporter sensor - check chart created secret with custom key - template: event-reporters/workflow-reporter/sensor.yaml - values: - - ./values/mandatory-values.yaml - set: - global.codefresh.tls.caCerts.secret.annotations.test: 'test' - global.codefresh.tls.caCerts.secret.create: true - global.codefresh.tls.caCerts.secret.key: my-key - global.codefresh.tls.caCerts.secret.content: | - -----BEGIN CERTIFICATE----- - ... encoded certificate data here ... - -----END CERTIFICATE----- - asserts: - - equal: - path: spec.triggers[0].template.http.tls - value: - caCertSecret: - name: codefresh-tls-certs - key: my-key - -- it: rollout reporter sensor - no tls - template: event-reporters/rollout-reporter/sensor.yaml - values: - - ./values/mandatory-values.yaml - asserts: - - notExists: - path: spec.triggers[0].template.http.tls - -- it: workflow reporter sensor - no tls - template: event-reporters/workflow-reporter/sensor.yaml - values: - - ./values/mandatory-values.yaml - asserts: - - notExists: - path: spec.triggers[0].template.http.tls # -------------------------------------------------------- # workflowPipelinesGitWebhooks # -------------------------------------------------------- diff --git a/charts/gitops-runtime/tests/event-reporters-sensors_test.yaml b/charts/gitops-runtime/tests/event-reporters-sensors_test.yaml deleted file mode 100644 index 23bb0542..00000000 --- a/charts/gitops-runtime/tests/event-reporters-sensors_test.yaml +++ /dev/null @@ -1,311 +0,0 @@ -suite: Test on event reporters sensors -templates: - - event-reporters/workflow-reporter/sensor.yaml - - event-reporters/rollout-reporter/sensor.yaml -tests: - - it: Setting api/events url works - workflow reporter - template: 'event-reporters/workflow-reporter/sensor.yaml' - values: - - './values/mandatory-values.yaml' - set: - global.codefresh.url: "https://my.platform" - global.codefresh.apiEventsPath: "/api-events" - asserts: - - equal: - path: spec.triggers[0].template.http.url - value: https://my.platform/api-events - - - it: Setting api/events url works - rollout reporter - template: 'event-reporters/rollout-reporter/sensor.yaml' - values: - - './values/mandatory-values.yaml' - set: - global.codefresh.url: "https://my.platform" - global.codefresh.apiEventsPath: "/api-events" - asserts: - - equal: - path: spec.triggers[0].template.http.url - value: https://my.platform/api-events - - equal: - path: spec.triggers[1].template.http.url - value: https://my.platform/api-events - - equal: - path: spec.triggers[2].template.http.url - value: https://my.platform/api-events - - - it: Setting various container specs - workflow reporter - template: 'event-reporters/workflow-reporter/sensor.yaml' - values: - - './values/mandatory-values.yaml' - set: - event-reporters.workflow.sensor: - replicas: 2 - resources: - requests: - memory: 1Gi - env: - DEBUG_LOG: "true" - tolerations: - - key: "example-key" - operator: "Exists" - effect: "NoSchedule" - nodeSelector: - region: east - type: user-node - affinity: - requiredDuringSchedulingIgnoredDuringExecution: - nodeSelectorTerms: - - matchExpressions: - - key: topology.kubernetes.io/zone - operator: In - values: - - antarctica-east1 - - antarctica-west1 - asserts: - - equal: - path: spec.replicas - value: 2 - - equal: - path: spec.template.container.env - value: - - name: DEBUG_LOG - value: "true" - - equal: - path: spec.template.container.resources - value: - requests: - memory: 1Gi - - equal: - path: spec.template.tolerations - value: - - key: "example-key" - operator: "Exists" - effect: "NoSchedule" - - equal: - path: spec.template.nodeSelector - value: - region: east - type: user-node - - - it: Setting various container specs - rollout reporter - template: 'event-reporters/rollout-reporter/sensor.yaml' - values: - - './values/mandatory-values.yaml' - set: - event-reporters.rollout.sensor: - replicas: 2 - resources: - requests: - memory: 1Gi - env: - DEBUG_LOG: "true" - tolerations: - - key: "example-key" - operator: "Exists" - effect: "NoSchedule" - nodeSelector: - region: east - type: user-node - affinity: - requiredDuringSchedulingIgnoredDuringExecution: - nodeSelectorTerms: - - matchExpressions: - - key: topology.kubernetes.io/zone - operator: In - values: - - antarctica-east1 - - antarctica-west1 - asserts: - - equal: - path: spec.replicas - value: 2 - - equal: - path: spec.template.container.env - value: - - name: DEBUG_LOG - value: "true" - - equal: - path: spec.template.container.resources - value: - requests: - memory: 1Gi - - equal: - path: spec.template.tolerations - value: - - key: "example-key" - operator: "Exists" - effect: "NoSchedule" - - equal: - path: spec.template.nodeSelector - value: - region: east - type: user-node - - - it: Logging without interval works - workflow reporter - template: 'event-reporters/workflow-reporter/sensor.yaml' - values: - - './values/mandatory-values.yaml' - set: - event-reporters.workflow.sensor: - logging: - enabled: true - asserts: - - contains: - path: spec.triggers - content: - template: - log: {} - name: log-trigger - - - it: Logging without interval works - rollout reporter - template: 'event-reporters/rollout-reporter/sensor.yaml' - values: - - './values/mandatory-values.yaml' - set: - event-reporters.rollout.sensor: - logging: - enabled: true - asserts: - - contains: - path: spec.triggers - content: - template: - log: {} - name: log-trigger - - - it: Logging with interval works - workflow reporter - template: 'event-reporters/workflow-reporter/sensor.yaml' - values: - - './values/mandatory-values.yaml' - set: - event-reporters.workflow.sensor: - logging: - intervalSeconds: 60 - enabled: true - asserts: - - contains: - path: spec.triggers - content: - template: - log: - intervalSeconds: 60 - name: log-trigger - - - it: HTTP trigger contains retries if set - workflow reporter - template: 'event-reporters/workflow-reporter/sensor.yaml' - values: - - './values/mandatory-values.yaml' - set: - event-reporters.workflow.sensor: - retryStrategy: - steps: 3 - duration: 1 - factor: 1.2 - jitter: 3 - asserts: - - equal: - path: spec.triggers[0].retryStrategy - value: - steps: 3 - duration: 1 - factor: 1.2 - jitter: 3 - - - it: HTTP trigger contains retries if set - rollout reporter - template: 'event-reporters/rollout-reporter/sensor.yaml' - values: - - './values/mandatory-values.yaml' - set: - event-reporters.rollout.sensor: - retryStrategy: - steps: 3 - duration: 1 - factor: 1.2 - jitter: 3 - asserts: - - equal: - path: spec.triggers[0].retryStrategy - value: - steps: 3 - duration: 1 - factor: 1.2 - jitter: 3 - - equal: - path: spec.triggers[1].retryStrategy - value: - steps: 3 - duration: 1 - factor: 1.2 - jitter: 3 - - equal: - path: spec.triggers[2].retryStrategy - value: - steps: 3 - duration: 1 - factor: 1.2 - jitter: 3 - - - it: HTTP trigger contains policy if set - workflow reporter - template: 'event-reporters/workflow-reporter/sensor.yaml' - values: - - './values/mandatory-values.yaml' - set: - event-reporters.workflow.sensor: - policy: - status: - allow: - - 200 - asserts: - - equal: - path: spec.triggers[0].policy - value: - status: - allow: - - 200 - - - it: HTTP trigger contains atLeastOnce if unset - rollout reporter - template: 'event-reporters/rollout-reporter/sensor.yaml' - values: - - './values/mandatory-values.yaml' - set: - event-reporters.rollout.sensor: - atLeastOnce: false - asserts: - - equal: - path: spec.triggers[0].atLeastOnce - value: false - - - - it: HTTP trigger contains atLeastOnce if unset - workflow reporter - template: 'event-reporters/workflow-reporter/sensor.yaml' - values: - - './values/mandatory-values.yaml' - set: - event-reporters.workflow.sensor: - atLeastOnce: false - asserts: - - equal: - path: spec.triggers[0].atLeastOnce - value: false - - - it: uses the correct eventBusName if type is jetstream - rollout reporter - template: 'event-reporters/rollout-reporter/sensor.yaml' - values: - - './values/mandatory-values.yaml' - set: - global.runtime.eventBus.type: jetstream - asserts: - - equal: - path: spec.eventBusName - value: codefresh-eventbus-jetstream - - - it: uses the correct eventBusName if type is jetstream - workflow reporter - template: 'event-reporters/workflow-reporter/sensor.yaml' - values: - - './values/mandatory-values.yaml' - set: - global.runtime.eventBus.type: jetstream - asserts: - - equal: - path: spec.eventBusName - value: codefresh-eventbus-jetstream diff --git a/charts/gitops-runtime/tests/event-reporters_test.yaml b/charts/gitops-runtime/tests/event-reporters_test.yaml new file mode 100644 index 00000000..45d05edd --- /dev/null +++ b/charts/gitops-runtime/tests/event-reporters_test.yaml @@ -0,0 +1,155 @@ +# yaml-language-server: $schema=https://raw.githubusercontent.com/helm-unittest/helm-unittest/main/schema/helm-testsuite.json +suite: argo-api-gateway tests +templates: + - event-reporters/**/*.yaml +tests: + - it: Runtime Reporter should be deployed with forked ArgoCD + template: event-reporters/runtime-reporter/deployment.yaml + values: + - ./values/mandatory-values-ingress.yaml + asserts: + - hasDocuments: + count: 1 + - isKind: + of: Deployment + - equal: + path: metadata.name + value: runtime-reporter + + - it: Runtime Reporter should be deployed with external OSS ArgoCD + template: event-reporters/runtime-reporter/deployment.yaml + values: + - ./values/mandatory-values-ingress.yaml + - ./values/external-argocd-values.yaml + asserts: + - hasDocuments: + count: 1 + - isKind: + of: Deployment + - equal: + path: metadata.name + value: runtime-reporter + + - it: Runtime Reporter ConfigMap should have valid redis-ha url + template: event-reporters/runtime-reporter/configmap.yaml + values: + - ./values/mandatory-values-ingress.yaml + set: + argo-cd: + redis-ha: + enabled: true + asserts: + - equal: + path: data["redis.server"] + value: RELEASE-NAME-redis-ha-haproxy:6379 + + - it: Runtime Reporter should have CODEFRESH_SSL_CERT_PATH env var when .Values.global.codefresh.tls.caCerts.secret.create is true + template: event-reporters/runtime-reporter/deployment.yaml + values: + - ./values/mandatory-values-ingress.yaml + set: + global: + codefresh: + tls: + caCerts: + secret: + create: true + key: ca-bundle.crt + content: | + -----BEGIN CERTIFICATE----- + MIID... + -----END CERTIFICATE----- + asserts: + - equal: + path: spec.template.spec.containers[0].env[?(@.name == 'CODEFRESH_SSL_CERT_PATH')].value + value: /app/config/codefresh-tls-certs/ca-bundle.crt + - contains: + path: spec.template.spec.volumes + content: + name: codefresh-tls-certs + secret: + secretName: codefresh-tls-certs + - contains: + path: spec.template.spec.containers[0].volumeMounts + content: + name: codefresh-tls-certs + mountPath: /app/config/codefresh-tls-certs + readOnly: true + + - it: Runtime Reporter should have CODEFRESH_SSL_CERT_PATH env var when .Values.global.codefresh.tls.caCerts.secretKeyRef is set + template: event-reporters/runtime-reporter/deployment.yaml + values: + - ./values/mandatory-values-ingress.yaml + set: + global: + codefresh: + tls: + caCerts: + secretKeyRef: + name: my-codefresh-tls-certs + key: my-ca-bundle.crt + asserts: + - equal: + path: spec.template.spec.containers[0].env[?(@.name == 'CODEFRESH_SSL_CERT_PATH')].value + value: /app/config/codefresh-tls-certs/my-ca-bundle.crt + - contains: + path: spec.template.spec.volumes + content: + name: codefresh-tls-certs + secret: + secretName: my-codefresh-tls-certs + - contains: + path: spec.template.spec.containers[0].volumeMounts + content: + name: codefresh-tls-certs + mountPath: /app/config/codefresh-tls-certs + readOnly: true + + - it: Runtime Reporter should use local env over global Values.event-reporters.env + template: event-reporters/runtime-reporter/deployment.yaml + values: + - ./values/mandatory-values-ingress.yaml + set: + global: + event-reporters: + env: + FOO: outer + event-reporters: + runtime-reporter: + env: + FOO: inner + BAR: inner + asserts: + - equal: + path: spec.template.spec.containers[0].env[?(@.name == 'FOO')].value + value: inner + - equal: + path: spec.template.spec.containers[0].env[?(@.name == 'BAR')].value + value: inner + + - it: Runtime Reporter should use local values over global Values.event-reporters + template: event-reporters/runtime-reporter/deployment.yaml + values: + - ./values/mandatory-values-ingress.yaml + set: + global: + event-reporters: + resources: + limits: + cpu: 100m + memory: 128Mi + requests: + cpu: 100m + memory: 128Mi + event-reporters: + runtime-reporter: + resources: + limits: + cpu: 200m + memory: 256Mi + asserts: + - equal: + path: spec.template.spec.containers[0].resources.limits + value: + cpu: 200m + memory: 256Mi diff --git a/charts/gitops-runtime/tests/external_argo_rollouts_test.yaml b/charts/gitops-runtime/tests/external_argo_rollouts_test.yaml deleted file mode 100644 index 9ac49ae0..00000000 --- a/charts/gitops-runtime/tests/external_argo_rollouts_test.yaml +++ /dev/null @@ -1,88 +0,0 @@ -# yaml-language-server: $schema=https://raw.githubusercontent.com/helm-unittest/helm-unittest/main/schema/helm-testsuite.json -suite: Test External Argo Rolouts with GitOps Runtime -templates: - - event-reporters/rollout-reporter/* -tests: - - it: Should not deploy rollout-reporter if argo-rollouts disabled - set: - argo-rollouts: - enabled: false - asserts: - - containsDocument: - apiVersion: v1 - kind: ServiceAccount - name: rollout-reporter - template: event-reporters/rollout-reporter/serviceaccount.yaml - not: true - - containsDocument: - apiVersion: argoproj.io/v1alpha1 - kind: Sensor - name: rollout-reporter - template: event-reporters/rollout-reporter/sensor.yaml - not: true - - containsDocument: - apiVersion: argoproj.io/v1alpha1 - kind: EventSource - name: rollout-reporter - template: event-reporters/rollout-reporter/eventsource.yaml - not: true - - containsDocument: - apiVersion: rbac.authorization.k8s.io/v1 - kind: Role - name: rollout-reporter-sa - template: event-reporters/rollout-reporter/rbac.yaml - not: true - - containsDocument: - apiVersion: rbac.authorization.k8s.io/v1 - kind: RoleBinding - name: rollout-reporter-sa - template: event-reporters/rollout-reporter/rbac.yaml - not: true - - containsDocument: - apiVersion: rbac.authorization.k8s.io/v1 - kind: ClusterRoleBinding - name: codefresh-rollouts-reporter - template: event-reporters/rollout-reporter/clusterrolebinding.yaml - not: true - - - it: Should deploy rollout-reporter if argo-rollouts disabled AND .global.external-argo-rollouts.rollout-reporter.enabled is true - set: - argo-rollouts: - enabled: false - global: - external-argo-rollouts: - rollout-reporter: - enabled: true - asserts: - - containsDocument: - apiVersion: v1 - kind: ServiceAccount - name: rollout-reporter - template: event-reporters/rollout-reporter/serviceaccount.yaml - - containsDocument: - apiVersion: argoproj.io/v1alpha1 - kind: Sensor - name: rollout-reporter - template: event-reporters/rollout-reporter/sensor.yaml - - containsDocument: - apiVersion: argoproj.io/v1alpha1 - kind: EventSource - name: rollout-reporter - template: event-reporters/rollout-reporter/eventsource.yaml - - containsDocument: - apiVersion: rbac.authorization.k8s.io/v1 - kind: Role - name: rollout-reporter-sa - template: event-reporters/rollout-reporter/rbac.yaml - documentIndex: 0 - - containsDocument: - apiVersion: rbac.authorization.k8s.io/v1 - kind: RoleBinding - name: rollout-reporter-sa - template: event-reporters/rollout-reporter/rbac.yaml - documentIndex: 1 - - containsDocument: - apiVersion: rbac.authorization.k8s.io/v1 - kind: ClusterRoleBinding - name: codefresh-rollouts-reporter - template: event-reporters/rollout-reporter/clusterrolebinding.yaml diff --git a/charts/gitops-runtime/tests/external_argocd_test.yaml b/charts/gitops-runtime/tests/external_argocd_test.yaml index 1570b4b4..a69f8eb1 100644 --- a/charts/gitops-runtime/tests/external_argocd_test.yaml +++ b/charts/gitops-runtime/tests/external_argocd_test.yaml @@ -9,631 +9,631 @@ templates: - app-proxy/external-argocd-token.yaml - codefresh-cm.yaml tests: - # - it: app-proxy ConfigMap should have valid ArgoCd URL - # values: - # - ./values/mandatory-values-ingress.yaml - # - ./values/external-argocd-values.yaml - # template: app-proxy/config.yaml - # asserts: - # - equal: - # path: data.argoCdUrl - # value: http://my-argocd-server - - # - it: app-proxy ConfigMap should have valid ArgoCd Username - # values: - # - ./values/mandatory-values-ingress.yaml - # - ./values/external-argocd-values.yaml - # template: app-proxy/config.yaml - # asserts: - # - equal: - # path: data.argoCdUsername - # value: admin - - # - it: app-proxy ConfigMap should have valid ArgoCd Username with override - # values: - # - ./values/mandatory-values-ingress.yaml - # - ./values/external-argocd-values.yaml - # template: app-proxy/config.yaml - # set: - # global.external-argo-cd.auth.username: adminoverride - # asserts: - # - equal: - # path: data.argoCdUsername - # value: adminoverride - - # - it: app-proxy ConfigMap should have isExternalArgoCD key set to true - # values: - # - ./values/mandatory-values-ingress.yaml - # - ./values/external-argocd-values.yaml - # template: app-proxy/config.yaml - # set: - # global.external-argo-cd.auth.username: adminoverride - # asserts: - # - equal: - # path: data.isExternalArgoCD - # value: "true" - - # - it: app-proxy Deployment should have valid ARGO_CD_PASSWORD env var set via passwordSecretKeyRef - # values: - # - ./values/mandatory-values-ingress.yaml - # - ./values/external-argocd-values.yaml - # template: app-proxy/deployment.yaml - # asserts: - # - contains: - # path: spec.template.spec.containers[0].env - # content: - # name: ARGO_CD_PASSWORD - # valueFrom: - # secretKeyRef: - # key: password - # name: argocd-initial-admin-secret - - # - it: app-proxy Deploymeny should have valid ARGO_CD_PASSWORD env var set via plaintext password - # values: - # - ./values/mandatory-values-ingress.yaml - # - ./values/external-argocd-values.yaml - # template: app-proxy/deployment.yaml - # set: - # global.external-argo-cd.auth.passwordSecretKeyRef: [] - # global.external-argo-cd.auth.password: token - # asserts: - # - contains: - # path: spec.template.spec.containers[0].env - # content: - # name: ARGO_CD_PASSWORD - # valueFrom: - # secretKeyRef: - # key: token - # name: gitops-runtime-argo-cd-password - - # - it: app-proxy Deployment should have valid ARGO_CD_USERNAME env var set via plaintext username - # values: - # - ./values/mandatory-values-ingress.yaml - # - ./values/external-argocd-values.yaml - # template: app-proxy/deployment.yaml - # set: - # global.external-argo-cd.auth.username: adminoverride - # asserts: - # - contains: - # path: spec.template.spec.containers[0].env - # content: - # name: ARGO_CD_USERNAME - # value: adminoverride - - # - it: app-proxy Deployment should have valid ARGO_CD_TOKEN env var set via tokenSecretKeyRef - # values: - # - ./values/mandatory-values-ingress.yaml - # - ./values/external-argocd-values.yaml - # template: app-proxy/deployment.yaml - # set: - # global.external-argo-cd.auth.type: token - # global.external-argo-cd.auth.tokenSecretKeyRef.name: my-argocd-secret - # global.external-argo-cd.auth.tokenSecretKeyRef.key: my-token - # asserts: - # - contains: - # path: spec.template.spec.containers[0].env - # content: - # name: ARGO_CD_TOKEN - # valueFrom: - # secretKeyRef: - # key: my-token - # name: my-argocd-secret - - # - it: app-proxy Deployment should have valid ARGO_CD_TOKEN env var set via plaintext token - # values: - # - ./values/mandatory-values-ingress.yaml - # - ./values/external-argocd-values.yaml - # template: app-proxy/deployment.yaml - # set: - # global.external-argo-cd.auth.type: token - # global.external-argo-cd.auth.token: "plaintexttoken" - # asserts: - # - contains: - # path: spec.template.spec.containers[0].env - # content: - # name: ARGO_CD_TOKEN - # valueFrom: - # secretKeyRef: - # key: token - # name: gitops-runtime-argo-cd-token - - # - it: gitops-operator Deployment should have valid ARGO_CD_TOKEN_SECRET_NAME env var set via tokenSecretKeyRef - # values: - # - ./values/mandatory-values.yaml - # - ./values/external-argocd-values.yaml - # template: gitops-operator/deployment.yaml - # set: - # global.external-argo-cd.auth.type: token - # global.external-argo-cd.auth.tokenSecretKeyRef.name: my-argocd-token-secret - # global.external-argo-cd.auth.tokenSecretKeyRef.key: my-token - # asserts: - # - contains: - # path: spec.template.spec.containers[0].env - # content: - # name: ARGO_CD_TOKEN_SECRET_NAME - # value: my-argocd-token-secret - - # - it: gitops-operator Deployment should have valid ARGO_CD_TOKEN_SECRET_KEY env var set via tokenSecretKeyRef - # values: - # - ./values/mandatory-values-ingress.yaml - # - ./values/external-argocd-values.yaml - # template: gitops-operator/deployment.yaml - # set: - # global.external-argo-cd.auth.type: token - # global.external-argo-cd.auth.tokenSecretKeyRef.name: my-argocd-token-secret - # global.external-argo-cd.auth.tokenSecretKeyRef.key: my-token - # asserts: - # - contains: - # path: spec.template.spec.containers[0].env - # content: - # name: ARGO_CD_TOKEN_SECRET_KEY - # value: my-token - - # - it: gitops-operator Deployment should have valid ARGO_CD_TOKEN_SECRET_NAME env var set via plaintext token - # values: - # - ./values/mandatory-values-ingress.yaml - # - ./values/external-argocd-values.yaml - # template: gitops-operator/deployment.yaml - # set: - # global.external-argo-cd.auth.type: token - # global.external-argo-cd.auth.token: "plaintexttoken" - # asserts: - # - contains: - # path: spec.template.spec.containers[0].env - # content: - # name: ARGO_CD_TOKEN_SECRET_NAME - # value: gitops-runtime-argo-cd-token - - # - it: gitops-operator Deployment should have valid ARGO_CD_TOKEN_SECRET_KEY env var set via plaintext token - # values: - # - ./values/mandatory-values-ingress.yaml - # - ./values/external-argocd-values.yaml - # template: gitops-operator/deployment.yaml - # set: - # global.external-argo-cd.auth.type: token - # global.external-argo-cd.auth.token: "plaintexttoken" - # asserts: - # - contains: - # path: spec.template.spec.containers[0].env - # content: - # name: ARGO_CD_TOKEN_SECRET_KEY - # value: token - - # - it: gitops-operator Deployment should have valid default ARGO_CD_TOKEN_SECRET_NAME env var - # values: - # - ./values/mandatory-values-ingress.yaml - # - ./values/external-argocd-values.yaml - # template: gitops-operator/deployment.yaml - # asserts: - # - contains: - # path: spec.template.spec.containers[0].env - # content: - # name: ARGO_CD_TOKEN_SECRET_NAME - # value: argocd-token - - # - it: gitops-operator Deployment should have valid default ARGO_CD_TOKEN_SECRET_KEY env var - # values: - # - ./values/mandatory-values-ingress.yaml - # - ./values/external-argocd-values.yaml - # template: gitops-operator/deployment.yaml - # asserts: - # - contains: - # path: spec.template.spec.containers[0].env - # content: - # name: ARGO_CD_TOKEN_SECRET_KEY - # value: token - - # - it: gitops-operator Deployment should have valid ARGO_CD_URL env var - # values: - # - ./values/mandatory-values-ingress.yaml - # - ./values/external-argocd-values.yaml - # template: gitops-operator/deployment.yaml - # asserts: - # - contains: - # path: spec.template.spec.containers[0].env - # content: - # name: ARGO_CD_URL - # value: my-argocd-server:80 - - # - it: runtime-reporter ConfigMap should have valid ArgoCd URL - # template: event-reporters/runtime-reporter/configmap.yaml - # values: - # - ./values/mandatory-values-ingress.yaml - # - ./values/external-argocd-values.yaml - # asserts: - # - equal: - # path: data["argocd.server"] - # value: my-argocd-server:80 - - # - it: runtime-reporter ConfigMap should have valid Redis URL - # template: event-reporters/runtime-reporter/configmap.yaml - # values: - # - ./values/mandatory-values-ingress.yaml - # - ./values/external-argocd-values.yaml - # asserts: - # - equal: - # path: data["redis.server"] - # value: my-argocd-redis:6379 - - # - it: runtime-reporter ConfigMap should have valid Sources Server address - # template: event-reporters/runtime-reporter/configmap.yaml - # values: - # - ./values/mandatory-values-ingress.yaml - # - ./values/external-argocd-values.yaml - # asserts: - # - equal: - # path: data["sources.server"] - # value: http://argo-api-gateway - - # - it: runtime-reporter ConfigMap should have valid Repo Server URL - # template: event-reporters/runtime-reporter/configmap.yaml - # values: - # - ./values/mandatory-values-ingress.yaml - # - ./values/external-argocd-values.yaml - # asserts: - # - equal: - # path: data["repo.server"] - # value: my-argocd-repo-server:8081 - - # - it: runtime-reporter Deployment should have valid default ARGO_CD_TOKEN_SECRET_NAME env var - # template: event-reporters/runtime-reporter/deployment.yaml - # values: - # - ./values/mandatory-values-ingress.yaml - # - ./values/external-argocd-values.yaml - # asserts: - # - contains: - # path: spec.template.spec.containers[0].env - # content: - # name: ARGO_CD_TOKEN_SECRET_NAME - # value: argocd-token - - # - it: runtime-reporter Deployment should have valid default ARGO_CD_TOKEN_SECRET_KEY env var - # template: event-reporters/runtime-reporter/deployment.yaml - # values: - # - ./values/mandatory-values-ingress.yaml - # - ./values/external-argocd-values.yaml - # asserts: - # - contains: - # path: spec.template.spec.containers[0].env - # content: - # name: ARGO_CD_TOKEN_SECRET_KEY - # value: token - - # - it: runtime-reporter Deployment should have valid ARGO_CD_TOKEN_SECRET_NAME env var set via tokenSecretKeyRef - # template: event-reporters/runtime-reporter/deployment.yaml - # values: - # - ./values/mandatory-values-ingress.yaml - # - ./values/external-argocd-values.yaml - # set: - # global.external-argo-cd.auth.type: token - # global.external-argo-cd.auth.tokenSecretKeyRef.name: my-argocd-token-secret - # global.external-argo-cd.auth.tokenSecretKeyRef.key: my-token - # asserts: - # - contains: - # path: spec.template.spec.containers[0].env - # content: - # name: ARGO_CD_TOKEN_SECRET_NAME - # value: my-argocd-token-secret - - # - it: runtime-reporter Deployment should have valid ARGO_CD_TOKEN_SECRET_KEY env var set via tokenSecretKeyRef - # template: event-reporters/runtime-reporter/deployment.yaml - # values: - # - ./values/mandatory-values-ingress.yaml - # - ./values/external-argocd-values.yaml - # set: - # global.external-argo-cd.auth.type: token - # global.external-argo-cd.auth.tokenSecretKeyRef.name: my-argocd-token-secret - # global.external-argo-cd.auth.tokenSecretKeyRef.key: my-token - # asserts: - # - contains: - # path: spec.template.spec.containers[0].env - # content: - # name: ARGO_CD_TOKEN_SECRET_KEY - # value: my-token - - # - it: runtime-reporter Deployment should have valid ARGO_CD_TOKEN_SECRET_NAME env var set via plaintext token - # template: event-reporters/runtime-reporter/deployment.yaml - # values: - # - ./values/mandatory-values-ingress.yaml - # - ./values/external-argocd-values.yaml - # set: - # global.external-argo-cd.auth.type: token - # global.external-argo-cd.auth.token: "plaintexttoken" - # asserts: - # - contains: - # path: spec.template.spec.containers[0].env - # content: - # name: ARGO_CD_TOKEN_SECRET_NAME - # value: gitops-runtime-argo-cd-token - - # - it: runtime-reporter Deployment should have valid ARGO_CD_TOKEN_SECRET_KEY env var set via plaintext token - # template: event-reporters/runtime-reporter/deployment.yaml - # values: - # - ./values/mandatory-values-ingress.yaml - # - ./values/external-argocd-values.yaml - # set: - # global.external-argo-cd.auth.type: token - # global.external-argo-cd.auth.token: "plaintexttoken" - # asserts: - # - contains: - # path: spec.template.spec.containers[0].env - # content: - # name: ARGO_CD_TOKEN_SECRET_KEY - # value: token - - # - it: argo-api-gateway ConfigMap should have valid ArgoCd URL - # template: argo-api-gateway/configmap.yaml - # values: - # - ./values/mandatory-values-ingress.yaml - # - ./values/external-argocd-values.yaml - # asserts: - # - equal: - # path: data["argocd.server"] - # value: my-argocd-server:80 - - # - it: argo-api-gateway ConfigMap should have valid Redis URL - # template: argo-api-gateway/configmap.yaml - # values: - # - ./values/mandatory-values-ingress.yaml - # - ./values/external-argocd-values.yaml - # asserts: - # - equal: - # path: data["redis.server"] - # value: my-argocd-redis:6379 - - # - it: argo-api-gateway ConfigMap should have valid Repo Server URL - # template: argo-api-gateway/configmap.yaml - # values: - # - ./values/mandatory-values-ingress.yaml - # - ./values/external-argocd-values.yaml - # asserts: - # - equal: - # path: data["repo.server"] - # value: my-argocd-repo-server:8081 - - # - it: argo-api-gateway Deployment should have valid default ARGO_CD_TOKEN_SECRET_NAME env var - # template: argo-api-gateway/deployment.yaml - # values: - # - ./values/mandatory-values-ingress.yaml - # - ./values/external-argocd-values.yaml - # asserts: - # - contains: - # path: spec.template.spec.containers[0].env - # content: - # name: ARGO_CD_TOKEN_SECRET_NAME - # value: argocd-token - - # - it: argo-api-gateway Deployment should have valid default ARGO_CD_TOKEN_SECRET_KEY env var - # template: argo-api-gateway/deployment.yaml - # values: - # - ./values/mandatory-values-ingress.yaml - # - ./values/external-argocd-values.yaml - # asserts: - # - contains: - # path: spec.template.spec.containers[0].env - # content: - # name: ARGO_CD_TOKEN_SECRET_KEY - # value: token - - # - it: argo-api-gateway Deployment should have valid ARGO_CD_TOKEN_SECRET_NAME env var set via tokenSecretKeyRef - # template: argo-api-gateway/deployment.yaml - # values: - # - ./values/mandatory-values-ingress.yaml - # - ./values/external-argocd-values.yaml - # set: - # global.external-argo-cd.auth.type: token - # global.external-argo-cd.auth.tokenSecretKeyRef.name: my-argocd-token-secret - # global.external-argo-cd.auth.tokenSecretKeyRef.key: my-token - # asserts: - # - contains: - # path: spec.template.spec.containers[0].env - # content: - # name: ARGO_CD_TOKEN_SECRET_NAME - # value: my-argocd-token-secret - - # - it: argo-api-gateway Deployment should have valid ARGO_CD_TOKEN_SECRET_KEY env var set via tokenSecretKeyRef - # template: argo-api-gateway/deployment.yaml - # values: - # - ./values/mandatory-values-ingress.yaml - # - ./values/external-argocd-values.yaml - # set: - # global.external-argo-cd.auth.type: token - # global.external-argo-cd.auth.tokenSecretKeyRef.name: my-argocd-token-secret - # global.external-argo-cd.auth.tokenSecretKeyRef.key: my-token - # asserts: - # - contains: - # path: spec.template.spec.containers[0].env - # content: - # name: ARGO_CD_TOKEN_SECRET_KEY - # value: my-token - - # - it: argo-api-gateway Deployment should have valid ARGO_CD_TOKEN_SECRET_NAME env var set via plaintext token - # template: argo-api-gateway/deployment.yaml - # values: - # - ./values/mandatory-values-ingress.yaml - # - ./values/external-argocd-values.yaml - # set: - # global.external-argo-cd.auth.type: token - # global.external-argo-cd.auth.token: "plaintexttoken" - # asserts: - # - contains: - # path: spec.template.spec.containers[0].env - # content: - # name: ARGO_CD_TOKEN_SECRET_NAME - # value: gitops-runtime-argo-cd-token - - # - it: argo-api-gateway Deployment should have valid ARGO_CD_TOKEN_SECRET_KEY env var set via plaintext token - # template: argo-api-gateway/deployment.yaml - # values: - # - ./values/mandatory-values-ingress.yaml - # - ./values/external-argocd-values.yaml - # set: - # global.external-argo-cd.auth.type: token - # global.external-argo-cd.auth.token: "plaintexttoken" - # asserts: - # - contains: - # path: spec.template.spec.containers[0].env - # content: - # name: ARGO_CD_TOKEN_SECRET_KEY - # value: token - - # - it: should require ArgoCd password if auth.type=password is set and no password is provided - # values: - # - ./values/mandatory-values-ingress.yaml - # - ./values/external-argocd-values.yaml - # template: app-proxy/deployment.yaml - # set: - # global.external-argo-cd.auth.type: password - # global.external-argo-cd.auth.password: null - # global.external-argo-cd.auth.passwordSecretKeyRef: [] - # asserts: - # - failedTemplate: - # errorMessage: "ArgoCD is not enabled and .Values.global.external-argo-cd.auth.password or .Values.global.external-argo-cd.auth.passwordSecretKeyRef is not set" - - # - it: should require ArgoCd redis address if it's not provided - # values: - # - ./values/mandatory-values-ingress.yaml - # - ./values/external-argocd-values.yaml - # set: - # global.external-argo-cd.redis: null - # asserts: - # - failedTemplate: - # errorMessage: "ArgoCD is not enabled and .Values.global.external-argo-cd.redis is not set" - - # - it: should require ArgoCd repoServer address if it's not provided - # values: - # - ./values/mandatory-values-ingress.yaml - # - ./values/external-argocd-values.yaml - # set: - # global.external-argo-cd.repoServer: null - # asserts: - # - failedTemplate: - # errorMessage: "ArgoCD is not enabled and .Values.global.external-argo-cd.repoServer is not set" - - # - it: should required only allowed auth type for external ArgoCd - # values: - # - ./values/mandatory-values-ingress.yaml - # - ./values/external-argocd-values.yaml - # template: app-proxy/deployment.yaml - # set: - # global.external-argo-cd.auth.type: invalid - # asserts: - # - failedTemplate: - # errorMessage: "Invalid value for .Values.global.external-argo-cd.auth.type: invalid. Allowed values are: [password token]" - - # - it: runtime-reporter Deployment should have valid ARGOCD_SERVER_ROOTPATH env var - # template: event-reporters/runtime-reporter/deployment.yaml - # values: - # - ./values/mandatory-values-ingress.yaml - # - ./values/external-argocd-values.yaml - # set: - # global.external-argo-cd.server.rootpath: /argocd - # asserts: - # - contains: - # path: spec.template.spec.containers[0].env - # content: - # name: ARGOCD_SERVER_ROOTPATH - # value: /argocd - - # - it: argo-api-gateway Deployment should have valid ARGOCD_SERVER_ROOTPATH env var - # template: argo-api-gateway/deployment.yaml - # values: - # - ./values/mandatory-values-ingress.yaml - # - ./values/external-argocd-values.yaml - # set: - # global.external-argo-cd.server.rootpath: /argocd - # asserts: - # - contains: - # path: spec.template.spec.containers[0].env - # content: - # name: ARGOCD_SERVER_ROOTPATH - # value: /argocd - - # - it: app-proxy ConfigMap should have valid ArgoCD url with rootpath suffix - # values: - # - ./values/mandatory-values-ingress.yaml - # - ./values/external-argocd-values.yaml - # template: app-proxy/config.yaml - # set: - # global.external-argo-cd.server.rootpath: /argocd - # asserts: - # - equal: - # path: data.argoCdUrl - # value: http://my-argocd-server/argocd - - # - it: gitops-operator Deployment should have valid ARGO_CD_URL env var with rootpath suffix - # template: gitops-operator/deployment.yaml - # values: - # - ./values/mandatory-values-ingress.yaml - # - ./values/external-argocd-values.yaml - # set: - # global.external-argo-cd.server.rootpath: /argocd - # asserts: - # - contains: - # path: spec.template.spec.containers[0].env - # content: - # name: ARGO_CD_URL - # value: my-argocd-server:80/argocd - - # - it: gitops-runtime-argo-cd-token secret should be create when `auth.type=token` and `auth.token` are set - # template: app-proxy/external-argocd-token.yaml - # values: - # - ./values/mandatory-values-ingress.yaml - # - ./values/external-argocd-values.yaml - # set: - # global.external-argo-cd.auth.type: token - # global.external-argo-cd.auth.token: mytoken - # asserts: - # - isKind: - # of: Secret - # - equal: - # path: metadata.name - # value: gitops-runtime-argo-cd-token - # - isNotNullOrEmpty: - # path: stringData.token - - # - it: gitops-runtime-argo-cd-password secret should be create when `auth.type=password` and `auth.password` are set - # template: app-proxy/external-argocd-token.yaml - # values: - # - ./values/mandatory-values-ingress.yaml - # - ./values/external-argocd-values.yaml - # set: - # global.external-argo-cd.auth.type: password - # global.external-argo-cd.auth.password: mypassword - # asserts: - # - isKind: - # of: Secret - # - equal: - # path: metadata.name - # value: gitops-runtime-argo-cd-password - # - isNotNullOrEmpty: - # path: stringData.token - - # - it: codefresh-cm ConfigMap should have runtime-reporter and sources-server - # template: codefresh-cm.yaml - # values: - # - ./values/mandatory-values-ingress.yaml - # - ./values/external-argocd-values.yaml - # asserts: - # - matchRegex: - # path: data.components - # pattern: "name: event-reporter" - # - matchRegex: - # path: data.components - # pattern: "name: argo-api-gateway" - - # - it: should require ArgoCd token if auth.type=token is set and no token is provided - # values: - # - ./values/mandatory-values-ingress.yaml - # - ./values/external-argocd-values.yaml - # set: - # global.external-argo-cd.auth.type: token - # global.external-argo-cd.auth.token: null - # global.external-argo-cd.auth.tokenSecretKeyRef.name: null - # global.external-argo-cd.auth.tokenSecretKeyRef.key: null - # asserts: - # - failedTemplate: - # errorMessage: ".Values.global.external-argo-cd.auth.type is set to 'token' therefore .global.external-argo-cd.auth.tokenSecretKeyRef.name is required" + - it: app-proxy ConfigMap should have valid ArgoCd URL + values: + - ./values/mandatory-values-ingress.yaml + - ./values/external-argocd-values.yaml + template: app-proxy/config.yaml + asserts: + - equal: + path: data.argoCdUrl + value: http://my-argocd-server + + - it: app-proxy ConfigMap should have valid ArgoCd Username + values: + - ./values/mandatory-values-ingress.yaml + - ./values/external-argocd-values.yaml + template: app-proxy/config.yaml + asserts: + - equal: + path: data.argoCdUsername + value: admin + + - it: app-proxy ConfigMap should have valid ArgoCd Username with override + values: + - ./values/mandatory-values-ingress.yaml + - ./values/external-argocd-values.yaml + template: app-proxy/config.yaml + set: + global.external-argo-cd.auth.username: adminoverride + asserts: + - equal: + path: data.argoCdUsername + value: adminoverride + + - it: app-proxy ConfigMap should have isExternalArgoCD key set to true + values: + - ./values/mandatory-values-ingress.yaml + - ./values/external-argocd-values.yaml + template: app-proxy/config.yaml + set: + global.external-argo-cd.auth.username: adminoverride + asserts: + - equal: + path: data.isExternalArgoCD + value: "true" + + - it: app-proxy Deployment should have valid ARGO_CD_PASSWORD env var set via passwordSecretKeyRef + values: + - ./values/mandatory-values-ingress.yaml + - ./values/external-argocd-values.yaml + template: app-proxy/deployment.yaml + asserts: + - contains: + path: spec.template.spec.containers[0].env + content: + name: ARGO_CD_PASSWORD + valueFrom: + secretKeyRef: + key: password + name: argocd-initial-admin-secret + + - it: app-proxy Deploymeny should have valid ARGO_CD_PASSWORD env var set via plaintext password + values: + - ./values/mandatory-values-ingress.yaml + - ./values/external-argocd-values.yaml + template: app-proxy/deployment.yaml + set: + global.external-argo-cd.auth.passwordSecretKeyRef: [] + global.external-argo-cd.auth.password: token + asserts: + - contains: + path: spec.template.spec.containers[0].env + content: + name: ARGO_CD_PASSWORD + valueFrom: + secretKeyRef: + key: token + name: gitops-runtime-argo-cd-password + + - it: app-proxy Deployment should have valid ARGO_CD_USERNAME env var set via plaintext username + values: + - ./values/mandatory-values-ingress.yaml + - ./values/external-argocd-values.yaml + template: app-proxy/deployment.yaml + set: + global.external-argo-cd.auth.username: adminoverride + asserts: + - contains: + path: spec.template.spec.containers[0].env + content: + name: ARGO_CD_USERNAME + value: adminoverride + + - it: app-proxy Deployment should have valid ARGO_CD_TOKEN env var set via tokenSecretKeyRef + values: + - ./values/mandatory-values-ingress.yaml + - ./values/external-argocd-values.yaml + template: app-proxy/deployment.yaml + set: + global.external-argo-cd.auth.type: token + global.external-argo-cd.auth.tokenSecretKeyRef.name: my-argocd-secret + global.external-argo-cd.auth.tokenSecretKeyRef.key: my-token + asserts: + - contains: + path: spec.template.spec.containers[0].env + content: + name: ARGO_CD_TOKEN + valueFrom: + secretKeyRef: + key: my-token + name: my-argocd-secret + + - it: app-proxy Deployment should have valid ARGO_CD_TOKEN env var set via plaintext token + values: + - ./values/mandatory-values-ingress.yaml + - ./values/external-argocd-values.yaml + template: app-proxy/deployment.yaml + set: + global.external-argo-cd.auth.type: token + global.external-argo-cd.auth.token: "plaintexttoken" + asserts: + - contains: + path: spec.template.spec.containers[0].env + content: + name: ARGO_CD_TOKEN + valueFrom: + secretKeyRef: + key: token + name: gitops-runtime-argo-cd-token + + - it: gitops-operator Deployment should have valid ARGO_CD_TOKEN_SECRET_NAME env var set via tokenSecretKeyRef + values: + - ./values/mandatory-values.yaml + - ./values/external-argocd-values.yaml + template: gitops-operator/deployment.yaml + set: + global.external-argo-cd.auth.type: token + global.external-argo-cd.auth.tokenSecretKeyRef.name: my-argocd-token-secret + global.external-argo-cd.auth.tokenSecretKeyRef.key: my-token + asserts: + - contains: + path: spec.template.spec.containers[0].env + content: + name: ARGO_CD_TOKEN_SECRET_NAME + value: my-argocd-token-secret + + - it: gitops-operator Deployment should have valid ARGO_CD_TOKEN_SECRET_KEY env var set via tokenSecretKeyRef + values: + - ./values/mandatory-values-ingress.yaml + - ./values/external-argocd-values.yaml + template: gitops-operator/deployment.yaml + set: + global.external-argo-cd.auth.type: token + global.external-argo-cd.auth.tokenSecretKeyRef.name: my-argocd-token-secret + global.external-argo-cd.auth.tokenSecretKeyRef.key: my-token + asserts: + - contains: + path: spec.template.spec.containers[0].env + content: + name: ARGO_CD_TOKEN_SECRET_KEY + value: my-token + + - it: gitops-operator Deployment should have valid ARGO_CD_TOKEN_SECRET_NAME env var set via plaintext token + values: + - ./values/mandatory-values-ingress.yaml + - ./values/external-argocd-values.yaml + template: gitops-operator/deployment.yaml + set: + global.external-argo-cd.auth.type: token + global.external-argo-cd.auth.token: "plaintexttoken" + asserts: + - contains: + path: spec.template.spec.containers[0].env + content: + name: ARGO_CD_TOKEN_SECRET_NAME + value: gitops-runtime-argo-cd-token + + - it: gitops-operator Deployment should have valid ARGO_CD_TOKEN_SECRET_KEY env var set via plaintext token + values: + - ./values/mandatory-values-ingress.yaml + - ./values/external-argocd-values.yaml + template: gitops-operator/deployment.yaml + set: + global.external-argo-cd.auth.type: token + global.external-argo-cd.auth.token: "plaintexttoken" + asserts: + - contains: + path: spec.template.spec.containers[0].env + content: + name: ARGO_CD_TOKEN_SECRET_KEY + value: token + + - it: gitops-operator Deployment should have valid default ARGO_CD_TOKEN_SECRET_NAME env var + values: + - ./values/mandatory-values-ingress.yaml + - ./values/external-argocd-values.yaml + template: gitops-operator/deployment.yaml + asserts: + - contains: + path: spec.template.spec.containers[0].env + content: + name: ARGO_CD_TOKEN_SECRET_NAME + value: argocd-token + + - it: gitops-operator Deployment should have valid default ARGO_CD_TOKEN_SECRET_KEY env var + values: + - ./values/mandatory-values-ingress.yaml + - ./values/external-argocd-values.yaml + template: gitops-operator/deployment.yaml + asserts: + - contains: + path: spec.template.spec.containers[0].env + content: + name: ARGO_CD_TOKEN_SECRET_KEY + value: token + + - it: gitops-operator Deployment should have valid ARGO_CD_URL env var + values: + - ./values/mandatory-values-ingress.yaml + - ./values/external-argocd-values.yaml + template: gitops-operator/deployment.yaml + asserts: + - contains: + path: spec.template.spec.containers[0].env + content: + name: ARGO_CD_URL + value: my-argocd-server:80 + + - it: runtime-reporter ConfigMap should have valid ArgoCd URL + template: event-reporters/runtime-reporter/configmap.yaml + values: + - ./values/mandatory-values-ingress.yaml + - ./values/external-argocd-values.yaml + asserts: + - equal: + path: data["argocd.server"] + value: my-argocd-server:80 + + - it: runtime-reporter ConfigMap should have valid Redis URL + template: event-reporters/runtime-reporter/configmap.yaml + values: + - ./values/mandatory-values-ingress.yaml + - ./values/external-argocd-values.yaml + asserts: + - equal: + path: data["redis.server"] + value: my-argocd-redis:6379 + + - it: runtime-reporter ConfigMap should have valid Sources Server address + template: event-reporters/runtime-reporter/configmap.yaml + values: + - ./values/mandatory-values-ingress.yaml + - ./values/external-argocd-values.yaml + asserts: + - equal: + path: data["sources.server"] + value: http://argo-api-gateway + + - it: runtime-reporter ConfigMap should have valid Repo Server URL + template: event-reporters/runtime-reporter/configmap.yaml + values: + - ./values/mandatory-values-ingress.yaml + - ./values/external-argocd-values.yaml + asserts: + - equal: + path: data["repo.server"] + value: my-argocd-repo-server:8081 + + - it: runtime-reporter Deployment should have valid default ARGO_CD_TOKEN_SECRET_NAME env var + template: event-reporters/runtime-reporter/deployment.yaml + values: + - ./values/mandatory-values-ingress.yaml + - ./values/external-argocd-values.yaml + asserts: + - contains: + path: spec.template.spec.containers[0].env + content: + name: ARGO_CD_TOKEN_SECRET_NAME + value: argocd-token + + - it: runtime-reporter Deployment should have valid default ARGO_CD_TOKEN_SECRET_KEY env var + template: event-reporters/runtime-reporter/deployment.yaml + values: + - ./values/mandatory-values-ingress.yaml + - ./values/external-argocd-values.yaml + asserts: + - contains: + path: spec.template.spec.containers[0].env + content: + name: ARGO_CD_TOKEN_SECRET_KEY + value: token + + - it: runtime-reporter Deployment should have valid ARGO_CD_TOKEN_SECRET_NAME env var set via tokenSecretKeyRef + template: event-reporters/runtime-reporter/deployment.yaml + values: + - ./values/mandatory-values-ingress.yaml + - ./values/external-argocd-values.yaml + set: + global.external-argo-cd.auth.type: token + global.external-argo-cd.auth.tokenSecretKeyRef.name: my-argocd-token-secret + global.external-argo-cd.auth.tokenSecretKeyRef.key: my-token + asserts: + - contains: + path: spec.template.spec.containers[0].env + content: + name: ARGO_CD_TOKEN_SECRET_NAME + value: my-argocd-token-secret + + - it: runtime-reporter Deployment should have valid ARGO_CD_TOKEN_SECRET_KEY env var set via tokenSecretKeyRef + template: event-reporters/runtime-reporter/deployment.yaml + values: + - ./values/mandatory-values-ingress.yaml + - ./values/external-argocd-values.yaml + set: + global.external-argo-cd.auth.type: token + global.external-argo-cd.auth.tokenSecretKeyRef.name: my-argocd-token-secret + global.external-argo-cd.auth.tokenSecretKeyRef.key: my-token + asserts: + - contains: + path: spec.template.spec.containers[0].env + content: + name: ARGO_CD_TOKEN_SECRET_KEY + value: my-token + + - it: runtime-reporter Deployment should have valid ARGO_CD_TOKEN_SECRET_NAME env var set via plaintext token + template: event-reporters/runtime-reporter/deployment.yaml + values: + - ./values/mandatory-values-ingress.yaml + - ./values/external-argocd-values.yaml + set: + global.external-argo-cd.auth.type: token + global.external-argo-cd.auth.token: "plaintexttoken" + asserts: + - contains: + path: spec.template.spec.containers[0].env + content: + name: ARGO_CD_TOKEN_SECRET_NAME + value: gitops-runtime-argo-cd-token + + - it: runtime-reporter Deployment should have valid ARGO_CD_TOKEN_SECRET_KEY env var set via plaintext token + template: event-reporters/runtime-reporter/deployment.yaml + values: + - ./values/mandatory-values-ingress.yaml + - ./values/external-argocd-values.yaml + set: + global.external-argo-cd.auth.type: token + global.external-argo-cd.auth.token: "plaintexttoken" + asserts: + - contains: + path: spec.template.spec.containers[0].env + content: + name: ARGO_CD_TOKEN_SECRET_KEY + value: token + + - it: argo-api-gateway ConfigMap should have valid ArgoCd URL + template: argo-api-gateway/configmap.yaml + values: + - ./values/mandatory-values-ingress.yaml + - ./values/external-argocd-values.yaml + asserts: + - equal: + path: data["argocd.server"] + value: my-argocd-server:80 + + - it: argo-api-gateway ConfigMap should have valid Redis URL + template: argo-api-gateway/configmap.yaml + values: + - ./values/mandatory-values-ingress.yaml + - ./values/external-argocd-values.yaml + asserts: + - equal: + path: data["redis.server"] + value: my-argocd-redis:6379 + + - it: argo-api-gateway ConfigMap should have valid Repo Server URL + template: argo-api-gateway/configmap.yaml + values: + - ./values/mandatory-values-ingress.yaml + - ./values/external-argocd-values.yaml + asserts: + - equal: + path: data["repo.server"] + value: my-argocd-repo-server:8081 + + - it: argo-api-gateway Deployment should have valid default ARGO_CD_TOKEN_SECRET_NAME env var + template: argo-api-gateway/deployment.yaml + values: + - ./values/mandatory-values-ingress.yaml + - ./values/external-argocd-values.yaml + asserts: + - contains: + path: spec.template.spec.containers[0].env + content: + name: ARGO_CD_TOKEN_SECRET_NAME + value: argocd-token + + - it: argo-api-gateway Deployment should have valid default ARGO_CD_TOKEN_SECRET_KEY env var + template: argo-api-gateway/deployment.yaml + values: + - ./values/mandatory-values-ingress.yaml + - ./values/external-argocd-values.yaml + asserts: + - contains: + path: spec.template.spec.containers[0].env + content: + name: ARGO_CD_TOKEN_SECRET_KEY + value: token + + - it: argo-api-gateway Deployment should have valid ARGO_CD_TOKEN_SECRET_NAME env var set via tokenSecretKeyRef + template: argo-api-gateway/deployment.yaml + values: + - ./values/mandatory-values-ingress.yaml + - ./values/external-argocd-values.yaml + set: + global.external-argo-cd.auth.type: token + global.external-argo-cd.auth.tokenSecretKeyRef.name: my-argocd-token-secret + global.external-argo-cd.auth.tokenSecretKeyRef.key: my-token + asserts: + - contains: + path: spec.template.spec.containers[0].env + content: + name: ARGO_CD_TOKEN_SECRET_NAME + value: my-argocd-token-secret + + - it: argo-api-gateway Deployment should have valid ARGO_CD_TOKEN_SECRET_KEY env var set via tokenSecretKeyRef + template: argo-api-gateway/deployment.yaml + values: + - ./values/mandatory-values-ingress.yaml + - ./values/external-argocd-values.yaml + set: + global.external-argo-cd.auth.type: token + global.external-argo-cd.auth.tokenSecretKeyRef.name: my-argocd-token-secret + global.external-argo-cd.auth.tokenSecretKeyRef.key: my-token + asserts: + - contains: + path: spec.template.spec.containers[0].env + content: + name: ARGO_CD_TOKEN_SECRET_KEY + value: my-token + + - it: argo-api-gateway Deployment should have valid ARGO_CD_TOKEN_SECRET_NAME env var set via plaintext token + template: argo-api-gateway/deployment.yaml + values: + - ./values/mandatory-values-ingress.yaml + - ./values/external-argocd-values.yaml + set: + global.external-argo-cd.auth.type: token + global.external-argo-cd.auth.token: "plaintexttoken" + asserts: + - contains: + path: spec.template.spec.containers[0].env + content: + name: ARGO_CD_TOKEN_SECRET_NAME + value: gitops-runtime-argo-cd-token + + - it: argo-api-gateway Deployment should have valid ARGO_CD_TOKEN_SECRET_KEY env var set via plaintext token + template: argo-api-gateway/deployment.yaml + values: + - ./values/mandatory-values-ingress.yaml + - ./values/external-argocd-values.yaml + set: + global.external-argo-cd.auth.type: token + global.external-argo-cd.auth.token: "plaintexttoken" + asserts: + - contains: + path: spec.template.spec.containers[0].env + content: + name: ARGO_CD_TOKEN_SECRET_KEY + value: token + + - it: should require ArgoCd password if auth.type=password is set and no password is provided + values: + - ./values/mandatory-values-ingress.yaml + - ./values/external-argocd-values.yaml + template: app-proxy/deployment.yaml + set: + global.external-argo-cd.auth.type: password + global.external-argo-cd.auth.password: null + global.external-argo-cd.auth.passwordSecretKeyRef: [] + asserts: + - failedTemplate: + errorMessage: "ArgoCD is not enabled and .Values.global.external-argo-cd.auth.password or .Values.global.external-argo-cd.auth.passwordSecretKeyRef is not set" + + - it: should require ArgoCd redis address if it's not provided + values: + - ./values/mandatory-values-ingress.yaml + - ./values/external-argocd-values.yaml + set: + global.external-argo-cd.redis: null + asserts: + - failedTemplate: + errorMessage: "ArgoCD is not enabled and .Values.global.external-argo-cd.redis is not set" + + - it: should require ArgoCd repoServer address if it's not provided + values: + - ./values/mandatory-values-ingress.yaml + - ./values/external-argocd-values.yaml + set: + global.external-argo-cd.repoServer: null + asserts: + - failedTemplate: + errorMessage: "ArgoCD is not enabled and .Values.global.external-argo-cd.repoServer is not set" + + - it: should required only allowed auth type for external ArgoCd + values: + - ./values/mandatory-values-ingress.yaml + - ./values/external-argocd-values.yaml + template: app-proxy/deployment.yaml + set: + global.external-argo-cd.auth.type: invalid + asserts: + - failedTemplate: + errorMessage: "Invalid value for .Values.global.external-argo-cd.auth.type: invalid. Allowed values are: [password token]" + + - it: runtime-reporter Deployment should have valid ARGOCD_SERVER_ROOTPATH env var + template: event-reporters/runtime-reporter/deployment.yaml + values: + - ./values/mandatory-values-ingress.yaml + - ./values/external-argocd-values.yaml + set: + global.external-argo-cd.server.rootpath: /argocd + asserts: + - contains: + path: spec.template.spec.containers[0].env + content: + name: ARGOCD_SERVER_ROOTPATH + value: /argocd + + - it: argo-api-gateway Deployment should have valid ARGOCD_SERVER_ROOTPATH env var + template: argo-api-gateway/deployment.yaml + values: + - ./values/mandatory-values-ingress.yaml + - ./values/external-argocd-values.yaml + set: + global.external-argo-cd.server.rootpath: /argocd + asserts: + - contains: + path: spec.template.spec.containers[0].env + content: + name: ARGOCD_SERVER_ROOTPATH + value: /argocd + + - it: app-proxy ConfigMap should have valid ArgoCD url with rootpath suffix + values: + - ./values/mandatory-values-ingress.yaml + - ./values/external-argocd-values.yaml + template: app-proxy/config.yaml + set: + global.external-argo-cd.server.rootpath: /argocd + asserts: + - equal: + path: data.argoCdUrl + value: http://my-argocd-server/argocd + + - it: gitops-operator Deployment should have valid ARGO_CD_URL env var with rootpath suffix + template: gitops-operator/deployment.yaml + values: + - ./values/mandatory-values-ingress.yaml + - ./values/external-argocd-values.yaml + set: + global.external-argo-cd.server.rootpath: /argocd + asserts: + - contains: + path: spec.template.spec.containers[0].env + content: + name: ARGO_CD_URL + value: my-argocd-server:80/argocd + + - it: gitops-runtime-argo-cd-token secret should be create when `auth.type=token` and `auth.token` are set + template: app-proxy/external-argocd-token.yaml + values: + - ./values/mandatory-values-ingress.yaml + - ./values/external-argocd-values.yaml + set: + global.external-argo-cd.auth.type: token + global.external-argo-cd.auth.token: mytoken + asserts: + - isKind: + of: Secret + - equal: + path: metadata.name + value: gitops-runtime-argo-cd-token + - isNotNullOrEmpty: + path: stringData.token + + - it: gitops-runtime-argo-cd-password secret should be create when `auth.type=password` and `auth.password` are set + template: app-proxy/external-argocd-token.yaml + values: + - ./values/mandatory-values-ingress.yaml + - ./values/external-argocd-values.yaml + set: + global.external-argo-cd.auth.type: password + global.external-argo-cd.auth.password: mypassword + asserts: + - isKind: + of: Secret + - equal: + path: metadata.name + value: gitops-runtime-argo-cd-password + - isNotNullOrEmpty: + path: stringData.token + + - it: codefresh-cm ConfigMap should have runtime-reporter and sources-server + template: codefresh-cm.yaml + values: + - ./values/mandatory-values-ingress.yaml + - ./values/external-argocd-values.yaml + asserts: + - matchRegex: + path: data.components + pattern: "name: event-reporter" + - matchRegex: + path: data.components + pattern: "name: argo-api-gateway" + + - it: should require ArgoCd token if auth.type=token is set and no token is provided + values: + - ./values/mandatory-values-ingress.yaml + - ./values/external-argocd-values.yaml + set: + global.external-argo-cd.auth.type: token + global.external-argo-cd.auth.token: null + global.external-argo-cd.auth.tokenSecretKeyRef.name: null + global.external-argo-cd.auth.tokenSecretKeyRef.key: null + asserts: + - failedTemplate: + errorMessage: ".Values.global.external-argo-cd.auth.type is set to 'token' therefore .global.external-argo-cd.auth.tokenSecretKeyRef.name is required" - it: should require ArgoCd server address if it's not provided values: diff --git a/charts/gitops-runtime/tests/global_constraints_test.yaml b/charts/gitops-runtime/tests/global_constraints_test.yaml index 7c092357..133ed04b 100644 --- a/charts/gitops-runtime/tests/global_constraints_test.yaml +++ b/charts/gitops-runtime/tests/global_constraints_test.yaml @@ -8,10 +8,6 @@ templates: - tunnel-client.yaml - charts/codefresh-tunnel-client/* - internal-router/deployment.yaml - - event-reporters/rollout-reporter/eventsource.yaml - - event-reporters/rollout-reporter/sensor.yaml - - event-reporters/workflow-reporter/eventsource.yaml - - event-reporters/workflow-reporter/sensor.yaml - eventbus/codefresh-eventbus.yaml - hooks/pre-install/validate-values.yaml - hooks/pre-install/validate-usage.yaml @@ -57,66 +53,36 @@ tests: value: some-value effect: NoSchedule template: internal-router/deployment.yaml - # -- rollout-reporter eventsource + # -- runtime-reporter - equal: - path: spec.template.nodeSelector - value: - some-key: some-value - extra-key: extra-value - template: event-reporters/rollout-reporter/eventsource.yaml - - equal: - path: spec.template.tolerations - value: - - key: some-key - operator: Equal - value: some-value - effect: NoSchedule - template: event-reporters/rollout-reporter/eventsource.yaml - # -- rollout-reporter sensor - - equal: - path: spec.template.nodeSelector - value: - some-key: some-value - extra-key: extra-value - template: event-reporters/rollout-reporter/sensor.yaml - - equal: - path: spec.template.tolerations - value: - - key: some-key - operator: Equal - value: some-value - effect: NoSchedule - template: event-reporters/rollout-reporter/sensor.yaml - # -- workflow-reporter eventsource - - equal: - path: spec.template.nodeSelector + path: spec.template.spec.nodeSelector value: some-key: some-value extra-key: extra-value - template: event-reporters/workflow-reporter/eventsource.yaml + template: event-reporters/runtime-reporter/deployment.yaml - equal: - path: spec.template.tolerations + path: spec.template.spec.tolerations value: - key: some-key operator: Equal value: some-value effect: NoSchedule - template: event-reporters/workflow-reporter/eventsource.yaml - # -- workflow-reporter sensor + template: event-reporters/runtime-reporter/deployment.yaml + # -- argo-api-gateway - equal: - path: spec.template.nodeSelector + path: spec.template.spec.nodeSelector value: some-key: some-value extra-key: extra-value - template: event-reporters/workflow-reporter/sensor.yaml + template: argo-api-gateway/deployment.yaml - equal: - path: spec.template.tolerations + path: spec.template.spec.tolerations value: - key: some-key operator: Equal value: some-value effect: NoSchedule - template: event-reporters/workflow-reporter/sensor.yaml + template: argo-api-gateway/deployment.yaml # -- codefresh-eventbus - equal: path: spec.nats.native.nodeSelector @@ -282,36 +248,6 @@ tests: documentSelector: path: kind value: Deployment - # -- argo-events-controller - - equal: - path: spec.template.spec.nodeSelector - value: - some-key: some-value - extra-key: extra-value - template: charts/argo-events/templates/argo-events-controller/deployment.yaml - - equal: - path: spec.template.spec.tolerations - value: - - key: some-key - operator: Equal - value: some-value - effect: NoSchedule - template: charts/argo-events/templates/argo-events-controller/deployment.yaml - # -- argo-events-webhook - - equal: - path: spec.template.spec.nodeSelector - value: - some-key: some-value - extra-key: extra-value - template: charts/argo-events/templates/argo-events-webhook/deployment.yaml - - equal: - path: spec.template.spec.tolerations - value: - - key: some-key - operator: Equal - value: some-value - effect: NoSchedule - template: charts/argo-events/templates/argo-events-webhook/deployment.yaml # -- argo-rollouts controller - equal: path: spec.template.spec.nodeSelector @@ -394,66 +330,6 @@ tests: value: another-value effect: NoSchedule template: internal-router/deployment.yaml - # -- rollout-reporter eventsource - - equal: - path: spec.template.nodeSelector - value: - some-key: another-value - foo: bar - template: event-reporters/rollout-reporter/eventsource.yaml - - equal: - path: spec.template.tolerations - value: - - key: another-key - operator: Equal - value: another-value - effect: NoSchedule - template: event-reporters/rollout-reporter/eventsource.yaml - # -- rollout-reporter sensor - - equal: - path: spec.template.nodeSelector - value: - some-key: another-value - foo: bar - template: event-reporters/rollout-reporter/sensor.yaml - - equal: - path: spec.template.tolerations - value: - - key: another-key - operator: Equal - value: another-value - effect: NoSchedule - template: event-reporters/rollout-reporter/sensor.yaml - # -- workflow-reporter eventsource - - equal: - path: spec.template.nodeSelector - value: - some-key: another-value - foo: bar - template: event-reporters/workflow-reporter/eventsource.yaml - - equal: - path: spec.template.tolerations - value: - - key: another-key - operator: Equal - value: another-value - effect: NoSchedule - template: event-reporters/workflow-reporter/eventsource.yaml - # -- workflow-reporter sensor - - equal: - path: spec.template.nodeSelector - value: - some-key: another-value - foo: bar - template: event-reporters/workflow-reporter/sensor.yaml - - equal: - path: spec.template.tolerations - value: - - key: another-key - operator: Equal - value: another-value - effect: NoSchedule - template: event-reporters/workflow-reporter/sensor.yaml # -- codefresh-eventbus - equal: path: spec.nats.native.nodeSelector @@ -619,36 +495,6 @@ tests: documentSelector: path: kind value: Deployment - # -- argo-events-controller - - equal: - path: spec.template.spec.nodeSelector - value: - some-key: another-value - foo: bar - template: charts/argo-events/templates/argo-events-controller/deployment.yaml - - equal: - path: spec.template.spec.tolerations - value: - - key: another-key - operator: Equal - value: another-value - effect: NoSchedule - template: charts/argo-events/templates/argo-events-controller/deployment.yaml - # -- argo-events-webhook - - equal: - path: spec.template.spec.nodeSelector - value: - some-key: another-value - foo: bar - template: charts/argo-events/templates/argo-events-webhook/deployment.yaml - - equal: - path: spec.template.spec.tolerations - value: - - key: another-key - operator: Equal - value: another-value - effect: NoSchedule - template: charts/argo-events/templates/argo-events-webhook/deployment.yaml # -- argo-rollouts controller - equal: path: spec.template.spec.nodeSelector diff --git a/charts/gitops-runtime/tests/rollouts-enabled-disabled_test.yaml b/charts/gitops-runtime/tests/rollouts-enabled-disabled_test.yaml deleted file mode 100644 index 795ed3d0..00000000 --- a/charts/gitops-runtime/tests/rollouts-enabled-disabled_test.yaml +++ /dev/null @@ -1,26 +0,0 @@ -suite: Enabling/disabling argo-rollouts should accordingly enable/disable the event reporter -templates: - - event-reporters/rollout-reporter/eventsource.yaml - - event-reporters/rollout-reporter/sensor.yaml -tests: - -- it: event reporter not generated when rollouts disabled - template: 'event-reporters/rollout-reporter/eventsource.yaml' - values: - - ./values/mandatory-values.yaml - set: - argo-rollouts.enabled: false - asserts: - - hasDocuments: - count: 0 - -- it: event reporter generated when rollouts enabled - template: 'event-reporters/rollout-reporter/eventsource.yaml' - values: - - ./values/mandatory-values.yaml - set: - argo-rollouts.enabled: true - asserts: - - containsDocument: - apiVersion: argoproj.io/v1alpha1 - kind: EventSource \ No newline at end of file diff --git a/charts/gitops-runtime/tests/workflows-enabled-disabled_test.yaml b/charts/gitops-runtime/tests/workflows-enabled-disabled_test.yaml index ab013f07..e90301d0 100644 --- a/charts/gitops-runtime/tests/workflows-enabled-disabled_test.yaml +++ b/charts/gitops-runtime/tests/workflows-enabled-disabled_test.yaml @@ -1,43 +1,8 @@ suite: Enabling/disabling argo-workflows should accordingly enable/disable the event reporter and set/unset the routing in internal router templates: - - event-reporters/workflow-reporter/eventsource.yaml - - event-reporters/workflow-reporter/sensor.yaml - internal-router/config.yaml - app-proxy/config.yaml tests: - -- it: event reporter eventsource not generated when workflows disabled - template: 'event-reporters/workflow-reporter/eventsource.yaml' - values: - - ./values/mandatory-values.yaml - set: - argo-workflows.enabled: false - asserts: - - hasDocuments: - count: 0 - -- it: event reporter eventsource generated when workflows enabled - template: 'event-reporters/workflow-reporter/eventsource.yaml' - values: - - ./values/mandatory-values.yaml - set: - argo-workflows.enabled: true - asserts: - - containsDocument: - apiVersion: argoproj.io/v1alpha1 - kind: EventSource - -- it: event reporter eventsource generated when workflows enabled - template: 'event-reporters/workflow-reporter/sensor.yaml' - values: - - ./values/mandatory-values.yaml - set: - argo-workflows.enabled: true - asserts: - - containsDocument: - apiVersion: argoproj.io/v1alpha1 - kind: Sensor - - it: internal router config doesn't have workflows route when workflows disabled template: 'internal-router/config.yaml' values: From 1fd6336ab64284b658a9c259e7d21c53fb777227 Mon Sep 17 00:00:00 2001 From: Mikhail Klimko Date: Tue, 23 Sep 2025 13:30:50 +0300 Subject: [PATCH 11/37] refactor cf-argocd-extras --- .../argo-api-gateway/serviceMonitor.yaml | 23 +++++++++++++++++ .../resources-reporter/serviceMonitor.yaml | 25 +++++++++++++++++++ .../runtime-reporter/serviceMonitor.yaml | 25 +++++++++++++++++++ charts/gitops-runtime/values.yaml | 4 +++ 4 files changed, 77 insertions(+) create mode 100644 charts/gitops-runtime/templates/argo-api-gateway/serviceMonitor.yaml create mode 100644 charts/gitops-runtime/templates/event-reporters/resources-reporter/serviceMonitor.yaml create mode 100644 charts/gitops-runtime/templates/event-reporters/runtime-reporter/serviceMonitor.yaml diff --git a/charts/gitops-runtime/templates/argo-api-gateway/serviceMonitor.yaml b/charts/gitops-runtime/templates/argo-api-gateway/serviceMonitor.yaml new file mode 100644 index 00000000..4f313885 --- /dev/null +++ b/charts/gitops-runtime/templates/argo-api-gateway/serviceMonitor.yaml @@ -0,0 +1,23 @@ +{{- $context := deepCopy . }} +{{- $_ := set $context "Values" (deepCopy (get .Values "argo-api-gateway")) }} +{{- $_ := set $context.Values "global" (deepCopy (get .Values "global")) }} +{{- if $context.Values.serviceMonitor.enabled -}} +apiVersion: monitoring.coreos.com/v1 +kind: ServiceMonitor +metadata: + name: {{ include "argo-api-gateway.fullname" . }} + labels: + {{- include "argo-api-gateway.labels" . | nindent 4 }} +spec: + selector: + matchLabels: + {{- include "argo-api-gateway.selectorLabels" . | nindent 8 }} + endpoints: + - port: http + {{- if $context.metrics.serviceMonitor.interval }} + interval: {{ $context.metrics.serviceMonitor.interval | default "30s" }} + {{- end }} + {{- if $context.metrics.serviceMonitor.scrapeTimeout }} + scrapeTimeout: {{ $context.metrics.serviceMonitor.scrapeTimeout }} + {{- end }} +{{- end }} diff --git a/charts/gitops-runtime/templates/event-reporters/resources-reporter/serviceMonitor.yaml b/charts/gitops-runtime/templates/event-reporters/resources-reporter/serviceMonitor.yaml new file mode 100644 index 00000000..a2fef55d --- /dev/null +++ b/charts/gitops-runtime/templates/event-reporters/resources-reporter/serviceMonitor.yaml @@ -0,0 +1,25 @@ +{{- $context := deepCopy . }} +{{- $_ := set $context "Values" (deepCopy (get (index .Values "global") "event-reporters")) }} +{{- $_ := set $context.Values "global" (deepCopy (get .Values "global")) }} +{{- $valuesOverrides := index .Values "event-reporters" "resources-reporter" }} +{{- $_ := mergeOverwrite $context.Values $valuesOverrides | set $context "Values" }} +{{- if $context.Values.serviceMonitor.enabled -}} +apiVersion: monitoring.coreos.com/v1 +kind: ServiceMonitor +metadata: + name: {{ include "resources-reporter.fullname" . }} + labels: + {{- include "resources-reporter.labels" . | nindent 4 }} +spec: + selector: + matchLabels: + {{- include "resources-reporter.selectorLabels" . | nindent 8 }} + endpoints: + - port: metrics + {{- if $context.metrics.serviceMonitor.interval }} + interval: {{ $context.metrics.serviceMonitor.interval | default "30s" }} + {{- end }} + {{- if $context.metrics.serviceMonitor.scrapeTimeout }} + scrapeTimeout: {{ $context.metrics.serviceMonitor.scrapeTimeout }} + {{- end }} +{{- end }} diff --git a/charts/gitops-runtime/templates/event-reporters/runtime-reporter/serviceMonitor.yaml b/charts/gitops-runtime/templates/event-reporters/runtime-reporter/serviceMonitor.yaml new file mode 100644 index 00000000..119d8c95 --- /dev/null +++ b/charts/gitops-runtime/templates/event-reporters/runtime-reporter/serviceMonitor.yaml @@ -0,0 +1,25 @@ +{{- $context := deepCopy . }} +{{- $_ := set $context "Values" (deepCopy (get (index .Values "global") "event-reporters")) }} +{{- $_ := set $context.Values "global" (deepCopy (get .Values "global")) }} +{{- $valuesOverrides := index .Values "event-reporters" "runtime-reporter" }} +{{- $_ := mergeOverwrite $context.Values $valuesOverrides | set $context "Values" }} +{{- if $context.Values.serviceMonitor.enabled -}} +apiVersion: monitoring.coreos.com/v1 +kind: ServiceMonitor +metadata: + name: {{ include "runtime-reporter.fullname" . }} + labels: + {{- include "runtime-reporter.labels" . | nindent 4 }} +spec: + selector: + matchLabels: + {{- include "runtime-reporter.selectorLabels" . | nindent 8 }} + endpoints: + - port: metrics + {{- if $context.metrics.serviceMonitor.interval }} + interval: {{ $context.metrics.serviceMonitor.interval | default "30s" }} + {{- end }} + {{- if $context.metrics.serviceMonitor.scrapeTimeout }} + scrapeTimeout: {{ $context.metrics.serviceMonitor.scrapeTimeout }} + {{- end }} +{{- end }} diff --git a/charts/gitops-runtime/values.yaml b/charts/gitops-runtime/values.yaml index 8c2e742d..52f44ca0 100644 --- a/charts/gitops-runtime/values.yaml +++ b/charts/gitops-runtime/values.yaml @@ -236,6 +236,8 @@ global: periodSeconds: 10 successThreshold: 1 timeoutSeconds: 10 + serviceMonitor: + enabled: false config: {} # ------------------------------------------------------------------------------------------------------------------------- @@ -745,6 +747,8 @@ argo-api-gateway: periodSeconds: 10 successThreshold: 1 timeoutSeconds: 10 + serviceMonitor: + enabled: false event-reporters: runtime-reporter: {} From 7b614e0a6ec06c9579a32ece76a50bca5d342cbc Mon Sep 17 00:00:00 2001 From: Mikhail Klimko Date: Tue, 23 Sep 2025 13:32:39 +0300 Subject: [PATCH 12/37] refactor cf-argocd-extras --- .../templates/argo-api-gateway/serviceMonitor.yaml | 8 ++++---- .../resources-reporter/serviceMonitor.yaml | 8 ++++---- .../event-reporters/runtime-reporter/serviceMonitor.yaml | 8 ++++---- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/charts/gitops-runtime/templates/argo-api-gateway/serviceMonitor.yaml b/charts/gitops-runtime/templates/argo-api-gateway/serviceMonitor.yaml index 4f313885..ec2c69ff 100644 --- a/charts/gitops-runtime/templates/argo-api-gateway/serviceMonitor.yaml +++ b/charts/gitops-runtime/templates/argo-api-gateway/serviceMonitor.yaml @@ -14,10 +14,10 @@ spec: {{- include "argo-api-gateway.selectorLabels" . | nindent 8 }} endpoints: - port: http - {{- if $context.metrics.serviceMonitor.interval }} - interval: {{ $context.metrics.serviceMonitor.interval | default "30s" }} + {{- if $context.Values.serviceMonitor.interval }} + interval: {{ $context.Values.serviceMonitor.interval | default "30s" }} {{- end }} - {{- if $context.metrics.serviceMonitor.scrapeTimeout }} - scrapeTimeout: {{ $context.metrics.serviceMonitor.scrapeTimeout }} + {{- if $context.Values.serviceMonitor.scrapeTimeout }} + scrapeTimeout: {{ $context.Values.serviceMonitor.scrapeTimeout }} {{- end }} {{- end }} diff --git a/charts/gitops-runtime/templates/event-reporters/resources-reporter/serviceMonitor.yaml b/charts/gitops-runtime/templates/event-reporters/resources-reporter/serviceMonitor.yaml index a2fef55d..0b18d6db 100644 --- a/charts/gitops-runtime/templates/event-reporters/resources-reporter/serviceMonitor.yaml +++ b/charts/gitops-runtime/templates/event-reporters/resources-reporter/serviceMonitor.yaml @@ -16,10 +16,10 @@ spec: {{- include "resources-reporter.selectorLabels" . | nindent 8 }} endpoints: - port: metrics - {{- if $context.metrics.serviceMonitor.interval }} - interval: {{ $context.metrics.serviceMonitor.interval | default "30s" }} + {{- if $context.Values.serviceMonitor.interval }} + interval: {{ $context.Values.serviceMonitor.interval | default "30s" }} {{- end }} - {{- if $context.metrics.serviceMonitor.scrapeTimeout }} - scrapeTimeout: {{ $context.metrics.serviceMonitor.scrapeTimeout }} + {{- if $context.Values.serviceMonitor.scrapeTimeout }} + scrapeTimeout: {{ $context.Values.serviceMonitor.scrapeTimeout }} {{- end }} {{- end }} diff --git a/charts/gitops-runtime/templates/event-reporters/runtime-reporter/serviceMonitor.yaml b/charts/gitops-runtime/templates/event-reporters/runtime-reporter/serviceMonitor.yaml index 119d8c95..391f108e 100644 --- a/charts/gitops-runtime/templates/event-reporters/runtime-reporter/serviceMonitor.yaml +++ b/charts/gitops-runtime/templates/event-reporters/runtime-reporter/serviceMonitor.yaml @@ -16,10 +16,10 @@ spec: {{- include "runtime-reporter.selectorLabels" . | nindent 8 }} endpoints: - port: metrics - {{- if $context.metrics.serviceMonitor.interval }} - interval: {{ $context.metrics.serviceMonitor.interval | default "30s" }} + {{- if $context.Values.serviceMonitor.interval }} + interval: {{ $context.Values.serviceMonitor.interval | default "30s" }} {{- end }} - {{- if $context.metrics.serviceMonitor.scrapeTimeout }} - scrapeTimeout: {{ $context.metrics.serviceMonitor.scrapeTimeout }} + {{- if $context.Values.serviceMonitor.scrapeTimeout }} + scrapeTimeout: {{ $context.Values.serviceMonitor.scrapeTimeout }} {{- end }} {{- end }} From 93a742b896f7d88451d2c819b391c0cae14a5c25 Mon Sep 17 00:00:00 2001 From: Mikhail Klimko Date: Tue, 23 Sep 2025 13:34:01 +0300 Subject: [PATCH 13/37] refactor cf-argocd-extras --- .../templates/argo-api-gateway/serviceMonitor.yaml | 2 +- .../event-reporters/resources-reporter/serviceMonitor.yaml | 2 +- .../event-reporters/runtime-reporter/serviceMonitor.yaml | 2 +- charts/gitops-runtime/values.yaml | 4 ++++ 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/charts/gitops-runtime/templates/argo-api-gateway/serviceMonitor.yaml b/charts/gitops-runtime/templates/argo-api-gateway/serviceMonitor.yaml index ec2c69ff..d0ac2a8c 100644 --- a/charts/gitops-runtime/templates/argo-api-gateway/serviceMonitor.yaml +++ b/charts/gitops-runtime/templates/argo-api-gateway/serviceMonitor.yaml @@ -15,7 +15,7 @@ spec: endpoints: - port: http {{- if $context.Values.serviceMonitor.interval }} - interval: {{ $context.Values.serviceMonitor.interval | default "30s" }} + interval: {{ $context.Values.serviceMonitor.interval }} {{- end }} {{- if $context.Values.serviceMonitor.scrapeTimeout }} scrapeTimeout: {{ $context.Values.serviceMonitor.scrapeTimeout }} diff --git a/charts/gitops-runtime/templates/event-reporters/resources-reporter/serviceMonitor.yaml b/charts/gitops-runtime/templates/event-reporters/resources-reporter/serviceMonitor.yaml index 0b18d6db..e8be4490 100644 --- a/charts/gitops-runtime/templates/event-reporters/resources-reporter/serviceMonitor.yaml +++ b/charts/gitops-runtime/templates/event-reporters/resources-reporter/serviceMonitor.yaml @@ -17,7 +17,7 @@ spec: endpoints: - port: metrics {{- if $context.Values.serviceMonitor.interval }} - interval: {{ $context.Values.serviceMonitor.interval | default "30s" }} + interval: {{ $context.Values.serviceMonitor.interval }} {{- end }} {{- if $context.Values.serviceMonitor.scrapeTimeout }} scrapeTimeout: {{ $context.Values.serviceMonitor.scrapeTimeout }} diff --git a/charts/gitops-runtime/templates/event-reporters/runtime-reporter/serviceMonitor.yaml b/charts/gitops-runtime/templates/event-reporters/runtime-reporter/serviceMonitor.yaml index 391f108e..44a8a68b 100644 --- a/charts/gitops-runtime/templates/event-reporters/runtime-reporter/serviceMonitor.yaml +++ b/charts/gitops-runtime/templates/event-reporters/runtime-reporter/serviceMonitor.yaml @@ -17,7 +17,7 @@ spec: endpoints: - port: metrics {{- if $context.Values.serviceMonitor.interval }} - interval: {{ $context.Values.serviceMonitor.interval | default "30s" }} + interval: {{ $context.Values.serviceMonitor.interval }} {{- end }} {{- if $context.Values.serviceMonitor.scrapeTimeout }} scrapeTimeout: {{ $context.Values.serviceMonitor.scrapeTimeout }} diff --git a/charts/gitops-runtime/values.yaml b/charts/gitops-runtime/values.yaml index 52f44ca0..ba662c9b 100644 --- a/charts/gitops-runtime/values.yaml +++ b/charts/gitops-runtime/values.yaml @@ -238,6 +238,8 @@ global: timeoutSeconds: 10 serviceMonitor: enabled: false + interval: 30s + scrapeTimeout: 10s config: {} # ------------------------------------------------------------------------------------------------------------------------- @@ -749,6 +751,8 @@ argo-api-gateway: timeoutSeconds: 10 serviceMonitor: enabled: false + interval: 30s + scrapeTimeout: 10s event-reporters: runtime-reporter: {} From e9746cad2f2b42cc8cf475198f27c433b5f8717f Mon Sep 17 00:00:00 2001 From: Mikhail Klimko Date: Tue, 23 Sep 2025 13:43:16 +0300 Subject: [PATCH 14/37] refactor cf-argocd-extras --- .../event-reporters/resources-reporter/deployment.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/gitops-runtime/templates/event-reporters/resources-reporter/deployment.yaml b/charts/gitops-runtime/templates/event-reporters/resources-reporter/deployment.yaml index 098afc86..131a7fae 100644 --- a/charts/gitops-runtime/templates/event-reporters/resources-reporter/deployment.yaml +++ b/charts/gitops-runtime/templates/event-reporters/resources-reporter/deployment.yaml @@ -2,7 +2,7 @@ {{- $_ := set $context "Values" (deepCopy (get (index .Values "global") "event-reporters")) }} {{- $_ := set $context.Values "global" (deepCopy (get .Values "global")) }} {{/* Merge .Values.event-reporters. with .Values.global.event-reporters */}} -{{- $valuesOverrides := index .Values "event-reporters" "runtime-reporter" }} +{{- $valuesOverrides := index .Values "event-reporters" "resources-reporter" }} {{- $values := mergeOverwrite $context.Values $valuesOverrides }} {{- $_ := set $context "Values" $values }} {{/* Merge environment variables from calculated, defaults and overwrites */}} From adc4af434524cb9fb04c4c622286aab9fa26d2ba Mon Sep 17 00:00:00 2001 From: Mikhail Klimko Date: Tue, 23 Sep 2025 13:47:26 +0300 Subject: [PATCH 15/37] refactor cf-argocd-extras --- .../templates/argo-api-gateway/serviceMonitor.yaml | 3 +++ .../event-reporters/resources-reporter/serviceMonitor.yaml | 3 +++ .../event-reporters/runtime-reporter/serviceMonitor.yaml | 3 +++ charts/gitops-runtime/values.yaml | 2 ++ 4 files changed, 11 insertions(+) diff --git a/charts/gitops-runtime/templates/argo-api-gateway/serviceMonitor.yaml b/charts/gitops-runtime/templates/argo-api-gateway/serviceMonitor.yaml index d0ac2a8c..0f30250d 100644 --- a/charts/gitops-runtime/templates/argo-api-gateway/serviceMonitor.yaml +++ b/charts/gitops-runtime/templates/argo-api-gateway/serviceMonitor.yaml @@ -8,6 +8,9 @@ metadata: name: {{ include "argo-api-gateway.fullname" . }} labels: {{- include "argo-api-gateway.labels" . | nindent 4 }} + {{- with $context.Values.serviceMonitor.labels }} + {{- toYaml . | nindent 4 }} + {{- end }} spec: selector: matchLabels: diff --git a/charts/gitops-runtime/templates/event-reporters/resources-reporter/serviceMonitor.yaml b/charts/gitops-runtime/templates/event-reporters/resources-reporter/serviceMonitor.yaml index e8be4490..2910d0ca 100644 --- a/charts/gitops-runtime/templates/event-reporters/resources-reporter/serviceMonitor.yaml +++ b/charts/gitops-runtime/templates/event-reporters/resources-reporter/serviceMonitor.yaml @@ -10,6 +10,9 @@ metadata: name: {{ include "resources-reporter.fullname" . }} labels: {{- include "resources-reporter.labels" . | nindent 4 }} + {{- with $context.Values.serviceMonitor.labels }} + {{- toYaml . | nindent 4 }} + {{- end }} spec: selector: matchLabels: diff --git a/charts/gitops-runtime/templates/event-reporters/runtime-reporter/serviceMonitor.yaml b/charts/gitops-runtime/templates/event-reporters/runtime-reporter/serviceMonitor.yaml index 44a8a68b..bc583c9c 100644 --- a/charts/gitops-runtime/templates/event-reporters/runtime-reporter/serviceMonitor.yaml +++ b/charts/gitops-runtime/templates/event-reporters/runtime-reporter/serviceMonitor.yaml @@ -10,6 +10,9 @@ metadata: name: {{ include "runtime-reporter.fullname" . }} labels: {{- include "runtime-reporter.labels" . | nindent 4 }} + {{- with $context.Values.serviceMonitor.labels }} + {{- toYaml . | nindent 4 }} + {{- end }} spec: selector: matchLabels: diff --git a/charts/gitops-runtime/values.yaml b/charts/gitops-runtime/values.yaml index ba662c9b..490cfb6d 100644 --- a/charts/gitops-runtime/values.yaml +++ b/charts/gitops-runtime/values.yaml @@ -240,6 +240,8 @@ global: enabled: false interval: 30s scrapeTimeout: 10s + labels: + foo: bar config: {} # ------------------------------------------------------------------------------------------------------------------------- From 244249861f01ebd1fffbeb8015def439c6815f91 Mon Sep 17 00:00:00 2001 From: Mikhail Klimko Date: Tue, 23 Sep 2025 13:48:07 +0300 Subject: [PATCH 16/37] refactor cf-argocd-extras --- charts/gitops-runtime/values.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/charts/gitops-runtime/values.yaml b/charts/gitops-runtime/values.yaml index 490cfb6d..2b5ceebd 100644 --- a/charts/gitops-runtime/values.yaml +++ b/charts/gitops-runtime/values.yaml @@ -240,8 +240,7 @@ global: enabled: false interval: 30s scrapeTimeout: 10s - labels: - foo: bar + labels: {} config: {} # ------------------------------------------------------------------------------------------------------------------------- @@ -755,6 +754,7 @@ argo-api-gateway: enabled: false interval: 30s scrapeTimeout: 10s + labels: {} event-reporters: runtime-reporter: {} From 61aff9729edb338e366f580c9db5cb14e9d6c982 Mon Sep 17 00:00:00 2001 From: Mikhail Klimko Date: Fri, 26 Sep 2025 17:25:21 +0300 Subject: [PATCH 17/37] rename --- .../cf-argocd-extras/_default-values.tpl | 523 ------------------ .../event-reporter/_configmap.yaml | 21 - .../cf-argocd-extras/event-reporter/_pdb.yaml | 17 - .../event-reporter/_rbac.yaml | 17 - .../event-reporter/_service.yaml | 17 - .../event-reporter/_serviceMonitor.yaml | 17 - .../event-reporter/_statefulset.yaml | 45 -- .../sources-server/_configmap.yaml | 21 - .../sources-server/_deployment.yaml | 45 -- .../cf-argocd-extras/sources-server/_hpa.yaml | 17 - .../cf-argocd-extras/sources-server/_pdb.yaml | 17 - .../sources-server/_rbac.yaml | 17 - .../sources-server/_service.yaml | 17 - .../_components/event-reporters/_helpers.tpl | 156 ------ .../rollout-reporter/_event-source.yaml | 65 --- .../rollout-reporter/_rbac.yaml | 29 - .../rollout-reporter/_sensor.yaml | 50 -- .../rollout-reporter/_serviceaccount.yaml | 10 - .../workflow-reporter/_event-source.yaml | 46 -- .../workflow-reporter/_rbac.yaml | 29 - .../workflow-reporter/_sensor.yaml | 42 -- .../workflow-reporter/_serviceaccount.yaml | 10 - charts/gitops-runtime/templates/_helpers.tpl | 2 +- .../_env.yaml | 12 +- .../_helpers.tpl | 22 +- .../configmap.yaml | 10 +- .../deployment.yaml | 18 +- .../hpa.yaml | 8 +- .../pdb.yaml | 6 +- .../rbac.yaml | 18 +- .../service.yaml | 8 +- .../serviceMonitor.yaml | 8 +- .../_env.yaml | 36 +- .../_helpers.tpl | 22 +- .../configmap.yaml | 12 +- .../deployment.yaml | 18 +- .../pdb.yaml | 6 +- .../rbac.yaml | 18 +- .../service.yaml | 8 +- .../serviceMonitor.yaml | 8 +- .../_env.yaml | 38 +- .../_helpers.tpl | 22 +- .../configmap.yaml | 12 +- .../deployment.yaml | 18 +- .../pdb.yaml | 6 +- .../rbac.yaml | 18 +- .../service.yaml | 8 +- .../serviceMonitor.yaml | 8 +- .../tests/argo-api-gateway_test.yaml | 30 +- .../tests/event-reporters_test.yaml | 24 +- .../tests/external_argocd_test.yaml | 92 +-- .../tests/global_constraints_test.yaml | 30 +- .../values/subcharts-constraints-values.yaml | 2 +- charts/gitops-runtime/values.yaml | 6 +- 54 files changed, 277 insertions(+), 1505 deletions(-) delete mode 100644 charts/gitops-runtime/templates/_components/cf-argocd-extras/_default-values.tpl delete mode 100644 charts/gitops-runtime/templates/_components/cf-argocd-extras/event-reporter/_configmap.yaml delete mode 100644 charts/gitops-runtime/templates/_components/cf-argocd-extras/event-reporter/_pdb.yaml delete mode 100644 charts/gitops-runtime/templates/_components/cf-argocd-extras/event-reporter/_rbac.yaml delete mode 100644 charts/gitops-runtime/templates/_components/cf-argocd-extras/event-reporter/_service.yaml delete mode 100644 charts/gitops-runtime/templates/_components/cf-argocd-extras/event-reporter/_serviceMonitor.yaml delete mode 100644 charts/gitops-runtime/templates/_components/cf-argocd-extras/event-reporter/_statefulset.yaml delete mode 100644 charts/gitops-runtime/templates/_components/cf-argocd-extras/sources-server/_configmap.yaml delete mode 100644 charts/gitops-runtime/templates/_components/cf-argocd-extras/sources-server/_deployment.yaml delete mode 100644 charts/gitops-runtime/templates/_components/cf-argocd-extras/sources-server/_hpa.yaml delete mode 100644 charts/gitops-runtime/templates/_components/cf-argocd-extras/sources-server/_pdb.yaml delete mode 100644 charts/gitops-runtime/templates/_components/cf-argocd-extras/sources-server/_rbac.yaml delete mode 100644 charts/gitops-runtime/templates/_components/cf-argocd-extras/sources-server/_service.yaml delete mode 100644 charts/gitops-runtime/templates/_components/event-reporters/_helpers.tpl delete mode 100644 charts/gitops-runtime/templates/_components/event-reporters/rollout-reporter/_event-source.yaml delete mode 100644 charts/gitops-runtime/templates/_components/event-reporters/rollout-reporter/_rbac.yaml delete mode 100644 charts/gitops-runtime/templates/_components/event-reporters/rollout-reporter/_sensor.yaml delete mode 100644 charts/gitops-runtime/templates/_components/event-reporters/rollout-reporter/_serviceaccount.yaml delete mode 100644 charts/gitops-runtime/templates/_components/event-reporters/workflow-reporter/_event-source.yaml delete mode 100644 charts/gitops-runtime/templates/_components/event-reporters/workflow-reporter/_rbac.yaml delete mode 100644 charts/gitops-runtime/templates/_components/event-reporters/workflow-reporter/_sensor.yaml delete mode 100644 charts/gitops-runtime/templates/_components/event-reporters/workflow-reporter/_serviceaccount.yaml rename charts/gitops-runtime/templates/{argo-api-gateway => argo-gateway}/_env.yaml (90%) rename charts/gitops-runtime/templates/{argo-api-gateway => argo-gateway}/_helpers.tpl (62%) rename charts/gitops-runtime/templates/{argo-api-gateway => argo-gateway}/configmap.yaml (60%) rename charts/gitops-runtime/templates/{argo-api-gateway => argo-gateway}/deployment.yaml (85%) rename charts/gitops-runtime/templates/{argo-api-gateway => argo-gateway}/hpa.yaml (80%) rename charts/gitops-runtime/templates/{argo-api-gateway => argo-gateway}/pdb.yaml (68%) rename charts/gitops-runtime/templates/{argo-api-gateway => argo-gateway}/rbac.yaml (62%) rename charts/gitops-runtime/templates/{argo-api-gateway => argo-gateway}/service.yaml (62%) rename charts/gitops-runtime/templates/{argo-api-gateway => argo-gateway}/serviceMonitor.yaml (72%) rename charts/gitops-runtime/templates/event-reporters/{resources-reporter => cluster-event-reporter}/_env.yaml (82%) rename charts/gitops-runtime/templates/event-reporters/{resources-reporter => cluster-event-reporter}/_helpers.tpl (58%) rename charts/gitops-runtime/templates/event-reporters/{resources-reporter => cluster-event-reporter}/configmap.yaml (58%) rename charts/gitops-runtime/templates/event-reporters/{resources-reporter => cluster-event-reporter}/deployment.yaml (86%) rename charts/gitops-runtime/templates/event-reporters/{resources-reporter => cluster-event-reporter}/pdb.yaml (73%) rename charts/gitops-runtime/templates/event-reporters/{resources-reporter => cluster-event-reporter}/rbac.yaml (56%) rename charts/gitops-runtime/templates/event-reporters/{resources-reporter => cluster-event-reporter}/service.yaml (65%) rename charts/gitops-runtime/templates/event-reporters/{resources-reporter => cluster-event-reporter}/serviceMonitor.yaml (75%) rename charts/gitops-runtime/templates/event-reporters/{runtime-reporter => runtime-event-reporter}/_env.yaml (82%) rename charts/gitops-runtime/templates/event-reporters/{runtime-reporter => runtime-event-reporter}/_helpers.tpl (58%) rename charts/gitops-runtime/templates/event-reporters/{runtime-reporter => runtime-event-reporter}/configmap.yaml (64%) rename charts/gitops-runtime/templates/event-reporters/{runtime-reporter => runtime-event-reporter}/deployment.yaml (87%) rename charts/gitops-runtime/templates/event-reporters/{runtime-reporter => runtime-event-reporter}/pdb.yaml (81%) rename charts/gitops-runtime/templates/event-reporters/{runtime-reporter => runtime-event-reporter}/rbac.yaml (61%) rename charts/gitops-runtime/templates/event-reporters/{runtime-reporter => runtime-event-reporter}/service.yaml (73%) rename charts/gitops-runtime/templates/event-reporters/{runtime-reporter => runtime-event-reporter}/serviceMonitor.yaml (81%) diff --git a/charts/gitops-runtime/templates/_components/cf-argocd-extras/_default-values.tpl b/charts/gitops-runtime/templates/_components/cf-argocd-extras/_default-values.tpl deleted file mode 100644 index 37d145e2..00000000 --- a/charts/gitops-runtime/templates/_components/cf-argocd-extras/_default-values.tpl +++ /dev/null @@ -1,523 +0,0 @@ -{{- define "cf-argocd-extras.default-values" }} -global: {} - -externalRedis: - enabled: false - existingSecretKeyRef: - name: "argocd-redis" - key: "redis-password" - -eventReporter: - fullnameOverride: event-reporter - - podAnnotations: {} - - serviceAccount: - enabled: true - - rbac: - enabled: true - namespaced: false - rules: - - apiGroups: - - '*' - resources: - - '*' - verbs: - - '*' - - nonResourceURLs: - - '*' - verbs: - - '*' - - controller: - enabled: true - type: statefulset - replicas: 1 - revisionHistoryLimit: 5 - - container: - name: event-reporter - image: - registry: quay.io/codefresh - repository: cf-argocd-extras - tag: main - pullPolicy: IfNotPresent - - # these do not seem to work - ports: - - name: metrics - containerPort: 8087 - protocol: TCP - - name: health - containerPort: 8088 - protocol: TCP - - resources: - requests: - memory: 128Mi - cpu: 100m - - env: - HTTP_PROXY: '{{ .Values.global.httpProxy }}' - HTTPS_PROXY: '{{ .Values.global.httpsProxy }}' - NO_PROXY: '{{ .Values.global.noProxy }}' - APP_QUEUE_SIZE: - valueFrom: - configMapKeyRef: - name: event-reporter-cmd-params-cm - key: app.queue.size - ARGOCD_APPLICATION_NAMESPACES: - valueFrom: - configMapKeyRef: - name: argocd-cmd-params-cm - key: application.namespaces - optional: true - ARGOCD_SERVER: - valueFrom: - configMapKeyRef: - name: event-reporter-cmd-params-cm - key: argocd.server - ARGOCD_SERVER_ROOTPATH: - valueFrom: - configMapKeyRef: - name: argocd-cmd-params-cm - key: server.rootpath - optional: true - ARGO_CD_TOKEN_SECRET_NAME: argocd-token - ARGO_CD_TOKEN_SECRET_KEY: token - BINARY_NAME: event-reporter - CODEFRESH_SSL_CERT_PATH: "" - CODEFRESH_TLS_INSECURE: - valueFrom: - configMapKeyRef: - name: argocd-cmd-params-cm - key: codefresh.tls.insecure - optional: true - CODEFRESH_TOKEN: - valueFrom: - secretKeyRef: - name: codefresh-token - key: token - CODEFRESH_URL: - valueFrom: - configMapKeyRef: - key: base-url - name: codefresh-cm - EVENT_REPORTER_REPLICAS: 1 - INSECURE: - valueFrom: - configMapKeyRef: - name: event-reporter-cmd-params-cm - key: insecure - optional: true - LISTEN_ADDRESS: - valueFrom: - configMapKeyRef: - name: event-reporter-cmd-params-cm - key: listen.address - optional: true - LOG_FORMAT: - valueFrom: - configMapKeyRef: - name: event-reporter-cmd-params-cm - key: log.format - optional: true - LOG_LEVEL: - valueFrom: - configMapKeyRef: - name: event-reporter-cmd-params-cm - key: log.level - optional: true - MAX_APP_RETRIES: - valueFrom: - configMapKeyRef: - name: event-reporter-cmd-params-cm - key: max.app.retries - METRICS_LISTEN_ADDRESS: - valueFrom: - configMapKeyRef: - name: event-reporter-cmd-params-cm - key: metrics.listen.address - optional: true - OTEL_EXPORTER_OTLP_TRACES_ENDPOINT: - valueFrom: - configMapKeyRef: - name: event-reporter-cmd-params-cm - key: otlp.address - REDISDB: - valueFrom: - configMapKeyRef: - name: argocd-cmd-params-cm - key: redis.db - optional: true - REDIS_COMPRESSION: - valueFrom: - configMapKeyRef: - name: argocd-cmd-params-cm - key: redis.compression - optional: true - REDIS_PASSWORD: - valueFrom: - secretKeyRef: - name: argocd-redis - key: auth - REDIS_SERVER: - valueFrom: - configMapKeyRef: - name: argocd-cmd-params-cm - key: redis.server - REDIS_USERNAME: - valueFrom: - secretKeyRef: - name: argocd-redis - key: redis-username - optional: true - REPO_SERVER: - valueFrom: - configMapKeyRef: - name: event-reporter-cmd-params-cm - key: repo.server - REPO_SERVER_PLAINTEXT: - valueFrom: - configMapKeyRef: - name: event-reporter-cmd-params-cm - key: repo.server.plaintext - optional: true - REPO_SERVER_STRICT_TLS: - valueFrom: - configMapKeyRef: - name: event-reporter-cmd-params-cm - key: repo.server.strict.tls - optional: true - REPO_SERVER_TIMEOUT_SECONDS: - valueFrom: - configMapKeyRef: - name: event-reporter-cmd-params-cm - key: repo.server.timeout.seconds - optional: true - RUNTIME_VERSION: - valueFrom: - configMapKeyRef: - name: codefresh-cm - key: version - SHARDING_ALGORITHM: - valueFrom: - configMapKeyRef: - name: event-reporter-cmd-params-cm - key: sharding.algorithm - optional: true - SOURCES_SERVER: - valueFrom: - configMapKeyRef: - name: event-reporter-cmd-params-cm - key: sources.server - THREADINESS: - valueFrom: - configMapKeyRef: - name: event-reporter-cmd-params-cm - key: threadiness - - volumeMounts: - codefresh-tls-certs: - path: - - mountPath: /app/config/codefresh-tls-certs - readOnly: true - - probes: - liveness: - enabled: true - type: httpGet - httpGet: - path: /healthz?full=true - port: 8088 - spec: - initialDelaySeconds: 3 - periodSeconds: 30 - timeoutSeconds: 5 - successThreshold: 1 - failureThreshold: 3 - readiness: - enabled: true - type: httpGet - httpGet: - path: /healthz - port: 8088 - spec: - initialDelaySeconds: 10 - periodSeconds: 10 - timeoutSeconds: 1 - successThreshold: 1 - failureThreshold: 3 - - configMaps: - cmd-params-cm: - enabled: true - data: - app.queue.size: '1000' - argocd.server: argo-cd-server:80 - max.app.retries: '5' - otlp.address: '' - repo.server: argo-cd-repo-server:8081 - sources.server: http://sources-server - threadiness: '100' - - volumes: - codefresh-tls-certs: - enabled: true - type: secret - nameOverride: codefresh-tls-certs - optional: true - - pdb: - enabled: true - minAvailable: "50%" - maxUnavailable: "" - - service: - main: - enabled: true - type: ClusterIP - ports: - metrics: - port: 8087 - protocol: HTTP - targetPort: 8087 - - serviceMonitor: - main: - enabled: false - endpoints: - - port: metrics - scheme: http - path: /metrics - interval: 30s - scrapeTimeout: 10s - -sourcesServer: - fullnameOverride: sources-server - - serviceAccount: - enabled: true - - rbac: - enabled: true - namespaced: false - rules: - - apiGroups: - - '' - resources: - - configmaps - - secrets - verbs: - - get - - list - - watch - - apiGroups: - - '' - - apps - resources: - - deployments - - podtemplates - verbs: - - patch - - apiGroups: - - apps - resources: - - replicasets - verbs: - - list - - patch - - apiGroups: - - argoproj.io - resources: - - rollouts - - rollouts/status - verbs: - - get - - patch - - podAnnotations: {} - - controller: - enabled: true - type: deployment - revisionHistoryLimit: 3 - deployment: - strategy: RollingUpdate - rollingUpdate: - maxUnavailable: 0 - maxSurge: 50% - - hpa: - enabled: true - minReplicas: 1 - maxReplicas: 10 - targetCPUUtilizationPercentage: 70 - - keda: - enabled: false - - pdb: - enabled: true - minAvailable: "50%" - maxUnavailable: "" - - imagePullSecrets: [] - - container: - name: sources-server - image: - registry: quay.io/codefresh - repository: cf-argocd-extras - tag: main - pullPolicy: IfNotPresent - - ports: - - name: server - containerPort: 8090 - protocol: TCP - - resources: - requests: - memory: "128Mi" - cpu: "100m" - - env: - HTTP_PROXY: '{{ .Values.global.httpProxy }}' - HTTPS_PROXY: '{{ .Values.global.httpsProxy }}' - NO_PROXY: '{{ .Values.global.noProxy }}' - ARGOCD_SERVER: - valueFrom: - configMapKeyRef: - name: sources-server-cmd-params-cm - key: argocd.server - ARGO_CD_TOKEN_SECRET_NAME: argocd-token - ARGO_CD_TOKEN_SECRET_KEY: token - ARGOCD_SERVER_ROOTPATH: - valueFrom: - configMapKeyRef: - name: argocd-cmd-params-cm - key: server.rootpath - optional: true - BINARY_NAME: sources-server - CODEFRESH_SSL_CERT_PATH: "" - CODEFRESH_TLS_INSECURE: - valueFrom: - configMapKeyRef: - name: argocd-cmd-params-cm - key: codefresh.tls.insecure - optional: true - CODEFRESH_TOKEN: - valueFrom: - secretKeyRef: - key: token - name: codefresh-token - CODEFRESH_URL: - valueFrom: - configMapKeyRef: - key: base-url - name: codefresh-cm - LISTEN_ADDRESS: - valueFrom: - configMapKeyRef: - name: sources-server-cmd-params-cm - key: server.listen.address - optional: true - REDISDB: - valueFrom: - configMapKeyRef: - name: argocd-cmd-params-cm - key: redis.db - optional: true - REDIS_COMPRESSION: - valueFrom: - configMapKeyRef: - name: argocd-cmd-params-cm - key: redis.compression - optional: true - REDIS_PASSWORD: - valueFrom: - secretKeyRef: - name: argocd-redis - key: auth - REDIS_SERVER: - valueFrom: - configMapKeyRef: - name: argocd-cmd-params-cm - key: redis.server - REDIS_USERNAME: - valueFrom: - secretKeyRef: - name: argocd-redis - key: redis-username - optional: true - REPO_SERVER: - valueFrom: - configMapKeyRef: - name: sources-server-cmd-params-cm - key: repo.server - REPO_SERVER_TIMEOUT_SECONDS: - valueFrom: - configMapKeyRef: - name: sources-server-cmd-params-cm - key: repo.server.timeout.seconds - optional: true - - volumeMounts: - codefresh-tls-certs: - path: - - mountPath: /app/config/codefresh-tls-certs - readOnly: true - - probes: - liveness: - enabled: true - type: httpGet - httpGet: - path: /healthz?full=true - port: 8090 - spec: - initialDelaySeconds: 10 - periodSeconds: 10 - timeoutSeconds: 1 - successThreshold: 1 - failureThreshold: 3 - readiness: - enabled: true - type: httpGet - httpGet: - path: /healthz - port: 8090 - spec: - initialDelaySeconds: 10 - periodSeconds: 10 - timeoutSeconds: 1 - successThreshold: 1 - failureThreshold: 3 - - service: - main: - enabled: true - primary: true - type: ClusterIP - ports: - http: - port: 80 - protocol: HTTP - targetPort: 8090 - - configMaps: - cmd-params-cm: - enabled: true - data: - argocd.server: argo-cd-server:80 - repo.server: argo-cd-repo-server:8081 - - volumes: - codefresh-tls-certs: - enabled: true - type: secret - nameOverride: codefresh-tls-certs - optional: true -{{- end }} diff --git a/charts/gitops-runtime/templates/_components/cf-argocd-extras/event-reporter/_configmap.yaml b/charts/gitops-runtime/templates/_components/cf-argocd-extras/event-reporter/_configmap.yaml deleted file mode 100644 index 2cbdc16f..00000000 --- a/charts/gitops-runtime/templates/_components/cf-argocd-extras/event-reporter/_configmap.yaml +++ /dev/null @@ -1,21 +0,0 @@ -{{- define "cf-argocd-extras.event-reporter.configmap" }} - -{{- $context := deepCopy . }} - -{{- $defaultVals := include "cf-argocd-extras.default-values" . | fromYaml }} -{{- $vals := mergeOverwrite $defaultVals (get .Values "cf-argocd-extras") }} - -{{- $_ := set $context "Values" $vals.eventReporter }} -{{- $_ := set $context.Values "global" (deepCopy (get .Values "global")) }} - -{{- $_ := set (index $context.Values.configMaps "cmd-params-cm" "data") "argocd.server" (include "codefresh-gitops-runtime.argocd.server.no-protocol-url" . ) }} -{{- $_ := set (index $context.Values.configMaps "cmd-params-cm" "data") "redis.server" (include "codefresh-gitops-runtime.argocd.redis.url" . ) }} -{{- $_ := set (index $context.Values.configMaps "cmd-params-cm" "data") "repo.server" (include "codefresh-gitops-runtime.argocd.reposerver.url" . ) }} - -{{/* Workaround to NOT change label selectors from previous runtime release when event-reporter was part of cf-argocd-extras Subchart */}} -{{- $_ := set $context.Values "nameOverride" "cf-argocd-extras" }} - -{{- $templateName := printf "cf-common-%s.configmaps" (index .Subcharts "cf-common").Chart.Version }} -{{- include $templateName $context }} - -{{- end }} diff --git a/charts/gitops-runtime/templates/_components/cf-argocd-extras/event-reporter/_pdb.yaml b/charts/gitops-runtime/templates/_components/cf-argocd-extras/event-reporter/_pdb.yaml deleted file mode 100644 index bc6004d0..00000000 --- a/charts/gitops-runtime/templates/_components/cf-argocd-extras/event-reporter/_pdb.yaml +++ /dev/null @@ -1,17 +0,0 @@ -{{- define "cf-argocd-extras.event-reporter.pdb" }} - -{{- $context := deepCopy . }} - -{{- $defaultVals := include "cf-argocd-extras.default-values" . | fromYaml }} -{{- $vals := mergeOverwrite $defaultVals (get .Values "cf-argocd-extras") }} - -{{- $_ := set $context "Values" $vals.eventReporter }} -{{- $_ := set $context.Values "global" (deepCopy (get .Values "global")) }} - -{{/* Workaround to NOT change label selectors from previous runtime release when event-reporter was part of cf-argocd-extras Subchart */}} -{{- $_ := set $context.Values "nameOverride" "cf-argocd-extras" }} - -{{- $templateName := printf "cf-common-%s.pdb" (index .Subcharts "cf-common").Chart.Version }} -{{- include $templateName $context }} - -{{- end }} diff --git a/charts/gitops-runtime/templates/_components/cf-argocd-extras/event-reporter/_rbac.yaml b/charts/gitops-runtime/templates/_components/cf-argocd-extras/event-reporter/_rbac.yaml deleted file mode 100644 index 64cd6d27..00000000 --- a/charts/gitops-runtime/templates/_components/cf-argocd-extras/event-reporter/_rbac.yaml +++ /dev/null @@ -1,17 +0,0 @@ -{{- define "cf-argocd-extras.event-reporter.rbac" }} - -{{- $context := deepCopy . }} - -{{- $defaultVals := include "cf-argocd-extras.default-values" . | fromYaml }} -{{- $vals := mergeOverwrite $defaultVals (get .Values "cf-argocd-extras") }} - -{{- $_ := set $context "Values" $vals.eventReporter }} -{{- $_ := set $context.Values "global" (deepCopy (get .Values "global")) }} - -{{/* Workaround to NOT change label selectors from previous runtime release when event-reporter was part of cf-argocd-extras Subchart */}} -{{- $_ := set $context.Values "nameOverride" "cf-argocd-extras" }} - -{{- $templateName := printf "cf-common-%s.rbac" (index .Subcharts "cf-common").Chart.Version }} -{{- include $templateName $context }} - -{{- end }} diff --git a/charts/gitops-runtime/templates/_components/cf-argocd-extras/event-reporter/_service.yaml b/charts/gitops-runtime/templates/_components/cf-argocd-extras/event-reporter/_service.yaml deleted file mode 100644 index a800535e..00000000 --- a/charts/gitops-runtime/templates/_components/cf-argocd-extras/event-reporter/_service.yaml +++ /dev/null @@ -1,17 +0,0 @@ -{{- define "cf-argocd-extras.event-reporter.service" }} - -{{- $context := deepCopy . }} - -{{- $defaultVals := include "cf-argocd-extras.default-values" . | fromYaml }} -{{- $vals := mergeOverwrite $defaultVals (get .Values "cf-argocd-extras") }} - -{{- $_ := set $context "Values" $vals.eventReporter }} -{{- $_ := set $context.Values "global" (deepCopy (get .Values "global")) }} - -{{/* Workaround to NOT change label selectors from previous runtime release when event-reporter was part of cf-argocd-extras Subchart */}} -{{- $_ := set $context.Values "nameOverride" "cf-argocd-extras" }} - -{{- $templateName := printf "cf-common-%s.service" (index .Subcharts "cf-common").Chart.Version }} -{{- include $templateName $context }} - -{{- end }} diff --git a/charts/gitops-runtime/templates/_components/cf-argocd-extras/event-reporter/_serviceMonitor.yaml b/charts/gitops-runtime/templates/_components/cf-argocd-extras/event-reporter/_serviceMonitor.yaml deleted file mode 100644 index 015929d9..00000000 --- a/charts/gitops-runtime/templates/_components/cf-argocd-extras/event-reporter/_serviceMonitor.yaml +++ /dev/null @@ -1,17 +0,0 @@ -{{- define "cf-argocd-extras.event-reporter.serviceMonitor" }} - -{{- $context := deepCopy . }} - -{{- $defaultVals := include "cf-argocd-extras.default-values" . | fromYaml }} -{{- $vals := mergeOverwrite $defaultVals (get .Values "cf-argocd-extras") }} - -{{- $_ := set $context "Values" $vals.eventReporter }} -{{- $_ := set $context.Values "global" (deepCopy (get .Values "global")) }} - -{{/* Workaround to NOT change label selectors from previous runtime release when event-reporter was part of cf-argocd-extras Subchart */}} -{{- $_ := set $context.Values "nameOverride" "cf-argocd-extras" }} - -{{- $templateName := printf "cf-common-%s.serviceMonitor" (index .Subcharts "cf-common").Chart.Version }} -{{- include $templateName $context }} - -{{- end }} diff --git a/charts/gitops-runtime/templates/_components/cf-argocd-extras/event-reporter/_statefulset.yaml b/charts/gitops-runtime/templates/_components/cf-argocd-extras/event-reporter/_statefulset.yaml deleted file mode 100644 index ccbadd63..00000000 --- a/charts/gitops-runtime/templates/_components/cf-argocd-extras/event-reporter/_statefulset.yaml +++ /dev/null @@ -1,45 +0,0 @@ -{{- define "cf-argocd-extras.event-reporter.statefulset" }} - -{{- $context := deepCopy . }} - -{{- $defaultVals := include "cf-argocd-extras.default-values" . | fromYaml }} -{{- $vals := mergeOverwrite $defaultVals (get .Values "cf-argocd-extras") }} - -{{- $_ := set $context "Values" $vals.eventReporter }} -{{- $_ := set $context.Values "global" (deepCopy (get .Values "global")) }} - -{{- $_ := set $context.Values.podAnnotations "checksum/config" (include (print $.Template.BasePath "/cf-argocd-extras/event-reporter/configmap.yaml") . | sha256sum) }} - -{{- if $vals.externalRedis.enabled }} - {{- $_ := set $context.Values.container.env.REDIS_PASSWORD.valueFrom.secretKeyRef "name" (default "argocd-redis" $vals.externalRedis.existingSecretKeyRef.name) }} - {{- $_ := set $context.Values.container.env.REDIS_PASSWORD.valueFrom.secretKeyRef "key" (default "redis-password" $vals.externalRedis.existingSecretKeyRef.key) }} -{{- end }} - -{{- if and (eq (index $context.Values "global" "external-argo-cd" "auth" "type") "token") }} - {{- if not (index $context.Values "global" "external-argo-cd" "auth" "token") }} - {{- $_ := set $context.Values.container.env "ARGO_CD_TOKEN_SECRET_NAME" (required ".Values.global.external-argo-cd.auth.type is set to 'token' therefore .Values.global.external-argo-cd.auth.tokenSecretKeyRef.name is required" (index $context.Values "global" "external-argo-cd" "auth" "tokenSecretKeyRef" "name")) }} - {{- $_ := set $context.Values.container.env "ARGO_CD_TOKEN_SECRET_KEY" (required ".Values.global.external-argo-cd.auth.type is set to 'token' therefore .Values.global.external-argo-cd.auth.tokenSecretKeyRef.key is required" (index $context.Values "global" "external-argo-cd" "auth" "tokenSecretKeyRef" "key" )) }} - {{- else }} - {{- $_ := set $context.Values.container.env "ARGO_CD_TOKEN_SECRET_NAME" "gitops-runtime-argo-cd-token" }} - {{- $_ := set $context.Values.container.env "ARGO_CD_TOKEN_SECRET_KEY" "token" }} - {{- end }} -{{- end }} - -{{- if and (index $context.Values "global" "external-argo-cd" "server" "rootpath") }} - {{- $_ := set $context.Values.container.env "ARGOCD_SERVER_ROOTPATH" (index $context.Values "global" "external-argo-cd" "server" "rootpath") }} -{{- end }} - -{{- if or $context.Values.global.codefresh.tls.caCerts.secret.create $context.Values.global.codefresh.tls.caCerts.secretKeyRef }} - {{- $secretName := $context.Values.global.codefresh.tls.caCerts.secretKeyRef.name | default "codefresh-tls-certs" }} - {{- $secretKey := $context.Values.global.codefresh.tls.caCerts.secret.create | ternary (default "ca-bundle.crt" $context.Values.global.codefresh.tls.caCerts.secret.key) $context.Values.global.codefresh.tls.caCerts.secretKeyRef.key }} - {{- $_ := set $context.Values.container.env "CODEFRESH_SSL_CERT_PATH" (printf "/app/config/codefresh-tls-certs/%s" $secretKey ) }} - {{- $_ := set (index $context.Values.volumes "codefresh-tls-certs") "nameOverride" $secretName }} -{{- end }} - -{{/* Workaround to NOT change label selectors from previous runtime release when event-reporter was part of cf-argocd-extras Subchart */}} -{{- $_ := set $context.Values "nameOverride" "cf-argocd-extras" }} - -{{- $templateName := printf "cf-common-%s.controller" (index .Subcharts "cf-common").Chart.Version -}} -{{- include $templateName $context -}} - -{{- end }} diff --git a/charts/gitops-runtime/templates/_components/cf-argocd-extras/sources-server/_configmap.yaml b/charts/gitops-runtime/templates/_components/cf-argocd-extras/sources-server/_configmap.yaml deleted file mode 100644 index c7e0cb4e..00000000 --- a/charts/gitops-runtime/templates/_components/cf-argocd-extras/sources-server/_configmap.yaml +++ /dev/null @@ -1,21 +0,0 @@ -{{- define "cf-argocd-extras.sources-server.configmap" }} - -{{- $context := deepCopy . }} - -{{- $defaultVals := include "cf-argocd-extras.default-values" . | fromYaml }} -{{- $vals := mergeOverwrite $defaultVals (get .Values "cf-argocd-extras") }} - -{{- $_ := set $context "Values" $vals.sourcesServer }} -{{- $_ := set $context.Values "global" (deepCopy (get .Values "global")) }} - -{{- $_ := set (index $context.Values.configMaps "cmd-params-cm" "data") "argocd.server" (include "codefresh-gitops-runtime.argocd.server.no-protocol-url" . ) }} -{{- $_ := set (index $context.Values.configMaps "cmd-params-cm" "data") "redis.server" (include "codefresh-gitops-runtime.argocd.redis.url" . ) }} -{{- $_ := set (index $context.Values.configMaps "cmd-params-cm" "data") "repo.server" (include "codefresh-gitops-runtime.argocd.reposerver.url" . ) }} - -{{/* Workaround to NOT change label selectors from previous runtime release when sources-server was part of cf-argocd-extras Subchart */}} -{{- $_ := set $context.Values "nameOverride" "cf-argocd-extras" }} - -{{- $templateName := printf "cf-common-%s.configmaps" (index .Subcharts "cf-common").Chart.Version }} -{{- include $templateName $context }} - -{{- end }} diff --git a/charts/gitops-runtime/templates/_components/cf-argocd-extras/sources-server/_deployment.yaml b/charts/gitops-runtime/templates/_components/cf-argocd-extras/sources-server/_deployment.yaml deleted file mode 100644 index 16c67b92..00000000 --- a/charts/gitops-runtime/templates/_components/cf-argocd-extras/sources-server/_deployment.yaml +++ /dev/null @@ -1,45 +0,0 @@ -{{- define "cf-argocd-extras.sources-server.deployment" }} - -{{- $context := deepCopy . }} - -{{- $defaultVals := include "cf-argocd-extras.default-values" . | fromYaml }} -{{- $vals := mergeOverwrite $defaultVals (get .Values "cf-argocd-extras") }} - -{{- $_ := set $context "Values" $vals.sourcesServer }} -{{- $_ := set $context.Values "global" (deepCopy (get .Values "global")) }} - -{{- $_ := set $context.Values.podAnnotations "checksum/config" (include (print $.Template.BasePath "/cf-argocd-extras/sources-server/configmap.yaml") . | sha256sum) }} - -{{- if $vals.externalRedis.enabled }} - {{- $_ := set $context.Values.container.env.REDIS_PASSWORD.valueFrom.secretKeyRef "name" (default "argocd-redis" $vals.externalRedis.existingSecretKeyRef.name) }} - {{- $_ := set $context.Values.container.env.REDIS_PASSWORD.valueFrom.secretKeyRef "key" (default "redis-password" $vals.externalRedis.existingSecretKeyRef.key) }} -{{- end }} - -{{- if and (eq (index $context.Values "global" "external-argo-cd" "auth" "type") "token") }} - {{- if not (index $context.Values "global" "external-argo-cd" "auth" "token") }} - {{- $_ := set $context.Values.container.env "ARGO_CD_TOKEN_SECRET_NAME" (required ".Values.global.external-argo-cd.auth.type is set to 'token' therefore .Values.global.external-argo-cd.auth.tokenSecretKeyRef.name is required" (index $context.Values "global" "external-argo-cd" "auth" "tokenSecretKeyRef" "name")) }} - {{- $_ := set $context.Values.container.env "ARGO_CD_TOKEN_SECRET_KEY" (required ".Values.global.external-argo-cd.auth.type is set to 'token' therefore .Values.global.external-argo-cd.auth.tokenSecretKeyRef.key is required" (index $context.Values "global" "external-argo-cd" "auth" "tokenSecretKeyRef" "key" )) }} - {{- else }} - {{- $_ := set $context.Values.container.env "ARGO_CD_TOKEN_SECRET_NAME" "gitops-runtime-argo-cd-token" }} - {{- $_ := set $context.Values.container.env "ARGO_CD_TOKEN_SECRET_KEY" "token" }} - {{- end }} -{{- end }} - -{{- if and (index $context.Values "global" "external-argo-cd" "server" "rootpath") }} - {{- $_ := set $context.Values.container.env "ARGOCD_SERVER_ROOTPATH" (index $context.Values "global" "external-argo-cd" "server" "rootpath") }} -{{- end }} - -{{- if or $context.Values.global.codefresh.tls.caCerts.secret.create $context.Values.global.codefresh.tls.caCerts.secretKeyRef }} - {{- $secretName := $context.Values.global.codefresh.tls.caCerts.secretKeyRef.name | default "codefresh-tls-certs" }} - {{- $secretKey := $context.Values.global.codefresh.tls.caCerts.secret.create | ternary (default "ca-bundle.crt" $context.Values.global.codefresh.tls.caCerts.secret.key) $context.Values.global.codefresh.tls.caCerts.secretKeyRef.key }} - {{- $_ := set $context.Values.container.env "CODEFRESH_SSL_CERT_PATH" (printf "/app/config/codefresh-tls-certs/%s" $secretKey ) }} - {{- $_ := set (index $context.Values.volumes "codefresh-tls-certs") "nameOverride" $secretName }} -{{- end }} - -{{/* Workaround to NOT change label selectors from previous runtime release when sources-server was part of cf-argocd-extras Subchart */}} -{{- $_ := set $context.Values "nameOverride" "cf-argocd-extras" }} - -{{- $templateName := printf "cf-common-%s.controller" (index .Subcharts "cf-common").Chart.Version -}} -{{- include $templateName $context -}} - -{{- end }} diff --git a/charts/gitops-runtime/templates/_components/cf-argocd-extras/sources-server/_hpa.yaml b/charts/gitops-runtime/templates/_components/cf-argocd-extras/sources-server/_hpa.yaml deleted file mode 100644 index 2a54b442..00000000 --- a/charts/gitops-runtime/templates/_components/cf-argocd-extras/sources-server/_hpa.yaml +++ /dev/null @@ -1,17 +0,0 @@ -{{- define "cf-argocd-extras.sources-server.hpa" }} - -{{- $context := deepCopy . }} - -{{- $defaultVals := include "cf-argocd-extras.default-values" . | fromYaml }} -{{- $vals := mergeOverwrite $defaultVals (get .Values "cf-argocd-extras") }} - -{{- $_ := set $context "Values" $vals.sourcesServer }} -{{- $_ := set $context.Values "global" (deepCopy (get .Values "global")) }} - -{{/* Workaround to NOT change label selectors from previous runtime release when sources-server was part of cf-argocd-extras Subchart */}} -{{- $_ := set $context.Values "nameOverride" "cf-argocd-extras" }} - -{{- $templateName := printf "cf-common-%s.hpa" (index .Subcharts "cf-common").Chart.Version }} -{{- include $templateName $context }} - -{{- end }} diff --git a/charts/gitops-runtime/templates/_components/cf-argocd-extras/sources-server/_pdb.yaml b/charts/gitops-runtime/templates/_components/cf-argocd-extras/sources-server/_pdb.yaml deleted file mode 100644 index a43be587..00000000 --- a/charts/gitops-runtime/templates/_components/cf-argocd-extras/sources-server/_pdb.yaml +++ /dev/null @@ -1,17 +0,0 @@ -{{- define "cf-argocd-extras.sources-server.pdb" }} - -{{- $context := deepCopy . }} - -{{- $defaultVals := include "cf-argocd-extras.default-values" . | fromYaml }} -{{- $vals := mergeOverwrite $defaultVals (get .Values "cf-argocd-extras") }} - -{{- $_ := set $context "Values" $vals.sourcesServer }} -{{- $_ := set $context.Values "global" (deepCopy (get .Values "global")) }} - -{{/* Workaround to NOT change label selectors from previous runtime release when sources-server was part of cf-argocd-extras Subchart */}} -{{- $_ := set $context.Values "nameOverride" "cf-argocd-extras" }} - -{{- $templateName := printf "cf-common-%s.pdb" (index .Subcharts "cf-common").Chart.Version }} -{{- include $templateName $context }} - -{{- end }} diff --git a/charts/gitops-runtime/templates/_components/cf-argocd-extras/sources-server/_rbac.yaml b/charts/gitops-runtime/templates/_components/cf-argocd-extras/sources-server/_rbac.yaml deleted file mode 100644 index 2afcec02..00000000 --- a/charts/gitops-runtime/templates/_components/cf-argocd-extras/sources-server/_rbac.yaml +++ /dev/null @@ -1,17 +0,0 @@ -{{- define "cf-argocd-extras.sources-server.rbac" }} - -{{- $context := deepCopy . }} - -{{- $defaultVals := include "cf-argocd-extras.default-values" . | fromYaml }} -{{- $vals := mergeOverwrite $defaultVals (get .Values "cf-argocd-extras") }} - -{{- $_ := set $context "Values" $vals.sourcesServer }} -{{- $_ := set $context.Values "global" (deepCopy (get .Values "global")) }} - -{{/* Workaround to NOT change label selectors from previous runtime release when sources-server was part of cf-argocd-extras Subchart */}} -{{- $_ := set $context.Values "nameOverride" "cf-argocd-extras" }} - -{{- $templateName := printf "cf-common-%s.rbac" (index .Subcharts "cf-common").Chart.Version }} -{{- include $templateName $context }} - -{{- end }} diff --git a/charts/gitops-runtime/templates/_components/cf-argocd-extras/sources-server/_service.yaml b/charts/gitops-runtime/templates/_components/cf-argocd-extras/sources-server/_service.yaml deleted file mode 100644 index ea16d7a6..00000000 --- a/charts/gitops-runtime/templates/_components/cf-argocd-extras/sources-server/_service.yaml +++ /dev/null @@ -1,17 +0,0 @@ -{{- define "cf-argocd-extras.sources-server.service" }} - -{{- $context := deepCopy . }} - -{{- $defaultVals := include "cf-argocd-extras.default-values" . | fromYaml }} -{{- $vals := mergeOverwrite $defaultVals (get .Values "cf-argocd-extras") }} - -{{- $_ := set $context "Values" $vals.sourcesServer }} -{{- $_ := set $context.Values "global" (deepCopy (get .Values "global")) }} - -{{/* Workaround to NOT change label selectors from previous runtime release when sources-server was part of cf-argocd-extras Subchart */}} -{{- $_ := set $context.Values "nameOverride" "cf-argocd-extras" }} - -{{- $templateName := printf "cf-common-%s.service" (index .Subcharts "cf-common").Chart.Version }} -{{- include $templateName $context }} - -{{- end }} diff --git a/charts/gitops-runtime/templates/_components/event-reporters/_helpers.tpl b/charts/gitops-runtime/templates/_components/event-reporters/_helpers.tpl deleted file mode 100644 index 5e6b9fd4..00000000 --- a/charts/gitops-runtime/templates/_components/event-reporters/_helpers.tpl +++ /dev/null @@ -1,156 +0,0 @@ -{{/* -Create chart name and version as used by the chart label. -*/}} -{{- define "event-reporters.chart" -}} -{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} -{{- end }} - -{{/* -Expand the name of the chart. -*/}} -{{- define "event-reporters.rollout-reporter.name" -}} -{{- print "rollout-reporter"}} -{{- end }} - -{{/* -Create a default fully qualified app name. -We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). -If release name contains chart name it will be used as a full name. -*/}} -{{- define "event-reporters.rollout-reporter.fullname" -}} -{{- print "rollout-reporter"}} -{{- end }} - -{{/* -Common labels -*/}} -{{- define "event-reporters.rollout-reporter.labels" -}} -helm.sh/chart: {{ include "event-reporters.chart" . }} -{{ include "event-reporters.rollout-reporter.selectorLabels" . }} -{{- if .Chart.AppVersion }} -app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} -{{- end }} -app.kubernetes.io/managed-by: Helm -codefresh.io/internal: "true" -{{- end }} - -{{/* -Selector labels -*/}} -{{- define "event-reporters.rollout-reporter.selectorLabels" -}} -app.kubernetes.io/part-of: rollout-reporter -{{- end }} - -{{/* -Create the name of the service account to use -*/}} -{{- define "event-reporters.rollout-reporter.serviceAccountName" -}} - {{- if .Values.rollout.serviceAccount.create }} - {{- default (include "event-reporters.rollout-reporter.fullname" .) .Values.rollout.serviceAccount.name }} - {{- else }} - {{- default "default" .Values.rollout.serviceAccount.name }} - {{- end }} -{{- end }} - -{{/* -Expand the name of the chart. -*/}} -{{- define "event-reporters.workflow-reporter.name" -}} -{{- print "workflow-reporter"}} -{{- end }} - -{{/* -Create a default fully qualified app name. -We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). -If release name contains chart name it will be used as a full name. -*/}} -{{- define "event-reporters.workflow-reporter.fullname" -}} -{{- print "workflow-reporter"}} -{{- end }} - -{{/* -Common labels -*/}} -{{- define "event-reporters.workflow-reporter.labels" -}} -helm.sh/chart: {{ include "event-reporters.chart" . }} -{{ include "event-reporters.workflow-reporter.selectorLabels" . }} -{{- if .Chart.AppVersion }} -app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} -{{- end }} -app.kubernetes.io/managed-by: Helm -codefresh.io/internal: "true" -{{- end }} - -{{/* -Selector labels -*/}} -{{- define "event-reporters.workflow-reporter.selectorLabels" -}} -app.kubernetes.io/part-of: workflow-reporter -{{- end }} - -{{/* -Create the name of the service account to use -*/}} -{{- define "event-reporters.workflow-reporter.serviceAccountName" -}} - {{- if .Values.workflow.serviceAccount.create }} - {{- default "codefresh-sa" .Values.workflow.serviceAccount.name }} - {{- else }} - {{- default "default" .Values.workflow.serviceAccount.name }} - {{- end }} -{{- end }} - -{{/* -Create a single event-source sensor http trigger -assumes the name, condition and payload.dependencyName are identical -*/}} -{{- define "event-reporters.http.trigger" -}} -{{- $url := (printf "%s%s" .Values.global.codefresh.url .Values.global.codefresh.apiEventsPath | quote) -}} -- template: - name: {{ .name }} - conditions: {{ .name }} - http: - method: POST - url: {{ $url }} - {{- if or .Values.global.codefresh.tls.caCerts.secret.create .Values.global.codefresh.tls.caCerts.secretKeyRef}} - tls: - caCertSecret: - name: {{ .Values.global.codefresh.tls.caCerts.secret.create | ternary "codefresh-tls-certs" .Values.global.codefresh.tls.caCerts.secretKeyRef.name }} - key: {{ .Values.global.codefresh.tls.caCerts.secret.create | ternary (default "ca-bundle.crt" .Values.global.codefresh.tls.caCerts.secret.key) .Values.global.codefresh.tls.caCerts.secretKeyRef.key }} - {{- end }} - headers: - Content-Type: application/json - secureHeaders: - - name: Authorization - valueFrom: - secretKeyRef: - key: token - name: codefresh-token - payload: - - dest: {{ .payloadDest }} - src: - dataKey: body - dependencyName: {{ .name }} - atLeastOnce: {{ .atLeastOnce }} - {{- if .retryStrategy }} - retryStrategy: - {{- .retryStrategy | toYaml | nindent 4 }} - {{- end }} - {{- if .policy }} - policy: - {{- .policy | toYaml | nindent 4 }} - {{- end }} -{{- end -}} - -{{/* Logging trigger for the sensor - gets sensor.logging dict */}} -{{- define "event-reporters.log.trigger" -}} - {{- if .enabled }} -- template: - name: log-trigger - {{- if gt (int .intervalSeconds) 0 }} - log: - intervalSeconds: {{ .intervalSeconds }} - {{- else }} - log: {} - {{- end }} - {{- end }} -{{- end }} diff --git a/charts/gitops-runtime/templates/_components/event-reporters/rollout-reporter/_event-source.yaml b/charts/gitops-runtime/templates/_components/event-reporters/rollout-reporter/_event-source.yaml deleted file mode 100644 index b5b5bad1..00000000 --- a/charts/gitops-runtime/templates/_components/event-reporters/rollout-reporter/_event-source.yaml +++ /dev/null @@ -1,65 +0,0 @@ -{{- define "event-reporters.rollout-reporter.eventsource"}} -apiVersion: argoproj.io/v1alpha1 -kind: EventSource -metadata: - name: rollout-reporter - labels: - {{- include "event-reporters.rollout-reporter.labels" . | nindent 4}} -spec: - replicas: {{ .Values.rollout.eventSource.replicas }} - eventBusName: {{ include "codefresh-gitops-runtime.eventbus.name" .Values.global.runtime.eventBus }} - resource: - analysisruns: - eventTypes: - - ADD - - UPDATE - - DELETE - filter: - createdBy: null - group: argoproj.io - resource: analysisruns - version: v1alpha1 - replicasets: - eventTypes: - - ADD - - UPDATE - - DELETE - filter: - createdBy: null - group: apps - resource: replicasets - version: v1 - rollouts: - eventTypes: - - ADD - - UPDATE - - DELETE - filter: - createdBy: null - group: argoproj.io - resource: rollouts - version: v1alpha1 - template: - metadata: - labels: - app.kubernetes.io/name: rollout-reporter-eventsource - container: - name: "" - resources: - {{- with .Values.rollout.eventSource.resources }} - {{- . | toYaml | nindent 8 }} - {{- end }} - serviceAccountName: {{ include "event-reporters.rollout-reporter.serviceAccountName" .}} - tolerations: - {{- with .Values.rollout.eventSource.tolerations | default .Values.global.tolerations }} - {{- . | toYaml | nindent 6 }} - {{- end }} - nodeSelector: - {{- with .Values.rollout.eventSource.nodeSelector | default .Values.global.nodeSelector }} - {{- . | toYaml | nindent 6 }} - {{- end }} - affinity: - {{- with .Values.affinity }} - {{- . | toYaml | nindent 6 }} - {{- end }} -{{- end }} diff --git a/charts/gitops-runtime/templates/_components/event-reporters/rollout-reporter/_rbac.yaml b/charts/gitops-runtime/templates/_components/event-reporters/rollout-reporter/_rbac.yaml deleted file mode 100644 index f7d12017..00000000 --- a/charts/gitops-runtime/templates/_components/event-reporters/rollout-reporter/_rbac.yaml +++ /dev/null @@ -1,29 +0,0 @@ -{{- define "event-reporters.rollout-reporter.rbac"}} -apiVersion: rbac.authorization.k8s.io/v1 -kind: Role -metadata: - name: rollout-reporter-sa - labels: - {{- include "event-reporters.rollout-reporter.labels" . | nindent 4}} -rules: - - apiGroups: - - "*" - resources: - - "*" - verbs: - - "*" ---- -apiVersion: rbac.authorization.k8s.io/v1 -kind: RoleBinding -metadata: - name: rollout-reporter-sa - labels: - {{- include "event-reporters.rollout-reporter.labels" . | nindent 4}} -roleRef: - apiGroup: "" - kind: Role - name: rollout-reporter-sa -subjects: - - kind: ServiceAccount - name: {{ include "event-reporters.rollout-reporter.serviceAccountName" . }} -{{- end }} \ No newline at end of file diff --git a/charts/gitops-runtime/templates/_components/event-reporters/rollout-reporter/_sensor.yaml b/charts/gitops-runtime/templates/_components/event-reporters/rollout-reporter/_sensor.yaml deleted file mode 100644 index 3021fbd2..00000000 --- a/charts/gitops-runtime/templates/_components/event-reporters/rollout-reporter/_sensor.yaml +++ /dev/null @@ -1,50 +0,0 @@ -{{- define "event-reporters.rollout-reporter.sensor"}} -apiVersion: argoproj.io/v1alpha1 -kind: Sensor -metadata: - name: rollout-reporter - labels: - {{- include "event-reporters.rollout-reporter.labels" . | nindent 4 }} -spec: - replicas: {{ .Values.rollout.sensor.replicas }} - dependencies: - - name: rollouts - eventSourceName: rollout-reporter - eventName: rollouts - - name: replicasets - eventSourceName: rollout-reporter - eventName: replicasets - - name: analysisruns - eventSourceName: rollout-reporter - eventName: analysisruns - eventBusName: {{ include "codefresh-gitops-runtime.eventbus.name" .Values.global.runtime.eventBus }} - template: - metadata: - labels: - app.kubernetes.io/name: rollout-reporter-sensor - serviceAccountName: {{ include "event-reporters.rollout-reporter.serviceAccountName" .}} - container: - name: "" - {{- include "codefresh-gitops-runtime.components.common_helpers.container-templates.env-vars" .Values.rollout.sensor.env | nindent 6 }} - resources: - {{- with .Values.rollout.sensor.resources }} - {{- . | toYaml | nindent 8 }} - {{- end }} - tolerations: - {{- with .Values.rollout.sensor.tolerations | default .Values.global.tolerations }} - {{- . | toYaml | nindent 6 }} - {{- end }} - nodeSelector: - {{- with .Values.rollout.sensor.nodeSelector | default .Values.global.nodeSelector}} - {{- . | toYaml | nindent 6 }} - {{- end }} - affinity: - {{- with .Values.affinity }} - {{- . | toYaml | nindent 6 }} - {{- end }} - triggers: - {{- include "event-reporters.http.trigger" (dict "name" "rollouts" "Values" .Values "payloadDest" "data.object" "retryStrategy" .Values.rollout.sensor.retryStrategy "policy" .Values.rollout.sensor.policy "atLeastOnce" .Values.rollout.sensor.atLeastOnce) | nindent 4 }} - {{- include "event-reporters.http.trigger" (dict "name" "replicasets" "Values" .Values "payloadDest" "data.object" "retryStrategy" .Values.rollout.sensor.retryStrategy "policy" .Values.rollout.sensor.policy "atLeastOnce" .Values.rollout.sensor.atLeastOnce) | nindent 4 }} - {{- include "event-reporters.http.trigger" (dict "name" "analysisruns" "Values" .Values "payloadDest" "data.object" "retryStrategy" .Values.rollout.sensor.retryStrategy "policy" .Values.rollout.sensor.policy "atLeastOnce" .Values.rollout.sensor.atLeastOnce) | nindent 4 }} - {{- include "event-reporters.log.trigger" (.Values.rollout.sensor.logging) | nindent 4 }} -{{- end }} diff --git a/charts/gitops-runtime/templates/_components/event-reporters/rollout-reporter/_serviceaccount.yaml b/charts/gitops-runtime/templates/_components/event-reporters/rollout-reporter/_serviceaccount.yaml deleted file mode 100644 index 1d2ae3f8..00000000 --- a/charts/gitops-runtime/templates/_components/event-reporters/rollout-reporter/_serviceaccount.yaml +++ /dev/null @@ -1,10 +0,0 @@ -{{- define "event-reporters.rollout-reporter.sa"}} - {{- if .Values.rollout.serviceAccount.create }} -apiVersion: v1 -kind: ServiceAccount -metadata: - name: {{ include "event-reporters.rollout-reporter.serviceAccountName" .}} - labels: - {{- include "event-reporters.rollout-reporter.labels" . | nindent 4 }} - {{- end }} -{{- end }} \ No newline at end of file diff --git a/charts/gitops-runtime/templates/_components/event-reporters/workflow-reporter/_event-source.yaml b/charts/gitops-runtime/templates/_components/event-reporters/workflow-reporter/_event-source.yaml deleted file mode 100644 index 97c6011d..00000000 --- a/charts/gitops-runtime/templates/_components/event-reporters/workflow-reporter/_event-source.yaml +++ /dev/null @@ -1,46 +0,0 @@ -{{- define "event-reporters.workflow-reporter.eventsource"}} -apiVersion: argoproj.io/v1alpha1 -kind: EventSource -metadata: - name: workflow-reporter - labels: - {{- include "event-reporters.workflow-reporter.labels" . | nindent 4 }} -spec: - replicas: {{ .Values.workflow.eventSource.replicas }} - eventBusName: {{ include "codefresh-gitops-runtime.eventbus.name" .Values.global.runtime.eventBus }} - resource: - workflows: - eventTypes: - - ADD - - UPDATE - - DELETE - filter: - createdBy: null - namespace: {{ .Release.Namespace }} - group: argoproj.io - resource: workflows - version: v1alpha1 - template: - metadata: - labels: - app.kubernetes.io/name: workflow-reporter-eventsource - container: - name: "" - resources: - {{- with .Values.workflow.eventSource.resources }} - {{- . | toYaml | nindent 8 }} - {{- end }} - serviceAccountName: {{ include "event-reporters.workflow-reporter.serviceAccountName" .}} - tolerations: - {{- with .Values.workflow.eventSource.tolerations | default .Values.global.tolerations }} - {{- toYaml . | nindent 6 }} - {{- end }} - nodeSelector: - {{- with .Values.workflow.eventSource.nodeSelector | default .Values.global.nodeSelector }} - {{- toYaml . | nindent 6 }} - {{- end }} - affinity: - {{- with .Values.affinity }} - {{- toYaml . | nindent 6 }} - {{- end }} -{{- end }} diff --git a/charts/gitops-runtime/templates/_components/event-reporters/workflow-reporter/_rbac.yaml b/charts/gitops-runtime/templates/_components/event-reporters/workflow-reporter/_rbac.yaml deleted file mode 100644 index 3ca63fc7..00000000 --- a/charts/gitops-runtime/templates/_components/event-reporters/workflow-reporter/_rbac.yaml +++ /dev/null @@ -1,29 +0,0 @@ -{{- define "event-reporters.workflow-reporter.rbac"}} -apiVersion: rbac.authorization.k8s.io/v1 -kind: Role -metadata: - name: workflow-reporter - labels: - {{- include "event-reporters.workflow-reporter.labels" . | nindent 4 }} -rules: - - apiGroups: - - "*" - resources: - - "*" - verbs: - - "*" ---- -apiVersion: rbac.authorization.k8s.io/v1 -kind: RoleBinding -metadata: - name: workflow-reporter - labels: - {{- include "event-reporters.workflow-reporter.labels" . | nindent 4 }} -roleRef: - apiGroup: "" - kind: Role - name: workflow-reporter -subjects: - - kind: ServiceAccount - name: {{ include "event-reporters.workflow-reporter.serviceAccountName" .}} -{{- end }} diff --git a/charts/gitops-runtime/templates/_components/event-reporters/workflow-reporter/_sensor.yaml b/charts/gitops-runtime/templates/_components/event-reporters/workflow-reporter/_sensor.yaml deleted file mode 100644 index 6a5206d6..00000000 --- a/charts/gitops-runtime/templates/_components/event-reporters/workflow-reporter/_sensor.yaml +++ /dev/null @@ -1,42 +0,0 @@ -{{- define "event-reporters.workflow-reporter.sensor"}} -apiVersion: argoproj.io/v1alpha1 -kind: Sensor -metadata: - name: workflow-reporter - labels: - {{- include "event-reporters.workflow-reporter.labels" . | nindent 4 }} -spec: - replicas: {{ .Values.workflow.sensor.replicas }} - dependencies: - - eventName: workflows - eventSourceName: workflow-reporter - name: workflows - eventBusName: {{ include "codefresh-gitops-runtime.eventbus.name" .Values.global.runtime.eventBus }} - template: - metadata: - labels: - app.kubernetes.io/name: workflow-reporter-sensor - serviceAccountName: {{ include "event-reporters.workflow-reporter.serviceAccountName" .}} - container: - name: "" - {{- include "codefresh-gitops-runtime.components.common_helpers.container-templates.env-vars" .Values.workflow.sensor.env | nindent 6 }} - resources: - {{- with .Values.workflow.sensor.resources }} - {{- . | toYaml | nindent 8 }} - {{- end }} - tolerations: - {{- with .Values.workflow.sensor.tolerations | default .Values.global.tolerations}} - {{- . | toYaml | nindent 6 }} - {{- end }} - nodeSelector: - {{- with .Values.workflow.sensor.nodeSelector | default .Values.global.nodeSelector }} - {{- . | toYaml | nindent 6 }} - {{- end }} - affinity: - {{- with .Values.affinity }} - {{- . | toYaml | nindent 6 }} - {{- end }} - triggers: - {{- include "event-reporters.http.trigger" (dict "name" "workflows" "Values" .Values "payloadDest" "data.object" "retryStrategy" .Values.workflow.sensor.retryStrategy "policy" .Values.workflow.sensor.policy "atLeastOnce" .Values.workflow.sensor.atLeastOnce) | nindent 4 }} - {{- include "event-reporters.log.trigger" (.Values.workflow.sensor.logging) | nindent 4 }} -{{- end }} diff --git a/charts/gitops-runtime/templates/_components/event-reporters/workflow-reporter/_serviceaccount.yaml b/charts/gitops-runtime/templates/_components/event-reporters/workflow-reporter/_serviceaccount.yaml deleted file mode 100644 index 023a4c84..00000000 --- a/charts/gitops-runtime/templates/_components/event-reporters/workflow-reporter/_serviceaccount.yaml +++ /dev/null @@ -1,10 +0,0 @@ -{{- define "event-reporters.workflow-reporter.sa"}} - {{- if .Values.workflow.serviceAccount.create }} -apiVersion: v1 -kind: ServiceAccount -metadata: - name: {{ include "event-reporters.workflow-reporter.serviceAccountName" .}} - labels: - {{- include "event-reporters.workflow-reporter.labels" . | nindent 4 }} - {{- end }} -{{- end }} \ No newline at end of file diff --git a/charts/gitops-runtime/templates/_helpers.tpl b/charts/gitops-runtime/templates/_helpers.tpl index 39135d1c..111ad632 100644 --- a/charts/gitops-runtime/templates/_helpers.tpl +++ b/charts/gitops-runtime/templates/_helpers.tpl @@ -433,7 +433,7 @@ Output comma separated list of installed runtime components {{- $sealedSecrets := dict "name" "sealed-secrets" "version" (get .Subcharts "sealed-secrets").Chart.AppVersion }} {{- $internalRouter := dict "name" "internal-router" "version" .Chart.AppVersion }} {{- $appProxy := dict "name" "app-proxy" "version" (index (get .Values "app-proxy") "image" "tag") }} - {{- $argoApiGateway := dict "name" "argo-api-gateway" "version" (get .Values "argo-api-gateway").image.tag }} + {{- $argoApiGateway := dict "name" "argo-gateway" "version" (get .Values "argo-gateway").image.tag }} {{- $comptList := list $appProxy $sealedSecrets $internalRouter $argoApiGateway }} {{- if and (index .Values "argo-cd" "enabled") }} {{- $argoCD := dict "name" "argocd" "version" (get .Subcharts "argo-cd").Chart.AppVersion }} diff --git a/charts/gitops-runtime/templates/argo-api-gateway/_env.yaml b/charts/gitops-runtime/templates/argo-gateway/_env.yaml similarity index 90% rename from charts/gitops-runtime/templates/argo-api-gateway/_env.yaml rename to charts/gitops-runtime/templates/argo-gateway/_env.yaml index aaf85cfc..2bc7455b 100644 --- a/charts/gitops-runtime/templates/argo-api-gateway/_env.yaml +++ b/charts/gitops-runtime/templates/argo-gateway/_env.yaml @@ -1,4 +1,4 @@ -{{- define "argo-api-gateway.resources.environment-variables.calculated" }} +{{- define "argo-gateway.resources.environment-variables.calculated" }} HTTP_PROXY: {{ .Values.global.httpProxy | squote}} HTTPS_PROXY: {{ .Values.global.httpsProxy | squote }} NO_PROXY: {{ .Values.global.noProxy | squote }} @@ -22,11 +22,11 @@ CODEFRESH_SSL_CERT_PATH: {{ printf "/app/config/codefresh-tls-certs/%s" $secretK {{- end }} -{{- define "argo-api-gateway.resources.environment-variables.defaults" -}} +{{- define "argo-gateway.resources.environment-variables.defaults" -}} ARGOCD_SERVER: valueFrom: configMapKeyRef: - name: argo-api-gateway-cmd-params-cm + name: argo-gateway-cmd-params-cm key: argocd.server ARGO_CD_TOKEN_SECRET_NAME: argocd-token ARGO_CD_TOKEN_SECRET_KEY: token @@ -57,7 +57,7 @@ CODEFRESH_URL: LISTEN_ADDRESS: valueFrom: configMapKeyRef: - name: argo-api-gateway-cmd-params-cm + name: argo-gateway-cmd-params-cm key: server.listen.address optional: true REDISDB: @@ -91,12 +91,12 @@ REDIS_USERNAME: REPO_SERVER: valueFrom: configMapKeyRef: - name: argo-api-gateway-cmd-params-cm + name: argo-gateway-cmd-params-cm key: repo.server REPO_SERVER_TIMEOUT_SECONDS: valueFrom: configMapKeyRef: - name: argo-api-gateway-cmd-params-cm + name: argo-gateway-cmd-params-cm key: repo.server.timeout.seconds optional: true {{- end -}} diff --git a/charts/gitops-runtime/templates/argo-api-gateway/_helpers.tpl b/charts/gitops-runtime/templates/argo-gateway/_helpers.tpl similarity index 62% rename from charts/gitops-runtime/templates/argo-api-gateway/_helpers.tpl rename to charts/gitops-runtime/templates/argo-gateway/_helpers.tpl index 9682d837..2a7b09ce 100644 --- a/charts/gitops-runtime/templates/argo-api-gateway/_helpers.tpl +++ b/charts/gitops-runtime/templates/argo-gateway/_helpers.tpl @@ -3,45 +3,45 @@ Create a default fully qualified app name. We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). If release name contains chart name it will be used as a full name. */}} -{{- define "argo-api-gateway.fullname" -}} -{{- print "argo-api-gateway" }} +{{- define "argo-gateway.fullname" -}} +{{- print "argo-gateway" }} {{- end }} {{/* Create chart name and version as used by the chart label. */}} -{{- define "argo-api-gateway.chart" -}} +{{- define "argo-gateway.chart" -}} {{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} {{- end }} {{/* Common labels */}} -{{- define "argo-api-gateway.labels" -}} -helm.sh/chart: {{ include "argo-api-gateway.chart" . }} -{{ include "argo-api-gateway.selectorLabels" . }} +{{- define "argo-gateway.labels" -}} +helm.sh/chart: {{ include "argo-gateway.chart" . }} +{{ include "argo-gateway.selectorLabels" . }} {{- if .Chart.AppVersion }} app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} {{- end }} app.kubernetes.io/managed-by: {{ .Release.Service }} -app.kubernetes.io/part-of: argo-api-gateway +app.kubernetes.io/part-of: argo-gateway codefresh.io/internal: "true" {{- end }} {{/* Selector labels */}} -{{- define "argo-api-gateway.selectorLabels" -}} -app.kubernetes.io/name: argo-api-gateway +{{- define "argo-gateway.selectorLabels" -}} +app.kubernetes.io/name: argo-gateway app.kubernetes.io/instance: {{ .Release.Name }} {{- end }} {{/* Create the name of the service account to use */}} -{{- define "argo-api-gateway.serviceAccountName" -}} +{{- define "argo-gateway.serviceAccountName" -}} {{- if .Values.serviceAccount.create }} -{{- default (include "argo-api-gateway.fullname" .) .Values.serviceAccount.name }} +{{- default (include "argo-gateway.fullname" .) .Values.serviceAccount.name }} {{- else }} {{- default "default" .Values.serviceAccount.name }} {{- end }} diff --git a/charts/gitops-runtime/templates/argo-api-gateway/configmap.yaml b/charts/gitops-runtime/templates/argo-gateway/configmap.yaml similarity index 60% rename from charts/gitops-runtime/templates/argo-api-gateway/configmap.yaml rename to charts/gitops-runtime/templates/argo-gateway/configmap.yaml index 251ec040..990df8bd 100644 --- a/charts/gitops-runtime/templates/argo-api-gateway/configmap.yaml +++ b/charts/gitops-runtime/templates/argo-gateway/configmap.yaml @@ -1,18 +1,18 @@ -{{- define "argo-api-gateway.resources.configmap.defaults" }} +{{- define "argo-gateway.resources.configmap.defaults" }} argocd.server: {{ include "codefresh-gitops-runtime.argocd.server.no-protocol-url" . }} repo.server: {{ include "codefresh-gitops-runtime.argocd.reposerver.url" . }} redis.server: {{ include "codefresh-gitops-runtime.argocd.redis.url" . }} {{- end }} -{{- $defaultConfig := (include "argo-api-gateway.resources.configmap.defaults" . | fromYaml ) }} -{{- $overrides := index .Values "argo-api-gateway" "config" | default dict }} +{{- $defaultConfig := (include "argo-gateway.resources.configmap.defaults" . | fromYaml ) }} +{{- $overrides := index .Values "argo-gateway" "config" | default dict }} {{- $mergedConfig := mergeOverwrite $defaultConfig $overrides }} apiVersion: v1 kind: ConfigMap metadata: - name: argo-api-gateway-cmd-params-cm + name: argo-gateway-cmd-params-cm labels: - {{- include "argo-api-gateway.labels" . | nindent 4 }} + {{- include "argo-gateway.labels" . | nindent 4 }} data: {{- $mergedConfig | toYaml | nindent 2 }} {{- if index .Values "argo-cd" "enabled" }} diff --git a/charts/gitops-runtime/templates/argo-api-gateway/deployment.yaml b/charts/gitops-runtime/templates/argo-gateway/deployment.yaml similarity index 85% rename from charts/gitops-runtime/templates/argo-api-gateway/deployment.yaml rename to charts/gitops-runtime/templates/argo-gateway/deployment.yaml index 1839176e..6f549993 100644 --- a/charts/gitops-runtime/templates/argo-api-gateway/deployment.yaml +++ b/charts/gitops-runtime/templates/argo-gateway/deployment.yaml @@ -1,22 +1,22 @@ {{- $context := deepCopy . }} -{{- $_ := set $context "Values" (deepCopy (get .Values "argo-api-gateway")) }} +{{- $_ := set $context "Values" (deepCopy (get .Values "argo-gateway")) }} {{- $_ := set $context.Values "global" (deepCopy (get .Values "global")) }} {{/* Merge environment variables from calculated, defaults and overwrites */}} -{{- $defaults := (include "argo-api-gateway.resources.environment-variables.defaults" $context | fromYaml) }} -{{- $calculated := (include "argo-api-gateway.resources.environment-variables.calculated" $context | fromYaml) }} +{{- $defaults := (include "argo-gateway.resources.environment-variables.defaults" $context | fromYaml) }} +{{- $calculated := (include "argo-gateway.resources.environment-variables.calculated" $context | fromYaml) }} {{- $overrides := $context.Values.env }} {{- $mergedValues := mergeOverwrite $defaults $calculated $overrides }} apiVersion: apps/v1 kind: Deployment metadata: - name: {{ include "argo-api-gateway.fullname" . }} + name: {{ include "argo-gateway.fullname" . }} labels: - {{- include "argo-api-gateway.labels" . | nindent 4 }} + {{- include "argo-gateway.labels" . | nindent 4 }} spec: replicas: {{ $context.Values.replicaCount }} selector: matchLabels: - {{- include "argo-api-gateway.selectorLabels" . | nindent 6 }} + {{- include "argo-gateway.selectorLabels" . | nindent 6 }} template: metadata: {{- with $context.Values.podAnnotations }} @@ -24,7 +24,7 @@ spec: {{- toYaml . | nindent 8 }} {{- end }} labels: - {{- include "argo-api-gateway.selectorLabels" . | nindent 8 }} + {{- include "argo-gateway.selectorLabels" . | nindent 8 }} {{- with $context.Values.podLabels }} {{- toYaml . | nindent 8 }} {{- end }} @@ -33,11 +33,11 @@ spec: imagePullSecrets: {{- toYaml . | nindent 8 }} {{- end }} - serviceAccountName: {{ include "argo-api-gateway.serviceAccountName" $context }} + serviceAccountName: {{ include "argo-gateway.serviceAccountName" $context }} securityContext: {{- toYaml $context.Values.podSecurityContext | nindent 8 }} containers: - - name: {{ include "argo-api-gateway.fullname" . }} + - name: {{ include "argo-gateway.fullname" . }} securityContext: {{- toYaml $context.Values.securityContext | nindent 12 }} {{- $imageContext := deepCopy $context.Values.image }} diff --git a/charts/gitops-runtime/templates/argo-api-gateway/hpa.yaml b/charts/gitops-runtime/templates/argo-gateway/hpa.yaml similarity index 80% rename from charts/gitops-runtime/templates/argo-api-gateway/hpa.yaml rename to charts/gitops-runtime/templates/argo-gateway/hpa.yaml index a963eeac..21d5816d 100644 --- a/charts/gitops-runtime/templates/argo-api-gateway/hpa.yaml +++ b/charts/gitops-runtime/templates/argo-gateway/hpa.yaml @@ -1,18 +1,18 @@ {{- $context := deepCopy . }} -{{- $_ := set $context "Values" (deepCopy (get .Values "argo-api-gateway")) }} +{{- $_ := set $context "Values" (deepCopy (get .Values "argo-gateway")) }} {{- $_ := set $context.Values "global" (deepCopy (get .Values "global")) }} {{- if and $context.Values.hpa.enabled }} apiVersion: autoscaling/v2 kind: HorizontalPodAutoscaler metadata: - name: {{ include "argo-api-gateway.fullname" . }} + name: {{ include "argo-gateway.fullname" . }} labels: - {{- include "argo-api-gateway.labels" . | nindent 4 }} + {{- include "argo-gateway.labels" . | nindent 4 }} spec: scaleTargetRef: apiVersion: apps/v1 kind: Deployment - name: {{ include "argo-api-gateway.fullname" . }} + name: {{ include "argo-gateway.fullname" . }} minReplicas: {{ $context.Values.hpa.minReplicas | default 1 }} maxReplicas: {{ $context.Values.hpa.maxReplicas | default 10 }} metrics: diff --git a/charts/gitops-runtime/templates/argo-api-gateway/pdb.yaml b/charts/gitops-runtime/templates/argo-gateway/pdb.yaml similarity index 68% rename from charts/gitops-runtime/templates/argo-api-gateway/pdb.yaml rename to charts/gitops-runtime/templates/argo-gateway/pdb.yaml index 2f89fb9f..f7910fcb 100644 --- a/charts/gitops-runtime/templates/argo-api-gateway/pdb.yaml +++ b/charts/gitops-runtime/templates/argo-gateway/pdb.yaml @@ -1,12 +1,12 @@ {{- $context := deepCopy . }} -{{- $_ := set $context "Values" (deepCopy (get .Values "argo-api-gateway")) }} +{{- $_ := set $context "Values" (deepCopy (get .Values "argo-gateway")) }} {{- $_ := set $context.Values "global" (deepCopy (get .Values "global")) }} {{- if and $context.Values.pdb.enabled }} apiVersion: policy/v1 kind: PodDisruptionBudget metadata: - name: {{ include "argo-api-gateway.fullname" . }} + name: {{ include "argo-gateway.fullname" . }} spec: {{- with $context.Values.pdb.minAvailable }} minAvailable: {{ . }} @@ -16,5 +16,5 @@ spec: {{- end }} selector: matchLabels: - {{- include "argo-api-gateway.selectorLabels" . | nindent 6 }} + {{- include "argo-gateway.selectorLabels" . | nindent 6 }} {{- end }} diff --git a/charts/gitops-runtime/templates/argo-api-gateway/rbac.yaml b/charts/gitops-runtime/templates/argo-gateway/rbac.yaml similarity index 62% rename from charts/gitops-runtime/templates/argo-api-gateway/rbac.yaml rename to charts/gitops-runtime/templates/argo-gateway/rbac.yaml index 2a0cc012..8f22c568 100644 --- a/charts/gitops-runtime/templates/argo-api-gateway/rbac.yaml +++ b/charts/gitops-runtime/templates/argo-gateway/rbac.yaml @@ -1,19 +1,19 @@ {{- $context := deepCopy . }} -{{- $_ := set $context "Values" (deepCopy (get .Values "argo-api-gateway")) }} +{{- $_ := set $context "Values" (deepCopy (get .Values "argo-gateway")) }} {{- $_ := set $context.Values "global" (deepCopy (get .Values "global")) }} apiVersion: v1 kind: ServiceAccount metadata: - name: {{ include "argo-api-gateway.serviceAccountName" $context }} + name: {{ include "argo-gateway.serviceAccountName" $context }} labels: - {{- include "argo-api-gateway.labels" . | nindent 4 }} + {{- include "argo-gateway.labels" . | nindent 4 }} --- apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: - name: {{ include "argo-api-gateway.fullname" . }} + name: {{ include "argo-gateway.fullname" . }} labels: - {{- include "argo-api-gateway.labels" . | nindent 4 }} + {{- include "argo-gateway.labels" . | nindent 4 }} rules: - apiGroups: - '' @@ -51,14 +51,14 @@ rules: apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: - name: {{ include "argo-api-gateway.fullname" . }} + name: {{ include "argo-gateway.fullname" . }} labels: - {{- include "argo-api-gateway.labels" . | nindent 4 }} + {{- include "argo-gateway.labels" . | nindent 4 }} roleRef: apiGroup: rbac.authorization.k8s.io kind: ClusterRole - name: {{ include "argo-api-gateway.fullname" . }} + name: {{ include "argo-gateway.fullname" . }} subjects: - kind: ServiceAccount - name: {{ include "argo-api-gateway.serviceAccountName" $context }} + name: {{ include "argo-gateway.serviceAccountName" $context }} namespace: {{ .Release.Namespace }} diff --git a/charts/gitops-runtime/templates/argo-api-gateway/service.yaml b/charts/gitops-runtime/templates/argo-gateway/service.yaml similarity index 62% rename from charts/gitops-runtime/templates/argo-api-gateway/service.yaml rename to charts/gitops-runtime/templates/argo-gateway/service.yaml index 1b7a0cf4..3ffb3db3 100644 --- a/charts/gitops-runtime/templates/argo-api-gateway/service.yaml +++ b/charts/gitops-runtime/templates/argo-gateway/service.yaml @@ -1,12 +1,12 @@ {{- $context := deepCopy . }} -{{- $_ := set $context "Values" (deepCopy (get .Values "argo-api-gateway")) }} +{{- $_ := set $context "Values" (deepCopy (get .Values "argo-gateway")) }} {{- $_ := set $context.Values "global" (deepCopy (get .Values "global")) }} apiVersion: v1 kind: Service metadata: - name: {{ include "argo-api-gateway.fullname" . }} + name: {{ include "argo-gateway.fullname" . }} labels: - {{- include "argo-api-gateway.labels" . | nindent 4 }} + {{- include "argo-gateway.labels" . | nindent 4 }} spec: type: {{ $context.Values.service.type | default "ClusterIP" }} ports: @@ -15,4 +15,4 @@ spec: protocol: TCP name: http selector: - {{- include "argo-api-gateway.selectorLabels" . | nindent 4 }} + {{- include "argo-gateway.selectorLabels" . | nindent 4 }} diff --git a/charts/gitops-runtime/templates/argo-api-gateway/serviceMonitor.yaml b/charts/gitops-runtime/templates/argo-gateway/serviceMonitor.yaml similarity index 72% rename from charts/gitops-runtime/templates/argo-api-gateway/serviceMonitor.yaml rename to charts/gitops-runtime/templates/argo-gateway/serviceMonitor.yaml index 0f30250d..10794e6f 100644 --- a/charts/gitops-runtime/templates/argo-api-gateway/serviceMonitor.yaml +++ b/charts/gitops-runtime/templates/argo-gateway/serviceMonitor.yaml @@ -1,20 +1,20 @@ {{- $context := deepCopy . }} -{{- $_ := set $context "Values" (deepCopy (get .Values "argo-api-gateway")) }} +{{- $_ := set $context "Values" (deepCopy (get .Values "argo-gateway")) }} {{- $_ := set $context.Values "global" (deepCopy (get .Values "global")) }} {{- if $context.Values.serviceMonitor.enabled -}} apiVersion: monitoring.coreos.com/v1 kind: ServiceMonitor metadata: - name: {{ include "argo-api-gateway.fullname" . }} + name: {{ include "argo-gateway.fullname" . }} labels: - {{- include "argo-api-gateway.labels" . | nindent 4 }} + {{- include "argo-gateway.labels" . | nindent 4 }} {{- with $context.Values.serviceMonitor.labels }} {{- toYaml . | nindent 4 }} {{- end }} spec: selector: matchLabels: - {{- include "argo-api-gateway.selectorLabels" . | nindent 8 }} + {{- include "argo-gateway.selectorLabels" . | nindent 8 }} endpoints: - port: http {{- if $context.Values.serviceMonitor.interval }} diff --git a/charts/gitops-runtime/templates/event-reporters/resources-reporter/_env.yaml b/charts/gitops-runtime/templates/event-reporters/cluster-event-reporter/_env.yaml similarity index 82% rename from charts/gitops-runtime/templates/event-reporters/resources-reporter/_env.yaml rename to charts/gitops-runtime/templates/event-reporters/cluster-event-reporter/_env.yaml index e64a3014..4d761ef9 100644 --- a/charts/gitops-runtime/templates/event-reporters/resources-reporter/_env.yaml +++ b/charts/gitops-runtime/templates/event-reporters/cluster-event-reporter/_env.yaml @@ -1,4 +1,4 @@ -{{- define "resources-reporter.resources.environment-variables.calculated" }} +{{- define "cluster-event-reporter.resources.environment-variables.calculated" }} HTTP_PROXY: {{ .Values.global.httpProxy | squote}} HTTPS_PROXY: {{ .Values.global.httpsProxy | squote }} NO_PROXY: {{ .Values.global.noProxy | squote }} @@ -22,12 +22,12 @@ CODEFRESH_SSL_CERT_PATH: {{ printf "/app/config/codefresh-tls-certs/%s" $secretK {{- end }} -{{- define "resources-reporter.resources.environment-variables.defaults" -}} +{{- define "cluster-event-reporter.resources.environment-variables.defaults" -}} REPORTER_MODE: resource APP_QUEUE_SIZE: valueFrom: configMapKeyRef: - name: resources-reporter-cmd-params-cm + name: cluster-event-reporter-cmd-params-cm key: app.queue.size ARGOCD_APPLICATION_NAMESPACES: valueFrom: @@ -38,7 +38,7 @@ ARGOCD_APPLICATION_NAMESPACES: ARGOCD_SERVER: valueFrom: configMapKeyRef: - name: resources-reporter-cmd-params-cm + name: cluster-event-reporter-cmd-params-cm key: argocd.server ARGOCD_SERVER_ROOTPATH: valueFrom: @@ -70,42 +70,42 @@ EVENT_REPORTER_REPLICAS: 1 INSECURE: valueFrom: configMapKeyRef: - name: resources-reporter-cmd-params-cm + name: cluster-event-reporter-cmd-params-cm key: insecure optional: true LISTEN_ADDRESS: valueFrom: configMapKeyRef: - name: resources-reporter-cmd-params-cm + name: cluster-event-reporter-cmd-params-cm key: listen.address optional: true LOG_FORMAT: valueFrom: configMapKeyRef: - name: resources-reporter-cmd-params-cm + name: cluster-event-reporter-cmd-params-cm key: log.format optional: true LOG_LEVEL: valueFrom: configMapKeyRef: - name: resources-reporter-cmd-params-cm + name: cluster-event-reporter-cmd-params-cm key: log.level optional: true MAX_APP_RETRIES: valueFrom: configMapKeyRef: - name: resources-reporter-cmd-params-cm + name: cluster-event-reporter-cmd-params-cm key: max.app.retries METRICS_LISTEN_ADDRESS: valueFrom: configMapKeyRef: - name: resources-reporter-cmd-params-cm + name: cluster-event-reporter-cmd-params-cm key: metrics.listen.address optional: true OTEL_EXPORTER_OTLP_TRACES_ENDPOINT: valueFrom: configMapKeyRef: - name: resources-reporter-cmd-params-cm + name: cluster-event-reporter-cmd-params-cm key: otlp.address optional: true REDISDB: @@ -139,24 +139,24 @@ REDIS_USERNAME: REPO_SERVER: valueFrom: configMapKeyRef: - name: resources-reporter-cmd-params-cm + name: cluster-event-reporter-cmd-params-cm key: repo.server REPO_SERVER_PLAINTEXT: valueFrom: configMapKeyRef: - name: resources-reporter-cmd-params-cm + name: cluster-event-reporter-cmd-params-cm key: repo.server.plaintext optional: true REPO_SERVER_STRICT_TLS: valueFrom: configMapKeyRef: - name: resources-reporter-cmd-params-cm + name: cluster-event-reporter-cmd-params-cm key: repo.server.strict.tls optional: true REPO_SERVER_TIMEOUT_SECONDS: valueFrom: configMapKeyRef: - name: resources-reporter-cmd-params-cm + name: cluster-event-reporter-cmd-params-cm key: repo.server.timeout.seconds optional: true RUNTIME_VERSION: @@ -167,17 +167,17 @@ RUNTIME_VERSION: SHARDING_ALGORITHM: valueFrom: configMapKeyRef: - name: resources-reporter-cmd-params-cm + name: cluster-event-reporter-cmd-params-cm key: sharding.algorithm optional: true SOURCES_SERVER: valueFrom: configMapKeyRef: - name: resources-reporter-cmd-params-cm + name: cluster-event-reporter-cmd-params-cm key: sources.server THREADINESS: valueFrom: configMapKeyRef: - name: resources-reporter-cmd-params-cm + name: cluster-event-reporter-cmd-params-cm key: threadiness {{- end -}} diff --git a/charts/gitops-runtime/templates/event-reporters/resources-reporter/_helpers.tpl b/charts/gitops-runtime/templates/event-reporters/cluster-event-reporter/_helpers.tpl similarity index 58% rename from charts/gitops-runtime/templates/event-reporters/resources-reporter/_helpers.tpl rename to charts/gitops-runtime/templates/event-reporters/cluster-event-reporter/_helpers.tpl index 11145ffa..fe5c5c91 100644 --- a/charts/gitops-runtime/templates/event-reporters/resources-reporter/_helpers.tpl +++ b/charts/gitops-runtime/templates/event-reporters/cluster-event-reporter/_helpers.tpl @@ -3,44 +3,44 @@ Create a default fully qualified app name. We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). If release name contains chart name it will be used as a full name. */}} -{{- define "resources-reporter.fullname" -}} -{{- print "resources-reporter" }} +{{- define "cluster-event-reporter.fullname" -}} +{{- print "cluster-event-reporter" }} {{- end }} {{/* Create chart name and version as used by the chart label. */}} -{{- define "resources-reporter.chart" -}} +{{- define "cluster-event-reporter.chart" -}} {{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} {{- end }} {{/* Common labels */}} -{{- define "resources-reporter.labels" -}} -helm.sh/chart: {{ include "resources-reporter.chart" . }} -{{ include "resources-reporter.selectorLabels" . }} +{{- define "cluster-event-reporter.labels" -}} +helm.sh/chart: {{ include "cluster-event-reporter.chart" . }} +{{ include "cluster-event-reporter.selectorLabels" . }} {{- if .Chart.AppVersion }} app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} {{- end }} app.kubernetes.io/managed-by: {{ .Release.Service }} -app.kubernetes.io/part-of: resources-reporter +app.kubernetes.io/part-of: cluster-event-reporter codefresh.io/internal: "true" {{- end }} {{/* Selector labels */}} -{{- define "resources-reporter.selectorLabels" -}} -app.kubernetes.io/name: resources-reporter +{{- define "cluster-event-reporter.selectorLabels" -}} +app.kubernetes.io/name: cluster-event-reporter {{- end }} {{/* Create the name of the service account to use */}} -{{- define "resources-reporter.serviceAccountName" -}} +{{- define "cluster-event-reporter.serviceAccountName" -}} {{- if .Values.serviceAccount.create }} -{{- default (include "resources-reporter.fullname" .) .Values.serviceAccount.name }} +{{- default (include "cluster-event-reporter.fullname" .) .Values.serviceAccount.name }} {{- else }} {{- default "default" .Values.serviceAccount.name }} {{- end }} diff --git a/charts/gitops-runtime/templates/event-reporters/resources-reporter/configmap.yaml b/charts/gitops-runtime/templates/event-reporters/cluster-event-reporter/configmap.yaml similarity index 58% rename from charts/gitops-runtime/templates/event-reporters/resources-reporter/configmap.yaml rename to charts/gitops-runtime/templates/event-reporters/cluster-event-reporter/configmap.yaml index dbb35e66..4c8ccb95 100644 --- a/charts/gitops-runtime/templates/event-reporters/resources-reporter/configmap.yaml +++ b/charts/gitops-runtime/templates/event-reporters/cluster-event-reporter/configmap.yaml @@ -1,22 +1,22 @@ -{{- define "resources-reporter.resources.configmap.defaults" }} +{{- define "cluster-event-reporter.resources.configmap.defaults" }} argocd.server: {{ include "codefresh-gitops-runtime.argocd.server.no-protocol-url" . }} redis.server: {{ include "codefresh-gitops-runtime.argocd.redis.url" . }} repo.server: {{ include "codefresh-gitops-runtime.argocd.reposerver.url" . }} -sources.server: http://argo-api-gateway +sources.server: http://argo-gateway app.queue.size: '1000' max.app.retries: '5' threadiness: '100' {{- end }} -{{- $defaultConfig := (include "resources-reporter.resources.configmap.defaults" . | fromYaml ) }} +{{- $defaultConfig := (include "cluster-event-reporter.resources.configmap.defaults" . | fromYaml ) }} {{- $globalOverrides := index .Values "global" "event-reporters" "config" | default dict }} -{{- $reporterOverrides := index .Values "event-reporters" "resources-reporter" "config" | default dict }} +{{- $reporterOverrides := index .Values "event-reporters" "cluster-event-reporter" "config" | default dict }} {{- $mergedConfig := mergeOverwrite $defaultConfig $globalOverrides $reporterOverrides }} apiVersion: v1 kind: ConfigMap metadata: - name: resources-reporter-cmd-params-cm + name: cluster-event-reporter-cmd-params-cm labels: - {{- include "resources-reporter.labels" . | nindent 4 }} + {{- include "cluster-event-reporter.labels" . | nindent 4 }} data: {{- $mergedConfig | toYaml | nindent 2 }} diff --git a/charts/gitops-runtime/templates/event-reporters/resources-reporter/deployment.yaml b/charts/gitops-runtime/templates/event-reporters/cluster-event-reporter/deployment.yaml similarity index 86% rename from charts/gitops-runtime/templates/event-reporters/resources-reporter/deployment.yaml rename to charts/gitops-runtime/templates/event-reporters/cluster-event-reporter/deployment.yaml index 131a7fae..794e91c6 100644 --- a/charts/gitops-runtime/templates/event-reporters/resources-reporter/deployment.yaml +++ b/charts/gitops-runtime/templates/event-reporters/cluster-event-reporter/deployment.yaml @@ -2,25 +2,25 @@ {{- $_ := set $context "Values" (deepCopy (get (index .Values "global") "event-reporters")) }} {{- $_ := set $context.Values "global" (deepCopy (get .Values "global")) }} {{/* Merge .Values.event-reporters. with .Values.global.event-reporters */}} -{{- $valuesOverrides := index .Values "event-reporters" "resources-reporter" }} +{{- $valuesOverrides := index .Values "event-reporters" "cluster-event-reporter" }} {{- $values := mergeOverwrite $context.Values $valuesOverrides }} {{- $_ := set $context "Values" $values }} {{/* Merge environment variables from calculated, defaults and overwrites */}} -{{- $defaults := (include "resources-reporter.resources.environment-variables.defaults" $context | fromYaml) }} -{{- $calculated := (include "resources-reporter.resources.environment-variables.calculated" $context | fromYaml) }} +{{- $defaults := (include "cluster-event-reporter.resources.environment-variables.defaults" $context | fromYaml) }} +{{- $calculated := (include "cluster-event-reporter.resources.environment-variables.calculated" $context | fromYaml) }} {{- $overrides := $context.Values.env }} {{- $mergedValues := mergeOverwrite $defaults $calculated $overrides }} apiVersion: apps/v1 kind: Deployment metadata: - name: {{ include "resources-reporter.fullname" . }} + name: {{ include "cluster-event-reporter.fullname" . }} labels: - {{- include "resources-reporter.labels" . | nindent 4 }} + {{- include "cluster-event-reporter.labels" . | nindent 4 }} spec: replicas: {{ $context.Values.replicaCount }} selector: matchLabels: - {{- include "resources-reporter.selectorLabels" . | nindent 6 }} + {{- include "cluster-event-reporter.selectorLabels" . | nindent 6 }} template: metadata: {{- with $context.Values.podAnnotations }} @@ -28,7 +28,7 @@ spec: {{- toYaml . | nindent 8 }} {{- end }} labels: - {{- include "resources-reporter.selectorLabels" . | nindent 8 }} + {{- include "cluster-event-reporter.selectorLabels" . | nindent 8 }} {{- with $context.Values.podLabels }} {{- toYaml . | nindent 8 }} {{- end }} @@ -37,11 +37,11 @@ spec: imagePullSecrets: {{- toYaml . | nindent 8 }} {{- end }} - serviceAccountName: {{ include "resources-reporter.serviceAccountName" $context }} + serviceAccountName: {{ include "cluster-event-reporter.serviceAccountName" $context }} securityContext: {{- toYaml $context.Values.podSecurityContext | nindent 8 }} containers: - - name: {{ include "resources-reporter.fullname" . }} + - name: {{ include "cluster-event-reporter.fullname" . }} securityContext: {{- toYaml $context.Values.securityContext | nindent 12 }} {{- $imageContext := deepCopy $context.Values.image }} diff --git a/charts/gitops-runtime/templates/event-reporters/resources-reporter/pdb.yaml b/charts/gitops-runtime/templates/event-reporters/cluster-event-reporter/pdb.yaml similarity index 73% rename from charts/gitops-runtime/templates/event-reporters/resources-reporter/pdb.yaml rename to charts/gitops-runtime/templates/event-reporters/cluster-event-reporter/pdb.yaml index b9bf12d6..3399b312 100644 --- a/charts/gitops-runtime/templates/event-reporters/resources-reporter/pdb.yaml +++ b/charts/gitops-runtime/templates/event-reporters/cluster-event-reporter/pdb.yaml @@ -1,14 +1,14 @@ {{- $context := deepCopy . }} {{- $_ := set $context "Values" (deepCopy (get (index .Values "global") "event-reporters")) }} {{- $_ := set $context.Values "global" (deepCopy (get .Values "global")) }} -{{- $valuesOverrides := index .Values "event-reporters" "resources-reporter" }} +{{- $valuesOverrides := index .Values "event-reporters" "cluster-event-reporter" }} {{- $_ := mergeOverwrite $context.Values $valuesOverrides | set $context "Values" }} {{- if and $context.Values.pdb.enabled }} apiVersion: policy/v1 kind: PodDisruptionBudget metadata: - name: {{ include "resources-reporter.fullname" . }} + name: {{ include "cluster-event-reporter.fullname" . }} spec: {{- with $context.Values.pdb.minAvailable }} minAvailable: {{ . }} @@ -18,5 +18,5 @@ spec: {{- end }} selector: matchLabels: - {{- include "resources-reporter.selectorLabels" . | nindent 6 }} + {{- include "cluster-event-reporter.selectorLabels" . | nindent 6 }} {{- end }} diff --git a/charts/gitops-runtime/templates/event-reporters/resources-reporter/rbac.yaml b/charts/gitops-runtime/templates/event-reporters/cluster-event-reporter/rbac.yaml similarity index 56% rename from charts/gitops-runtime/templates/event-reporters/resources-reporter/rbac.yaml rename to charts/gitops-runtime/templates/event-reporters/cluster-event-reporter/rbac.yaml index 09bc551e..10a3c46d 100644 --- a/charts/gitops-runtime/templates/event-reporters/resources-reporter/rbac.yaml +++ b/charts/gitops-runtime/templates/event-reporters/cluster-event-reporter/rbac.yaml @@ -1,21 +1,21 @@ {{- $context := deepCopy . }} {{- $_ := set $context "Values" (deepCopy (get (index .Values "global") "event-reporters")) }} {{- $_ := set $context.Values "global" (deepCopy (get .Values "global")) }} -{{- $valuesOverrides := index .Values "event-reporters" "resources-reporter" }} +{{- $valuesOverrides := index .Values "event-reporters" "cluster-event-reporter" }} {{- $_ := mergeOverwrite $context.Values $valuesOverrides | set $context "Values" }} apiVersion: v1 kind: ServiceAccount metadata: - name: {{ include "resources-reporter.serviceAccountName" $context }} + name: {{ include "cluster-event-reporter.serviceAccountName" $context }} labels: - {{- include "resources-reporter.labels" . | nindent 4 }} + {{- include "cluster-event-reporter.labels" . | nindent 4 }} --- apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: - name: {{ include "resources-reporter.fullname" . }} + name: {{ include "cluster-event-reporter.fullname" . }} labels: - {{- include "resources-reporter.labels" . | nindent 4 }} + {{- include "cluster-event-reporter.labels" . | nindent 4 }} rules: - apiGroups: - '*' @@ -31,14 +31,14 @@ rules: apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: - name: {{ include "resources-reporter.fullname" . }} + name: {{ include "cluster-event-reporter.fullname" . }} labels: - {{- include "resources-reporter.labels" . | nindent 4 }} + {{- include "cluster-event-reporter.labels" . | nindent 4 }} roleRef: apiGroup: rbac.authorization.k8s.io kind: ClusterRole - name: {{ include "resources-reporter.fullname" . }} + name: {{ include "cluster-event-reporter.fullname" . }} subjects: - kind: ServiceAccount - name: {{ include "resources-reporter.serviceAccountName" $context }} + name: {{ include "cluster-event-reporter.serviceAccountName" $context }} namespace: {{ .Release.Namespace }} diff --git a/charts/gitops-runtime/templates/event-reporters/resources-reporter/service.yaml b/charts/gitops-runtime/templates/event-reporters/cluster-event-reporter/service.yaml similarity index 65% rename from charts/gitops-runtime/templates/event-reporters/resources-reporter/service.yaml rename to charts/gitops-runtime/templates/event-reporters/cluster-event-reporter/service.yaml index eabd4096..355032fc 100644 --- a/charts/gitops-runtime/templates/event-reporters/resources-reporter/service.yaml +++ b/charts/gitops-runtime/templates/event-reporters/cluster-event-reporter/service.yaml @@ -1,14 +1,14 @@ {{- $context := deepCopy . }} {{- $_ := set $context "Values" (deepCopy (get (index .Values "global") "event-reporters")) }} {{- $_ := set $context.Values "global" (deepCopy (get .Values "global")) }} -{{- $valuesOverrides := index .Values "event-reporters" "resources-reporter" }} +{{- $valuesOverrides := index .Values "event-reporters" "cluster-event-reporter" }} {{- $_ := mergeOverwrite $context.Values $valuesOverrides | set $context "Values" }} apiVersion: v1 kind: Service metadata: - name: {{ include "resources-reporter.fullname" . }} + name: {{ include "cluster-event-reporter.fullname" . }} labels: - {{- include "resources-reporter.labels" . | nindent 4 }} + {{- include "cluster-event-reporter.labels" . | nindent 4 }} spec: type: ClusterIP ports: @@ -18,4 +18,4 @@ spec: targetPort: {{ $port.targetPort }} {{- end }} selector: - {{- include "resources-reporter.selectorLabels" . | nindent 4 }} + {{- include "cluster-event-reporter.selectorLabels" . | nindent 4 }} diff --git a/charts/gitops-runtime/templates/event-reporters/resources-reporter/serviceMonitor.yaml b/charts/gitops-runtime/templates/event-reporters/cluster-event-reporter/serviceMonitor.yaml similarity index 75% rename from charts/gitops-runtime/templates/event-reporters/resources-reporter/serviceMonitor.yaml rename to charts/gitops-runtime/templates/event-reporters/cluster-event-reporter/serviceMonitor.yaml index 2910d0ca..1c6f3b43 100644 --- a/charts/gitops-runtime/templates/event-reporters/resources-reporter/serviceMonitor.yaml +++ b/charts/gitops-runtime/templates/event-reporters/cluster-event-reporter/serviceMonitor.yaml @@ -1,22 +1,22 @@ {{- $context := deepCopy . }} {{- $_ := set $context "Values" (deepCopy (get (index .Values "global") "event-reporters")) }} {{- $_ := set $context.Values "global" (deepCopy (get .Values "global")) }} -{{- $valuesOverrides := index .Values "event-reporters" "resources-reporter" }} +{{- $valuesOverrides := index .Values "event-reporters" "cluster-event-reporter" }} {{- $_ := mergeOverwrite $context.Values $valuesOverrides | set $context "Values" }} {{- if $context.Values.serviceMonitor.enabled -}} apiVersion: monitoring.coreos.com/v1 kind: ServiceMonitor metadata: - name: {{ include "resources-reporter.fullname" . }} + name: {{ include "cluster-event-reporter.fullname" . }} labels: - {{- include "resources-reporter.labels" . | nindent 4 }} + {{- include "cluster-event-reporter.labels" . | nindent 4 }} {{- with $context.Values.serviceMonitor.labels }} {{- toYaml . | nindent 4 }} {{- end }} spec: selector: matchLabels: - {{- include "resources-reporter.selectorLabels" . | nindent 8 }} + {{- include "cluster-event-reporter.selectorLabels" . | nindent 8 }} endpoints: - port: metrics {{- if $context.Values.serviceMonitor.interval }} diff --git a/charts/gitops-runtime/templates/event-reporters/runtime-reporter/_env.yaml b/charts/gitops-runtime/templates/event-reporters/runtime-event-reporter/_env.yaml similarity index 82% rename from charts/gitops-runtime/templates/event-reporters/runtime-reporter/_env.yaml rename to charts/gitops-runtime/templates/event-reporters/runtime-event-reporter/_env.yaml index 8fdf7f2d..326bf463 100644 --- a/charts/gitops-runtime/templates/event-reporters/runtime-reporter/_env.yaml +++ b/charts/gitops-runtime/templates/event-reporters/runtime-event-reporter/_env.yaml @@ -1,4 +1,4 @@ -{{- define "runtime-reporter.resources.environment-variables.calculated" }} +{{- define "runtime-event-reporter.resources.environment-variables.calculated" }} HTTP_PROXY: {{ .Values.global.httpProxy | squote}} HTTPS_PROXY: {{ .Values.global.httpsProxy | squote }} NO_PROXY: {{ .Values.global.noProxy | squote }} @@ -22,12 +22,12 @@ CODEFRESH_SSL_CERT_PATH: {{ printf "/app/config/codefresh-tls-certs/%s" $secretK {{- end }} -{{- define "runtime-reporter.resources.environment-variables.defaults" -}} +{{- define "runtime-event-reporter.resources.environment-variables.defaults" -}} REPORTER_MODE: combined APP_QUEUE_SIZE: valueFrom: configMapKeyRef: - name: runtime-reporter-cmd-params-cm + name: runtime-event-reporter-cmd-params-cm key: app.queue.size ARGOCD_APPLICATION_NAMESPACES: valueFrom: @@ -38,7 +38,7 @@ ARGOCD_APPLICATION_NAMESPACES: ARGOCD_SERVER: valueFrom: configMapKeyRef: - name: runtime-reporter-cmd-params-cm + name: runtime-event-reporter-cmd-params-cm key: argocd.server ARGOCD_SERVER_ROOTPATH: valueFrom: @@ -48,7 +48,7 @@ ARGOCD_SERVER_ROOTPATH: optional: true ARGO_CD_TOKEN_SECRET_NAME: argocd-token ARGO_CD_TOKEN_SECRET_KEY: token -BINARY_NAME: event-reporter +BINARY_NAME: runtime-event-reporter CODEFRESH_SSL_CERT_PATH: "" CODEFRESH_TLS_INSECURE: valueFrom: @@ -70,42 +70,42 @@ EVENT_REPORTER_REPLICAS: 1 INSECURE: valueFrom: configMapKeyRef: - name: runtime-reporter-cmd-params-cm + name: runtime-event-reporter-cmd-params-cm key: insecure optional: true LISTEN_ADDRESS: valueFrom: configMapKeyRef: - name: runtime-reporter-cmd-params-cm + name: runtime-event-reporter-cmd-params-cm key: listen.address optional: true LOG_FORMAT: valueFrom: configMapKeyRef: - name: runtime-reporter-cmd-params-cm + name: runtime-event-reporter-cmd-params-cm key: log.format optional: true LOG_LEVEL: valueFrom: configMapKeyRef: - name: runtime-reporter-cmd-params-cm + name: runtime-event-reporter-cmd-params-cm key: log.level optional: true MAX_APP_RETRIES: valueFrom: configMapKeyRef: - name: runtime-reporter-cmd-params-cm + name: runtime-event-reporter-cmd-params-cm key: max.app.retries METRICS_LISTEN_ADDRESS: valueFrom: configMapKeyRef: - name: runtime-reporter-cmd-params-cm + name: runtime-event-reporter-cmd-params-cm key: metrics.listen.address optional: true OTEL_EXPORTER_OTLP_TRACES_ENDPOINT: valueFrom: configMapKeyRef: - name: runtime-reporter-cmd-params-cm + name: runtime-event-reporter-cmd-params-cm key: otlp.address optional: true REDISDB: @@ -139,24 +139,24 @@ REDIS_USERNAME: REPO_SERVER: valueFrom: configMapKeyRef: - name: runtime-reporter-cmd-params-cm + name: runtime-event-reporter-cmd-params-cm key: repo.server REPO_SERVER_PLAINTEXT: valueFrom: configMapKeyRef: - name: runtime-reporter-cmd-params-cm + name: runtime-event-reporter-cmd-params-cm key: repo.server.plaintext optional: true REPO_SERVER_STRICT_TLS: valueFrom: configMapKeyRef: - name: runtime-reporter-cmd-params-cm + name: runtime-event-reporter-cmd-params-cm key: repo.server.strict.tls optional: true REPO_SERVER_TIMEOUT_SECONDS: valueFrom: configMapKeyRef: - name: runtime-reporter-cmd-params-cm + name: runtime-event-reporter-cmd-params-cm key: repo.server.timeout.seconds optional: true RUNTIME_VERSION: @@ -167,17 +167,17 @@ RUNTIME_VERSION: SHARDING_ALGORITHM: valueFrom: configMapKeyRef: - name: runtime-reporter-cmd-params-cm + name: runtime-event-reporter-cmd-params-cm key: sharding.algorithm optional: true SOURCES_SERVER: valueFrom: configMapKeyRef: - name: runtime-reporter-cmd-params-cm + name: runtime-event-reporter-cmd-params-cm key: sources.server THREADINESS: valueFrom: configMapKeyRef: - name: runtime-reporter-cmd-params-cm + name: runtime-event-reporter-cmd-params-cm key: threadiness {{- end -}} diff --git a/charts/gitops-runtime/templates/event-reporters/runtime-reporter/_helpers.tpl b/charts/gitops-runtime/templates/event-reporters/runtime-event-reporter/_helpers.tpl similarity index 58% rename from charts/gitops-runtime/templates/event-reporters/runtime-reporter/_helpers.tpl rename to charts/gitops-runtime/templates/event-reporters/runtime-event-reporter/_helpers.tpl index a0ed085c..69dcf42f 100644 --- a/charts/gitops-runtime/templates/event-reporters/runtime-reporter/_helpers.tpl +++ b/charts/gitops-runtime/templates/event-reporters/runtime-event-reporter/_helpers.tpl @@ -3,44 +3,44 @@ Create a default fully qualified app name. We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). If release name contains chart name it will be used as a full name. */}} -{{- define "runtime-reporter.fullname" -}} -{{- print "runtime-reporter" }} +{{- define "runtime-event-reporter.fullname" -}} +{{- print "runtime-event-reporter" }} {{- end }} {{/* Create chart name and version as used by the chart label. */}} -{{- define "runtime-reporter.chart" -}} +{{- define "runtime-event-reporter.chart" -}} {{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} {{- end }} {{/* Common labels */}} -{{- define "runtime-reporter.labels" -}} -helm.sh/chart: {{ include "runtime-reporter.chart" . }} -{{ include "runtime-reporter.selectorLabels" . }} +{{- define "runtime-event-reporter.labels" -}} +helm.sh/chart: {{ include "runtime-event-reporter.chart" . }} +{{ include "runtime-event-reporter.selectorLabels" . }} {{- if .Chart.AppVersion }} app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} {{- end }} app.kubernetes.io/managed-by: {{ .Release.Service }} -app.kubernetes.io/part-of: runtime-reporter +app.kubernetes.io/part-of: runtime-event-reporter codefresh.io/internal: "true" {{- end }} {{/* Selector labels */}} -{{- define "runtime-reporter.selectorLabels" -}} -app.kubernetes.io/name: runtime-reporter +{{- define "runtime-event-reporter.selectorLabels" -}} +app.kubernetes.io/name: runtime-event-reporter {{- end }} {{/* Create the name of the service account to use */}} -{{- define "runtime-reporter.serviceAccountName" -}} +{{- define "runtime-event-reporter.serviceAccountName" -}} {{- if .Values.serviceAccount.create }} -{{- default (include "runtime-reporter.fullname" .) .Values.serviceAccount.name }} +{{- default (include "runtime-event-reporter.fullname" .) .Values.serviceAccount.name }} {{- else }} {{- default "default" .Values.serviceAccount.name }} {{- end }} diff --git a/charts/gitops-runtime/templates/event-reporters/runtime-reporter/configmap.yaml b/charts/gitops-runtime/templates/event-reporters/runtime-event-reporter/configmap.yaml similarity index 64% rename from charts/gitops-runtime/templates/event-reporters/runtime-reporter/configmap.yaml rename to charts/gitops-runtime/templates/event-reporters/runtime-event-reporter/configmap.yaml index 27e677ed..10b2e08b 100644 --- a/charts/gitops-runtime/templates/event-reporters/runtime-reporter/configmap.yaml +++ b/charts/gitops-runtime/templates/event-reporters/runtime-event-reporter/configmap.yaml @@ -1,22 +1,22 @@ -{{- define "runtime-reporter.resources.configmap.defaults"}} +{{- define "runtime-event-reporter.resources.configmap.defaults"}} argocd.server: {{ include "codefresh-gitops-runtime.argocd.server.no-protocol-url" . }} redis.server: {{ include "codefresh-gitops-runtime.argocd.redis.url" . }} repo.server: {{ include "codefresh-gitops-runtime.argocd.reposerver.url" . }} -sources.server: http://argo-api-gateway +sources.server: http://argo-gateway app.queue.size: '1000' max.app.retries: '5' threadiness: '100' {{- end }} -{{- $defaultConfig := (include "runtime-reporter.resources.configmap.defaults" . | fromYaml ) }} +{{- $defaultConfig := (include "runtime-event-reporter.resources.configmap.defaults" . | fromYaml ) }} {{- $globalOverrides := index .Values "global" "event-reporters" "config" | default dict }} -{{- $reporterOverrides := index .Values "event-reporters" "runtime-reporter" "config" | default dict }} +{{- $reporterOverrides := index .Values "event-reporters" "runtime-event-reporter" "config" | default dict }} {{- $mergedConfig := mergeOverwrite $defaultConfig $globalOverrides $reporterOverrides }} apiVersion: v1 kind: ConfigMap metadata: - name: runtime-reporter-cmd-params-cm + name: runtime-event-reporter-cmd-params-cm labels: - {{- include "runtime-reporter.labels" . | nindent 4 }} + {{- include "runtime-event-reporter.labels" . | nindent 4 }} data: {{- $mergedConfig | toYaml | nindent 2 }} diff --git a/charts/gitops-runtime/templates/event-reporters/runtime-reporter/deployment.yaml b/charts/gitops-runtime/templates/event-reporters/runtime-event-reporter/deployment.yaml similarity index 87% rename from charts/gitops-runtime/templates/event-reporters/runtime-reporter/deployment.yaml rename to charts/gitops-runtime/templates/event-reporters/runtime-event-reporter/deployment.yaml index d12ad741..fc620544 100644 --- a/charts/gitops-runtime/templates/event-reporters/runtime-reporter/deployment.yaml +++ b/charts/gitops-runtime/templates/event-reporters/runtime-event-reporter/deployment.yaml @@ -2,25 +2,25 @@ {{- $_ := set $context "Values" (deepCopy (get (index .Values "global") "event-reporters")) }} {{- $_ := set $context.Values "global" (deepCopy (get .Values "global")) }} {{/* Merge .Values.event-reporters. with .Values.global.event-reporters */}} -{{- $valuesOverrides := index .Values "event-reporters" "runtime-reporter" }} +{{- $valuesOverrides := index .Values "event-reporters" "runtime-event-reporter" }} {{- $values := mergeOverwrite $context.Values $valuesOverrides }} {{- $_ := set $context "Values" $values }} {{/* Merge environment variables from calculated, defaults and overwrites */}} -{{- $defaults := (include "runtime-reporter.resources.environment-variables.defaults" $context | fromYaml) }} -{{- $calculated := (include "runtime-reporter.resources.environment-variables.calculated" $context | fromYaml) }} +{{- $defaults := (include "runtime-event-reporter.resources.environment-variables.defaults" $context | fromYaml) }} +{{- $calculated := (include "runtime-event-reporter.resources.environment-variables.calculated" $context | fromYaml) }} {{- $overrides := $context.Values.env }} {{- $mergedValues := mergeOverwrite $defaults $calculated $overrides }} apiVersion: apps/v1 kind: Deployment metadata: - name: {{ include "runtime-reporter.fullname" . }} + name: {{ include "runtime-event-reporter.fullname" . }} labels: - {{- include "runtime-reporter.labels" . | nindent 4 }} + {{- include "runtime-event-reporter.labels" . | nindent 4 }} spec: replicas: {{ $context.Values.replicaCount }} selector: matchLabels: - {{- include "runtime-reporter.selectorLabels" . | nindent 6 }} + {{- include "runtime-event-reporter.selectorLabels" . | nindent 6 }} template: metadata: {{- with $context.Values.podAnnotations }} @@ -28,7 +28,7 @@ spec: {{- toYaml . | nindent 8 }} {{- end }} labels: - {{- include "runtime-reporter.selectorLabels" . | nindent 8 }} + {{- include "runtime-event-reporter.selectorLabels" . | nindent 8 }} {{- with $context.Values.podLabels }} {{- toYaml . | nindent 8 }} {{- end }} @@ -37,11 +37,11 @@ spec: imagePullSecrets: {{- toYaml . | nindent 8 }} {{- end }} - serviceAccountName: {{ include "runtime-reporter.serviceAccountName" $context }} + serviceAccountName: {{ include "runtime-event-reporter.serviceAccountName" $context }} securityContext: {{- toYaml $context.Values.podSecurityContext | nindent 8 }} containers: - - name: {{ include "runtime-reporter.fullname" . }} + - name: {{ include "runtime-event-reporter.fullname" . }} securityContext: {{- toYaml $context.Values.securityContext | nindent 12 }} {{- $imageContext := deepCopy $context.Values.image }} diff --git a/charts/gitops-runtime/templates/event-reporters/runtime-reporter/pdb.yaml b/charts/gitops-runtime/templates/event-reporters/runtime-event-reporter/pdb.yaml similarity index 81% rename from charts/gitops-runtime/templates/event-reporters/runtime-reporter/pdb.yaml rename to charts/gitops-runtime/templates/event-reporters/runtime-event-reporter/pdb.yaml index 2ec29f28..cd135dbd 100644 --- a/charts/gitops-runtime/templates/event-reporters/runtime-reporter/pdb.yaml +++ b/charts/gitops-runtime/templates/event-reporters/runtime-event-reporter/pdb.yaml @@ -1,14 +1,14 @@ {{- $context := deepCopy . }} {{- $_ := set $context "Values" (deepCopy (get (index .Values "global") "event-reporters")) }} {{- $_ := set $context.Values "global" (deepCopy (get .Values "global")) }} -{{- $valuesOverrides := index .Values "event-reporters" "runtime-reporter" }} +{{- $valuesOverrides := index .Values "event-reporters" "runtime-event-reporter" }} {{- $_ := mergeOverwrite $context.Values $valuesOverrides | set $context "Values" }} {{- if and $context.Values.pdb.enabled }} apiVersion: policy/v1 kind: PodDisruptionBudget metadata: - name: {{ include "runtime-reporter.fullname" . }} + name: {{ include "runtime-event-reporter.fullname" . }} spec: {{- with $context.Values.pdb.minAvailable }} minAvailable: {{ . }} @@ -18,5 +18,5 @@ spec: {{- end }} selector: matchLabels: - {{- include "runtime-reporter.selectorLabels" . | nindent 6 }} + {{- include "runtime-event-reporter.selectorLabels" . | nindent 6 }} {{- end }} diff --git a/charts/gitops-runtime/templates/event-reporters/runtime-reporter/rbac.yaml b/charts/gitops-runtime/templates/event-reporters/runtime-event-reporter/rbac.yaml similarity index 61% rename from charts/gitops-runtime/templates/event-reporters/runtime-reporter/rbac.yaml rename to charts/gitops-runtime/templates/event-reporters/runtime-event-reporter/rbac.yaml index 3931a2fb..eecd102a 100644 --- a/charts/gitops-runtime/templates/event-reporters/runtime-reporter/rbac.yaml +++ b/charts/gitops-runtime/templates/event-reporters/runtime-event-reporter/rbac.yaml @@ -1,21 +1,21 @@ {{- $context := deepCopy . }} {{- $_ := set $context "Values" (deepCopy (get (index .Values "global") "event-reporters")) }} {{- $_ := set $context.Values "global" (deepCopy (get .Values "global")) }} -{{- $valuesOverrides := index .Values "event-reporters" "runtime-reporter" }} +{{- $valuesOverrides := index .Values "event-reporters" "runtime-event-reporter" }} {{- $_ := mergeOverwrite $context.Values $valuesOverrides | set $context "Values" }} apiVersion: v1 kind: ServiceAccount metadata: - name: {{ include "runtime-reporter.serviceAccountName" $context }} + name: {{ include "runtime-event-reporter.serviceAccountName" $context }} labels: - {{- include "runtime-reporter.labels" . | nindent 4 }} + {{- include "runtime-event-reporter.labels" . | nindent 4 }} --- apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: - name: {{ include "runtime-reporter.fullname" . }} + name: {{ include "runtime-event-reporter.fullname" . }} labels: - {{- include "runtime-reporter.labels" . | nindent 4 }} + {{- include "runtime-event-reporter.labels" . | nindent 4 }} rules: - apiGroups: - '*' @@ -31,14 +31,14 @@ rules: apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: - name: {{ include "runtime-reporter.fullname" . }} + name: {{ include "runtime-event-reporter.fullname" . }} labels: - {{- include "runtime-reporter.labels" . | nindent 4 }} + {{- include "runtime-event-reporter.labels" . | nindent 4 }} roleRef: apiGroup: rbac.authorization.k8s.io kind: ClusterRole - name: {{ include "runtime-reporter.fullname" . }} + name: {{ include "runtime-event-reporter.fullname" . }} subjects: - kind: ServiceAccount - name: {{ include "runtime-reporter.serviceAccountName" $context }} + name: {{ include "runtime-event-reporter.serviceAccountName" $context }} namespace: {{ .Release.Namespace }} diff --git a/charts/gitops-runtime/templates/event-reporters/runtime-reporter/service.yaml b/charts/gitops-runtime/templates/event-reporters/runtime-event-reporter/service.yaml similarity index 73% rename from charts/gitops-runtime/templates/event-reporters/runtime-reporter/service.yaml rename to charts/gitops-runtime/templates/event-reporters/runtime-event-reporter/service.yaml index 2772f146..c730c6e7 100644 --- a/charts/gitops-runtime/templates/event-reporters/runtime-reporter/service.yaml +++ b/charts/gitops-runtime/templates/event-reporters/runtime-event-reporter/service.yaml @@ -1,14 +1,14 @@ {{- $context := deepCopy . }} {{- $_ := set $context "Values" (deepCopy (get (index .Values "global") "event-reporters")) }} {{- $_ := set $context.Values "global" (deepCopy (get .Values "global")) }} -{{- $valuesOverrides := index .Values "event-reporters" "runtime-reporter" }} +{{- $valuesOverrides := index .Values "event-reporters" "runtime-event-reporter" }} {{- $_ := mergeOverwrite $context.Values $valuesOverrides | set $context "Values" }} apiVersion: v1 kind: Service metadata: - name: {{ include "runtime-reporter.fullname" . }} + name: {{ include "runtime-event-reporter.fullname" . }} labels: - {{- include "runtime-reporter.labels" . | nindent 4 }} + {{- include "runtime-event-reporter.labels" . | nindent 4 }} spec: type: ClusterIP ports: @@ -18,4 +18,4 @@ spec: targetPort: {{ $port.targetPort }} {{- end }} selector: - {{- include "runtime-reporter.selectorLabels" . | nindent 4 }} + {{- include "runtime-event-reporter.selectorLabels" . | nindent 4 }} diff --git a/charts/gitops-runtime/templates/event-reporters/runtime-reporter/serviceMonitor.yaml b/charts/gitops-runtime/templates/event-reporters/runtime-event-reporter/serviceMonitor.yaml similarity index 81% rename from charts/gitops-runtime/templates/event-reporters/runtime-reporter/serviceMonitor.yaml rename to charts/gitops-runtime/templates/event-reporters/runtime-event-reporter/serviceMonitor.yaml index bc583c9c..e95e23cb 100644 --- a/charts/gitops-runtime/templates/event-reporters/runtime-reporter/serviceMonitor.yaml +++ b/charts/gitops-runtime/templates/event-reporters/runtime-event-reporter/serviceMonitor.yaml @@ -1,22 +1,22 @@ {{- $context := deepCopy . }} {{- $_ := set $context "Values" (deepCopy (get (index .Values "global") "event-reporters")) }} {{- $_ := set $context.Values "global" (deepCopy (get .Values "global")) }} -{{- $valuesOverrides := index .Values "event-reporters" "runtime-reporter" }} +{{- $valuesOverrides := index .Values "event-reporters" "runtime-event-reporter" }} {{- $_ := mergeOverwrite $context.Values $valuesOverrides | set $context "Values" }} {{- if $context.Values.serviceMonitor.enabled -}} apiVersion: monitoring.coreos.com/v1 kind: ServiceMonitor metadata: - name: {{ include "runtime-reporter.fullname" . }} + name: {{ include "runtime-event-reporter.fullname" . }} labels: - {{- include "runtime-reporter.labels" . | nindent 4 }} + {{- include "runtime-event-reporter.labels" . | nindent 4 }} {{- with $context.Values.serviceMonitor.labels }} {{- toYaml . | nindent 4 }} {{- end }} spec: selector: matchLabels: - {{- include "runtime-reporter.selectorLabels" . | nindent 8 }} + {{- include "runtime-event-reporter.selectorLabels" . | nindent 8 }} endpoints: - port: metrics {{- if $context.Values.serviceMonitor.interval }} diff --git a/charts/gitops-runtime/tests/argo-api-gateway_test.yaml b/charts/gitops-runtime/tests/argo-api-gateway_test.yaml index 6d23efa2..a6cd2d88 100644 --- a/charts/gitops-runtime/tests/argo-api-gateway_test.yaml +++ b/charts/gitops-runtime/tests/argo-api-gateway_test.yaml @@ -1,10 +1,10 @@ # yaml-language-server: $schema=https://raw.githubusercontent.com/helm-unittest/helm-unittest/main/schema/helm-testsuite.json -suite: argo-api-gateway tests +suite: argo-gateway tests templates: - - argo-api-gateway/** + - argo-gateway/** tests: - it: Argo Api Gateway ConfigMap should have valid data - template: argo-api-gateway/configmap.yaml + template: argo-gateway/configmap.yaml values: - ./values/mandatory-values-ingress.yaml asserts: @@ -19,34 +19,34 @@ tests: value: argo-cd-repo-server:8081 - it: Argo Api Gateway Deployment should have valid matchLabel selectors - template: argo-api-gateway/deployment.yaml + template: argo-gateway/deployment.yaml values: - ./values/mandatory-values-ingress.yaml asserts: - equal: path: spec.selector.matchLabels value: - app.kubernetes.io/name: argo-api-gateway + app.kubernetes.io/name: argo-gateway app.kubernetes.io/instance: RELEASE-NAME - equal: path: spec.template.metadata.labels value: - app.kubernetes.io/name: argo-api-gateway + app.kubernetes.io/name: argo-gateway app.kubernetes.io/instance: RELEASE-NAME - it: Argo Api Gateway Service should have valid matchLabel selectors - template: argo-api-gateway/service.yaml + template: argo-gateway/service.yaml values: - ./values/mandatory-values-ingress.yaml asserts: - equal: path: spec.selector value: - app.kubernetes.io/name: argo-api-gateway + app.kubernetes.io/name: argo-gateway app.kubernetes.io/instance: RELEASE-NAME - it: Argo Api Gateway should be deployed with forked ArgoCD - template: argo-api-gateway/deployment.yaml + template: argo-gateway/deployment.yaml values: - ./values/mandatory-values-ingress.yaml asserts: @@ -56,10 +56,10 @@ tests: of: Deployment - equal: path: metadata.name - value: argo-api-gateway + value: argo-gateway - it: Argo Api Gateway should be deployed with external OSS ArgoCD - template: argo-api-gateway/deployment.yaml + template: argo-gateway/deployment.yaml values: - ./values/mandatory-values-ingress.yaml - ./values/external-argocd-values.yaml @@ -70,10 +70,10 @@ tests: of: Deployment - equal: path: metadata.name - value: argo-api-gateway + value: argo-gateway - it: Argo Api Gateway ConfigMap should have valid redis-ha url - template: argo-api-gateway/configmap.yaml + template: argo-gateway/configmap.yaml values: - ./values/mandatory-values-ingress.yaml set: @@ -86,7 +86,7 @@ tests: value: RELEASE-NAME-redis-ha-haproxy:6379 - it: Argo Api Gateway should have CODEFRESH_SSL_CERT_PATH env var when .Values.global.codefresh.tls.caCerts.secret.create is true - template: argo-api-gateway/deployment.yaml + template: argo-gateway/deployment.yaml values: - ./values/mandatory-values-ingress.yaml set: @@ -119,7 +119,7 @@ tests: readOnly: true - it: Argo Api Gateway should have CODEFRESH_SSL_CERT_PATH env var when .Values.global.codefresh.tls.caCerts.secretKeyRef is set - template: argo-api-gateway/deployment.yaml + template: argo-gateway/deployment.yaml values: - ./values/mandatory-values-ingress.yaml set: diff --git a/charts/gitops-runtime/tests/event-reporters_test.yaml b/charts/gitops-runtime/tests/event-reporters_test.yaml index 45d05edd..c1ea127e 100644 --- a/charts/gitops-runtime/tests/event-reporters_test.yaml +++ b/charts/gitops-runtime/tests/event-reporters_test.yaml @@ -1,10 +1,10 @@ # yaml-language-server: $schema=https://raw.githubusercontent.com/helm-unittest/helm-unittest/main/schema/helm-testsuite.json -suite: argo-api-gateway tests +suite: argo-gateway tests templates: - event-reporters/**/*.yaml tests: - it: Runtime Reporter should be deployed with forked ArgoCD - template: event-reporters/runtime-reporter/deployment.yaml + template: event-reporters/runtime-event-reporter/deployment.yaml values: - ./values/mandatory-values-ingress.yaml asserts: @@ -14,10 +14,10 @@ tests: of: Deployment - equal: path: metadata.name - value: runtime-reporter + value: runtime-event-reporter - it: Runtime Reporter should be deployed with external OSS ArgoCD - template: event-reporters/runtime-reporter/deployment.yaml + template: event-reporters/runtime-event-reporter/deployment.yaml values: - ./values/mandatory-values-ingress.yaml - ./values/external-argocd-values.yaml @@ -28,10 +28,10 @@ tests: of: Deployment - equal: path: metadata.name - value: runtime-reporter + value: runtime-event-reporter - it: Runtime Reporter ConfigMap should have valid redis-ha url - template: event-reporters/runtime-reporter/configmap.yaml + template: event-reporters/runtime-event-reporter/configmap.yaml values: - ./values/mandatory-values-ingress.yaml set: @@ -44,7 +44,7 @@ tests: value: RELEASE-NAME-redis-ha-haproxy:6379 - it: Runtime Reporter should have CODEFRESH_SSL_CERT_PATH env var when .Values.global.codefresh.tls.caCerts.secret.create is true - template: event-reporters/runtime-reporter/deployment.yaml + template: event-reporters/runtime-event-reporter/deployment.yaml values: - ./values/mandatory-values-ingress.yaml set: @@ -77,7 +77,7 @@ tests: readOnly: true - it: Runtime Reporter should have CODEFRESH_SSL_CERT_PATH env var when .Values.global.codefresh.tls.caCerts.secretKeyRef is set - template: event-reporters/runtime-reporter/deployment.yaml + template: event-reporters/runtime-event-reporter/deployment.yaml values: - ./values/mandatory-values-ingress.yaml set: @@ -106,7 +106,7 @@ tests: readOnly: true - it: Runtime Reporter should use local env over global Values.event-reporters.env - template: event-reporters/runtime-reporter/deployment.yaml + template: event-reporters/runtime-event-reporter/deployment.yaml values: - ./values/mandatory-values-ingress.yaml set: @@ -115,7 +115,7 @@ tests: env: FOO: outer event-reporters: - runtime-reporter: + runtime-event-reporter: env: FOO: inner BAR: inner @@ -128,7 +128,7 @@ tests: value: inner - it: Runtime Reporter should use local values over global Values.event-reporters - template: event-reporters/runtime-reporter/deployment.yaml + template: event-reporters/runtime-event-reporter/deployment.yaml values: - ./values/mandatory-values-ingress.yaml set: @@ -142,7 +142,7 @@ tests: cpu: 100m memory: 128Mi event-reporters: - runtime-reporter: + runtime-event-reporter: resources: limits: cpu: 200m diff --git a/charts/gitops-runtime/tests/external_argocd_test.yaml b/charts/gitops-runtime/tests/external_argocd_test.yaml index a69f8eb1..328b8d95 100644 --- a/charts/gitops-runtime/tests/external_argocd_test.yaml +++ b/charts/gitops-runtime/tests/external_argocd_test.yaml @@ -4,7 +4,7 @@ templates: - app-proxy/deployment.yaml - gitops-operator/* - event-reporters/**/*.yaml - - argo-api-gateway/** + - argo-gateway/** - _components/gitops-operator/* - app-proxy/external-argocd-token.yaml - codefresh-cm.yaml @@ -235,8 +235,8 @@ tests: name: ARGO_CD_URL value: my-argocd-server:80 - - it: runtime-reporter ConfigMap should have valid ArgoCd URL - template: event-reporters/runtime-reporter/configmap.yaml + - it: runtime-event-reporter ConfigMap should have valid ArgoCd URL + template: event-reporters/runtime-event-reporter/configmap.yaml values: - ./values/mandatory-values-ingress.yaml - ./values/external-argocd-values.yaml @@ -245,8 +245,8 @@ tests: path: data["argocd.server"] value: my-argocd-server:80 - - it: runtime-reporter ConfigMap should have valid Redis URL - template: event-reporters/runtime-reporter/configmap.yaml + - it: runtime-event-reporter ConfigMap should have valid Redis URL + template: event-reporters/runtime-event-reporter/configmap.yaml values: - ./values/mandatory-values-ingress.yaml - ./values/external-argocd-values.yaml @@ -255,18 +255,18 @@ tests: path: data["redis.server"] value: my-argocd-redis:6379 - - it: runtime-reporter ConfigMap should have valid Sources Server address - template: event-reporters/runtime-reporter/configmap.yaml + - it: runtime-event-reporter ConfigMap should have valid Sources Server address + template: event-reporters/runtime-event-reporter/configmap.yaml values: - ./values/mandatory-values-ingress.yaml - ./values/external-argocd-values.yaml asserts: - equal: path: data["sources.server"] - value: http://argo-api-gateway + value: http://argo-gateway - - it: runtime-reporter ConfigMap should have valid Repo Server URL - template: event-reporters/runtime-reporter/configmap.yaml + - it: runtime-event-reporter ConfigMap should have valid Repo Server URL + template: event-reporters/runtime-event-reporter/configmap.yaml values: - ./values/mandatory-values-ingress.yaml - ./values/external-argocd-values.yaml @@ -275,8 +275,8 @@ tests: path: data["repo.server"] value: my-argocd-repo-server:8081 - - it: runtime-reporter Deployment should have valid default ARGO_CD_TOKEN_SECRET_NAME env var - template: event-reporters/runtime-reporter/deployment.yaml + - it: runtime-event-reporter Deployment should have valid default ARGO_CD_TOKEN_SECRET_NAME env var + template: event-reporters/runtime-event-reporter/deployment.yaml values: - ./values/mandatory-values-ingress.yaml - ./values/external-argocd-values.yaml @@ -287,8 +287,8 @@ tests: name: ARGO_CD_TOKEN_SECRET_NAME value: argocd-token - - it: runtime-reporter Deployment should have valid default ARGO_CD_TOKEN_SECRET_KEY env var - template: event-reporters/runtime-reporter/deployment.yaml + - it: runtime-event-reporter Deployment should have valid default ARGO_CD_TOKEN_SECRET_KEY env var + template: event-reporters/runtime-event-reporter/deployment.yaml values: - ./values/mandatory-values-ingress.yaml - ./values/external-argocd-values.yaml @@ -299,8 +299,8 @@ tests: name: ARGO_CD_TOKEN_SECRET_KEY value: token - - it: runtime-reporter Deployment should have valid ARGO_CD_TOKEN_SECRET_NAME env var set via tokenSecretKeyRef - template: event-reporters/runtime-reporter/deployment.yaml + - it: runtime-event-reporter Deployment should have valid ARGO_CD_TOKEN_SECRET_NAME env var set via tokenSecretKeyRef + template: event-reporters/runtime-event-reporter/deployment.yaml values: - ./values/mandatory-values-ingress.yaml - ./values/external-argocd-values.yaml @@ -315,8 +315,8 @@ tests: name: ARGO_CD_TOKEN_SECRET_NAME value: my-argocd-token-secret - - it: runtime-reporter Deployment should have valid ARGO_CD_TOKEN_SECRET_KEY env var set via tokenSecretKeyRef - template: event-reporters/runtime-reporter/deployment.yaml + - it: runtime-event-reporter Deployment should have valid ARGO_CD_TOKEN_SECRET_KEY env var set via tokenSecretKeyRef + template: event-reporters/runtime-event-reporter/deployment.yaml values: - ./values/mandatory-values-ingress.yaml - ./values/external-argocd-values.yaml @@ -331,8 +331,8 @@ tests: name: ARGO_CD_TOKEN_SECRET_KEY value: my-token - - it: runtime-reporter Deployment should have valid ARGO_CD_TOKEN_SECRET_NAME env var set via plaintext token - template: event-reporters/runtime-reporter/deployment.yaml + - it: runtime-event-reporter Deployment should have valid ARGO_CD_TOKEN_SECRET_NAME env var set via plaintext token + template: event-reporters/runtime-event-reporter/deployment.yaml values: - ./values/mandatory-values-ingress.yaml - ./values/external-argocd-values.yaml @@ -346,8 +346,8 @@ tests: name: ARGO_CD_TOKEN_SECRET_NAME value: gitops-runtime-argo-cd-token - - it: runtime-reporter Deployment should have valid ARGO_CD_TOKEN_SECRET_KEY env var set via plaintext token - template: event-reporters/runtime-reporter/deployment.yaml + - it: runtime-event-reporter Deployment should have valid ARGO_CD_TOKEN_SECRET_KEY env var set via plaintext token + template: event-reporters/runtime-event-reporter/deployment.yaml values: - ./values/mandatory-values-ingress.yaml - ./values/external-argocd-values.yaml @@ -361,8 +361,8 @@ tests: name: ARGO_CD_TOKEN_SECRET_KEY value: token - - it: argo-api-gateway ConfigMap should have valid ArgoCd URL - template: argo-api-gateway/configmap.yaml + - it: argo-gateway ConfigMap should have valid ArgoCd URL + template: argo-gateway/configmap.yaml values: - ./values/mandatory-values-ingress.yaml - ./values/external-argocd-values.yaml @@ -371,8 +371,8 @@ tests: path: data["argocd.server"] value: my-argocd-server:80 - - it: argo-api-gateway ConfigMap should have valid Redis URL - template: argo-api-gateway/configmap.yaml + - it: argo-gateway ConfigMap should have valid Redis URL + template: argo-gateway/configmap.yaml values: - ./values/mandatory-values-ingress.yaml - ./values/external-argocd-values.yaml @@ -381,8 +381,8 @@ tests: path: data["redis.server"] value: my-argocd-redis:6379 - - it: argo-api-gateway ConfigMap should have valid Repo Server URL - template: argo-api-gateway/configmap.yaml + - it: argo-gateway ConfigMap should have valid Repo Server URL + template: argo-gateway/configmap.yaml values: - ./values/mandatory-values-ingress.yaml - ./values/external-argocd-values.yaml @@ -391,8 +391,8 @@ tests: path: data["repo.server"] value: my-argocd-repo-server:8081 - - it: argo-api-gateway Deployment should have valid default ARGO_CD_TOKEN_SECRET_NAME env var - template: argo-api-gateway/deployment.yaml + - it: argo-gateway Deployment should have valid default ARGO_CD_TOKEN_SECRET_NAME env var + template: argo-gateway/deployment.yaml values: - ./values/mandatory-values-ingress.yaml - ./values/external-argocd-values.yaml @@ -403,8 +403,8 @@ tests: name: ARGO_CD_TOKEN_SECRET_NAME value: argocd-token - - it: argo-api-gateway Deployment should have valid default ARGO_CD_TOKEN_SECRET_KEY env var - template: argo-api-gateway/deployment.yaml + - it: argo-gateway Deployment should have valid default ARGO_CD_TOKEN_SECRET_KEY env var + template: argo-gateway/deployment.yaml values: - ./values/mandatory-values-ingress.yaml - ./values/external-argocd-values.yaml @@ -415,8 +415,8 @@ tests: name: ARGO_CD_TOKEN_SECRET_KEY value: token - - it: argo-api-gateway Deployment should have valid ARGO_CD_TOKEN_SECRET_NAME env var set via tokenSecretKeyRef - template: argo-api-gateway/deployment.yaml + - it: argo-gateway Deployment should have valid ARGO_CD_TOKEN_SECRET_NAME env var set via tokenSecretKeyRef + template: argo-gateway/deployment.yaml values: - ./values/mandatory-values-ingress.yaml - ./values/external-argocd-values.yaml @@ -431,8 +431,8 @@ tests: name: ARGO_CD_TOKEN_SECRET_NAME value: my-argocd-token-secret - - it: argo-api-gateway Deployment should have valid ARGO_CD_TOKEN_SECRET_KEY env var set via tokenSecretKeyRef - template: argo-api-gateway/deployment.yaml + - it: argo-gateway Deployment should have valid ARGO_CD_TOKEN_SECRET_KEY env var set via tokenSecretKeyRef + template: argo-gateway/deployment.yaml values: - ./values/mandatory-values-ingress.yaml - ./values/external-argocd-values.yaml @@ -447,8 +447,8 @@ tests: name: ARGO_CD_TOKEN_SECRET_KEY value: my-token - - it: argo-api-gateway Deployment should have valid ARGO_CD_TOKEN_SECRET_NAME env var set via plaintext token - template: argo-api-gateway/deployment.yaml + - it: argo-gateway Deployment should have valid ARGO_CD_TOKEN_SECRET_NAME env var set via plaintext token + template: argo-gateway/deployment.yaml values: - ./values/mandatory-values-ingress.yaml - ./values/external-argocd-values.yaml @@ -462,8 +462,8 @@ tests: name: ARGO_CD_TOKEN_SECRET_NAME value: gitops-runtime-argo-cd-token - - it: argo-api-gateway Deployment should have valid ARGO_CD_TOKEN_SECRET_KEY env var set via plaintext token - template: argo-api-gateway/deployment.yaml + - it: argo-gateway Deployment should have valid ARGO_CD_TOKEN_SECRET_KEY env var set via plaintext token + template: argo-gateway/deployment.yaml values: - ./values/mandatory-values-ingress.yaml - ./values/external-argocd-values.yaml @@ -521,8 +521,8 @@ tests: - failedTemplate: errorMessage: "Invalid value for .Values.global.external-argo-cd.auth.type: invalid. Allowed values are: [password token]" - - it: runtime-reporter Deployment should have valid ARGOCD_SERVER_ROOTPATH env var - template: event-reporters/runtime-reporter/deployment.yaml + - it: runtime-event-reporter Deployment should have valid ARGOCD_SERVER_ROOTPATH env var + template: event-reporters/runtime-event-reporter/deployment.yaml values: - ./values/mandatory-values-ingress.yaml - ./values/external-argocd-values.yaml @@ -535,8 +535,8 @@ tests: name: ARGOCD_SERVER_ROOTPATH value: /argocd - - it: argo-api-gateway Deployment should have valid ARGOCD_SERVER_ROOTPATH env var - template: argo-api-gateway/deployment.yaml + - it: argo-gateway Deployment should have valid ARGOCD_SERVER_ROOTPATH env var + template: argo-gateway/deployment.yaml values: - ./values/mandatory-values-ingress.yaml - ./values/external-argocd-values.yaml @@ -609,7 +609,7 @@ tests: - isNotNullOrEmpty: path: stringData.token - - it: codefresh-cm ConfigMap should have runtime-reporter and sources-server + - it: codefresh-cm ConfigMap should have runtime-event-reporter and sources-server template: codefresh-cm.yaml values: - ./values/mandatory-values-ingress.yaml @@ -620,7 +620,7 @@ tests: pattern: "name: event-reporter" - matchRegex: path: data.components - pattern: "name: argo-api-gateway" + pattern: "name: argo-gateway" - it: should require ArgoCd token if auth.type=token is set and no token is provided values: diff --git a/charts/gitops-runtime/tests/global_constraints_test.yaml b/charts/gitops-runtime/tests/global_constraints_test.yaml index 133ed04b..35f4baa9 100644 --- a/charts/gitops-runtime/tests/global_constraints_test.yaml +++ b/charts/gitops-runtime/tests/global_constraints_test.yaml @@ -3,7 +3,7 @@ templates: - app-proxy/deployment.yaml - gitops-operator/* - event-reporters/** - - argo-api-gateway/** + - argo-gateway/** - _components/gitops-operator/* - tunnel-client.yaml - charts/codefresh-tunnel-client/* @@ -53,13 +53,13 @@ tests: value: some-value effect: NoSchedule template: internal-router/deployment.yaml - # -- runtime-reporter + # -- runtime-event-reporter - equal: path: spec.template.spec.nodeSelector value: some-key: some-value extra-key: extra-value - template: event-reporters/runtime-reporter/deployment.yaml + template: event-reporters/runtime-event-reporter/deployment.yaml - equal: path: spec.template.spec.tolerations value: @@ -67,14 +67,14 @@ tests: operator: Equal value: some-value effect: NoSchedule - template: event-reporters/runtime-reporter/deployment.yaml - # -- argo-api-gateway + template: event-reporters/runtime-event-reporter/deployment.yaml + # -- argo-gateway - equal: path: spec.template.spec.nodeSelector value: some-key: some-value extra-key: extra-value - template: argo-api-gateway/deployment.yaml + template: argo-gateway/deployment.yaml - equal: path: spec.template.spec.tolerations value: @@ -82,7 +82,7 @@ tests: operator: Equal value: some-value effect: NoSchedule - template: argo-api-gateway/deployment.yaml + template: argo-gateway/deployment.yaml # -- codefresh-eventbus - equal: path: spec.nats.native.nodeSelector @@ -188,7 +188,7 @@ tests: value: some-key: some-value extra-key: extra-value - template: argo-api-gateway/deployment.yaml + template: argo-gateway/deployment.yaml - equal: path: spec.template.spec.tolerations value: @@ -196,14 +196,14 @@ tests: operator: Equal value: some-value effect: NoSchedule - template: argo-api-gateway/deployment.yaml + template: argo-gateway/deployment.yaml # -- event-reporter - equal: path: spec.template.spec.nodeSelector value: some-key: some-value extra-key: extra-value - template: event-reporters/runtime-reporter/deployment.yaml + template: event-reporters/runtime-event-reporter/deployment.yaml - equal: path: spec.template.spec.tolerations value: @@ -211,7 +211,7 @@ tests: operator: Equal value: some-value effect: NoSchedule - template: event-reporters/runtime-reporter/deployment.yaml + template: event-reporters/runtime-event-reporter/deployment.yaml # -- gitops-operator - equal: path: spec.template.spec.nodeSelector @@ -435,7 +435,7 @@ tests: value: some-key: another-value foo: bar - template: argo-api-gateway/deployment.yaml + template: argo-gateway/deployment.yaml - equal: path: spec.template.spec.tolerations value: @@ -443,14 +443,14 @@ tests: operator: Equal value: another-value effect: NoSchedule - template: argo-api-gateway/deployment.yaml + template: argo-gateway/deployment.yaml # -- event-reporter - equal: path: spec.template.spec.nodeSelector value: some-key: another-value foo: bar - template: event-reporters/runtime-reporter/deployment.yaml + template: event-reporters/runtime-event-reporter/deployment.yaml - equal: path: spec.template.spec.tolerations value: @@ -458,7 +458,7 @@ tests: operator: Equal value: another-value effect: NoSchedule - template: event-reporters/runtime-reporter/deployment.yaml + template: event-reporters/runtime-event-reporter/deployment.yaml # -- gitops-operator - equal: path: spec.template.spec.nodeSelector diff --git a/charts/gitops-runtime/tests/values/subcharts-constraints-values.yaml b/charts/gitops-runtime/tests/values/subcharts-constraints-values.yaml index 95bfaa41..766d781c 100644 --- a/charts/gitops-runtime/tests/values/subcharts-constraints-values.yaml +++ b/charts/gitops-runtime/tests/values/subcharts-constraints-values.yaml @@ -48,7 +48,7 @@ installer: nodeSelector: *nodeSelector tolerations: *tolerations -argo-api-gateway: +argo-gateway: nodeSelector: *nodeSelector tolerations: *tolerations diff --git a/charts/gitops-runtime/values.yaml b/charts/gitops-runtime/values.yaml index 2b5ceebd..01cafffc 100644 --- a/charts/gitops-runtime/values.yaml +++ b/charts/gitops-runtime/values.yaml @@ -713,7 +713,7 @@ gitops-operator: minAvailable: 1 maxUnavailable: "" -argo-api-gateway: +argo-gateway: image: registry: quay.io repository: codefresh/dev/cf-argocd-extras @@ -757,5 +757,5 @@ argo-api-gateway: labels: {} event-reporters: - runtime-reporter: {} - resources-reporter: {} + runtime-event-reporter: {} + cluster-event-reporter: {} From 2d2d911fb5c1b56452bd6e8974ccb71a6a023955 Mon Sep 17 00:00:00 2001 From: oleksandr-codefresh Date: Mon, 29 Sep 2025 11:21:10 +0300 Subject: [PATCH 18/37] event-reporters: added RESOURCE_THREADINESS, new tag 7aefaaf --- .../event-reporters/cluster-event-reporter/_env.yaml | 9 +++++++-- .../cluster-event-reporter/configmap.yaml | 3 ++- .../event-reporters/runtime-event-reporter/_env.yaml | 9 +++++++-- .../runtime-event-reporter/configmap.yaml | 3 ++- charts/gitops-runtime/tests/external_argocd_test.yaml | 2 +- charts/gitops-runtime/values.yaml | 10 +++++++--- 6 files changed, 26 insertions(+), 10 deletions(-) diff --git a/charts/gitops-runtime/templates/event-reporters/cluster-event-reporter/_env.yaml b/charts/gitops-runtime/templates/event-reporters/cluster-event-reporter/_env.yaml index 4d761ef9..94830d3d 100644 --- a/charts/gitops-runtime/templates/event-reporters/cluster-event-reporter/_env.yaml +++ b/charts/gitops-runtime/templates/event-reporters/cluster-event-reporter/_env.yaml @@ -170,14 +170,19 @@ SHARDING_ALGORITHM: name: cluster-event-reporter-cmd-params-cm key: sharding.algorithm optional: true -SOURCES_SERVER: +ARGO_GATEWAY_URL: valueFrom: configMapKeyRef: name: cluster-event-reporter-cmd-params-cm - key: sources.server + key: argo-gateway.server THREADINESS: valueFrom: configMapKeyRef: name: cluster-event-reporter-cmd-params-cm key: threadiness +RESOURCE_THREADINESS: + valueFrom: + configMapKeyRef: + name: cluster-event-reporter-cmd-params-cm + key: resource.threadiness {{- end -}} diff --git a/charts/gitops-runtime/templates/event-reporters/cluster-event-reporter/configmap.yaml b/charts/gitops-runtime/templates/event-reporters/cluster-event-reporter/configmap.yaml index 4c8ccb95..0a740a50 100644 --- a/charts/gitops-runtime/templates/event-reporters/cluster-event-reporter/configmap.yaml +++ b/charts/gitops-runtime/templates/event-reporters/cluster-event-reporter/configmap.yaml @@ -2,7 +2,8 @@ argocd.server: {{ include "codefresh-gitops-runtime.argocd.server.no-protocol-url" . }} redis.server: {{ include "codefresh-gitops-runtime.argocd.redis.url" . }} repo.server: {{ include "codefresh-gitops-runtime.argocd.reposerver.url" . }} -sources.server: http://argo-gateway +argo-gateway.server: http://argo-gateway +resource.threadiness: '100' app.queue.size: '1000' max.app.retries: '5' threadiness: '100' diff --git a/charts/gitops-runtime/templates/event-reporters/runtime-event-reporter/_env.yaml b/charts/gitops-runtime/templates/event-reporters/runtime-event-reporter/_env.yaml index 326bf463..3158f5f3 100644 --- a/charts/gitops-runtime/templates/event-reporters/runtime-event-reporter/_env.yaml +++ b/charts/gitops-runtime/templates/event-reporters/runtime-event-reporter/_env.yaml @@ -170,14 +170,19 @@ SHARDING_ALGORITHM: name: runtime-event-reporter-cmd-params-cm key: sharding.algorithm optional: true -SOURCES_SERVER: +ARGO_GATEWAY_URL: valueFrom: configMapKeyRef: name: runtime-event-reporter-cmd-params-cm - key: sources.server + key: argo-gateway.server THREADINESS: valueFrom: configMapKeyRef: name: runtime-event-reporter-cmd-params-cm key: threadiness +RESOURCE_THREADINESS: + valueFrom: + configMapKeyRef: + name: runtime-event-reporter-cmd-params-cm + key: resource.threadiness {{- end -}} diff --git a/charts/gitops-runtime/templates/event-reporters/runtime-event-reporter/configmap.yaml b/charts/gitops-runtime/templates/event-reporters/runtime-event-reporter/configmap.yaml index 10b2e08b..93316c77 100644 --- a/charts/gitops-runtime/templates/event-reporters/runtime-event-reporter/configmap.yaml +++ b/charts/gitops-runtime/templates/event-reporters/runtime-event-reporter/configmap.yaml @@ -2,7 +2,8 @@ argocd.server: {{ include "codefresh-gitops-runtime.argocd.server.no-protocol-url" . }} redis.server: {{ include "codefresh-gitops-runtime.argocd.redis.url" . }} repo.server: {{ include "codefresh-gitops-runtime.argocd.reposerver.url" . }} -sources.server: http://argo-gateway +argo-gateway.server: http://argo-gateway +resource.threadiness: '10' app.queue.size: '1000' max.app.retries: '5' threadiness: '100' diff --git a/charts/gitops-runtime/tests/external_argocd_test.yaml b/charts/gitops-runtime/tests/external_argocd_test.yaml index 328b8d95..b4f9b345 100644 --- a/charts/gitops-runtime/tests/external_argocd_test.yaml +++ b/charts/gitops-runtime/tests/external_argocd_test.yaml @@ -262,7 +262,7 @@ tests: - ./values/external-argocd-values.yaml asserts: - equal: - path: data["sources.server"] + path: data["argo-gateway.server"] value: http://argo-gateway - it: runtime-event-reporter ConfigMap should have valid Repo Server URL diff --git a/charts/gitops-runtime/values.yaml b/charts/gitops-runtime/values.yaml index 01cafffc..11642643 100644 --- a/charts/gitops-runtime/values.yaml +++ b/charts/gitops-runtime/values.yaml @@ -201,7 +201,7 @@ global: image: registry: quay.io repository: codefresh/dev/cf-argocd-extras - tag: cr-30629-resource-reporter-workqueu-2-66d7459 + tag: cr-30629-resource-reporter-workqueu-2-7aefaaf nodeSelector: {} tolerations: [] affinity: {} @@ -717,7 +717,7 @@ argo-gateway: image: registry: quay.io repository: codefresh/dev/cf-argocd-extras - tag: cr-30629-resource-reporter-workqueu-2-66d7459 + tag: cr-30629-resource-reporter-workqueu-2-7aefaaf nodeSelector: {} tolerations: [] affinity: {} @@ -758,4 +758,8 @@ argo-gateway: event-reporters: runtime-event-reporter: {} - cluster-event-reporter: {} + cluster-event-reporter: + resources: + requests: + memory: "512Mi" + cpu: "256m" From 335d4b2ee52a3652edd82decb409b99d3a3c9921 Mon Sep 17 00:00:00 2001 From: oleksandr-codefresh Date: Mon, 29 Sep 2025 11:46:00 +0300 Subject: [PATCH 19/37] event-reporters: added SERVICE_NAME --- .../templates/event-reporters/cluster-event-reporter/_env.yaml | 1 + .../templates/event-reporters/runtime-event-reporter/_env.yaml | 1 + 2 files changed, 2 insertions(+) diff --git a/charts/gitops-runtime/templates/event-reporters/cluster-event-reporter/_env.yaml b/charts/gitops-runtime/templates/event-reporters/cluster-event-reporter/_env.yaml index 94830d3d..9723a719 100644 --- a/charts/gitops-runtime/templates/event-reporters/cluster-event-reporter/_env.yaml +++ b/charts/gitops-runtime/templates/event-reporters/cluster-event-reporter/_env.yaml @@ -185,4 +185,5 @@ RESOURCE_THREADINESS: configMapKeyRef: name: cluster-event-reporter-cmd-params-cm key: resource.threadiness +SERVICE_NAME: {{ include "cluster-event-reporter.fullname" . }} {{- end -}} diff --git a/charts/gitops-runtime/templates/event-reporters/runtime-event-reporter/_env.yaml b/charts/gitops-runtime/templates/event-reporters/runtime-event-reporter/_env.yaml index 3158f5f3..af609b31 100644 --- a/charts/gitops-runtime/templates/event-reporters/runtime-event-reporter/_env.yaml +++ b/charts/gitops-runtime/templates/event-reporters/runtime-event-reporter/_env.yaml @@ -185,4 +185,5 @@ RESOURCE_THREADINESS: configMapKeyRef: name: runtime-event-reporter-cmd-params-cm key: resource.threadiness +SERVICE_NAME: {{ include "runtime-event-reporter.fullname" . }} {{- end -}} From 0f0dd37cf2c9a107716270e66dae29f5e050b5ea Mon Sep 17 00:00:00 2001 From: oleksandr-codefresh Date: Mon, 29 Sep 2025 11:54:59 +0300 Subject: [PATCH 20/37] argo-gateway: changed BINARY_NAME value --- charts/gitops-runtime/templates/argo-gateway/_env.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/gitops-runtime/templates/argo-gateway/_env.yaml b/charts/gitops-runtime/templates/argo-gateway/_env.yaml index 2bc7455b..ab08ca6e 100644 --- a/charts/gitops-runtime/templates/argo-gateway/_env.yaml +++ b/charts/gitops-runtime/templates/argo-gateway/_env.yaml @@ -36,7 +36,7 @@ ARGOCD_SERVER_ROOTPATH: name: argocd-cmd-params-cm key: server.rootpath optional: true -BINARY_NAME: sources-server +BINARY_NAME: argo-gateway CODEFRESH_SSL_CERT_PATH: "" CODEFRESH_TLS_INSECURE: valueFrom: From 40ce0ebfcd43c2cec7f92c8a27914c3b5e626bba Mon Sep 17 00:00:00 2001 From: oleksandr-codefresh Date: Mon, 29 Sep 2025 12:17:50 +0300 Subject: [PATCH 21/37] updated tag of extras 25ba257 --- charts/gitops-runtime/values.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/charts/gitops-runtime/values.yaml b/charts/gitops-runtime/values.yaml index 11642643..5e13d0fe 100644 --- a/charts/gitops-runtime/values.yaml +++ b/charts/gitops-runtime/values.yaml @@ -201,7 +201,7 @@ global: image: registry: quay.io repository: codefresh/dev/cf-argocd-extras - tag: cr-30629-resource-reporter-workqueu-2-7aefaaf + tag: cr-30629-resource-reporter-workqueu-2-25ba257 nodeSelector: {} tolerations: [] affinity: {} @@ -717,7 +717,7 @@ argo-gateway: image: registry: quay.io repository: codefresh/dev/cf-argocd-extras - tag: cr-30629-resource-reporter-workqueu-2-7aefaaf + tag: cr-30629-resource-reporter-workqueu-2-25ba257 nodeSelector: {} tolerations: [] affinity: {} From 24430227335dfb37403bddc8a4d71b1e299616d3 Mon Sep 17 00:00:00 2001 From: oleksandr-codefresh Date: Mon, 29 Sep 2025 13:10:50 +0300 Subject: [PATCH 22/37] runtime-event-reporter: fixed binary name --- .../event-reporters/runtime-event-reporter/_env.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/charts/gitops-runtime/templates/event-reporters/runtime-event-reporter/_env.yaml b/charts/gitops-runtime/templates/event-reporters/runtime-event-reporter/_env.yaml index af609b31..4bc161fd 100644 --- a/charts/gitops-runtime/templates/event-reporters/runtime-event-reporter/_env.yaml +++ b/charts/gitops-runtime/templates/event-reporters/runtime-event-reporter/_env.yaml @@ -23,7 +23,7 @@ CODEFRESH_SSL_CERT_PATH: {{ printf "/app/config/codefresh-tls-certs/%s" $secretK {{- end }} {{- define "runtime-event-reporter.resources.environment-variables.defaults" -}} -REPORTER_MODE: combined +REPORTER_MODE: app APP_QUEUE_SIZE: valueFrom: configMapKeyRef: @@ -48,7 +48,7 @@ ARGOCD_SERVER_ROOTPATH: optional: true ARGO_CD_TOKEN_SECRET_NAME: argocd-token ARGO_CD_TOKEN_SECRET_KEY: token -BINARY_NAME: runtime-event-reporter +BINARY_NAME: event-reporter CODEFRESH_SSL_CERT_PATH: "" CODEFRESH_TLS_INSECURE: valueFrom: From 100d9e6ad383a43081c704adeff5e967d7a57d1c Mon Sep 17 00:00:00 2001 From: Oleksandr Saulyak Date: Tue, 30 Sep 2025 18:38:23 +0300 Subject: [PATCH 23/37] extras 495366e --- charts/gitops-runtime/values.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/charts/gitops-runtime/values.yaml b/charts/gitops-runtime/values.yaml index 5e13d0fe..5edf71d7 100644 --- a/charts/gitops-runtime/values.yaml +++ b/charts/gitops-runtime/values.yaml @@ -201,7 +201,7 @@ global: image: registry: quay.io repository: codefresh/dev/cf-argocd-extras - tag: cr-30629-resource-reporter-workqueu-2-25ba257 + tag: cr-30629-resource-reporter-workqueu-2-495366e nodeSelector: {} tolerations: [] affinity: {} @@ -717,7 +717,7 @@ argo-gateway: image: registry: quay.io repository: codefresh/dev/cf-argocd-extras - tag: cr-30629-resource-reporter-workqueu-2-25ba257 + tag: cr-30629-resource-reporter-workqueu-2-495366e nodeSelector: {} tolerations: [] affinity: {} From eaffd6b93ae30637c2969d2292c0f70cdaef63b5 Mon Sep 17 00:00:00 2001 From: Oleksandr Saulyak Date: Tue, 30 Sep 2025 20:12:36 +0300 Subject: [PATCH 24/37] argo gateway url for app-proxy --- .../templates/_components/gitops-operator/_env.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/charts/gitops-runtime/templates/_components/gitops-operator/_env.yaml b/charts/gitops-runtime/templates/_components/gitops-operator/_env.yaml index f2e10f74..81e08f29 100644 --- a/charts/gitops-runtime/templates/_components/gitops-operator/_env.yaml +++ b/charts/gitops-runtime/templates/_components/gitops-operator/_env.yaml @@ -41,5 +41,6 @@ RUNTIME_VERSION: configMapKeyRef: name: codefresh-cm key: version -SOURCES_SERVER_URL: http://sources-server +SOURCES_SERVER_URL: http://argo-gateway +ARGO_GATEWAY_URL: http://argo-gateway {{- end -}} From 9d3f40cc8c172d57876b097f649b4e2dd9ab2e8d Mon Sep 17 00:00:00 2001 From: Oleksandr Saulyak Date: Tue, 30 Sep 2025 20:23:33 +0300 Subject: [PATCH 25/37] added ARGO_GATEWAY_URL SOURCES_SERVER_URL for app-proxy --- .../templates/_components/gitops-operator/_env.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/gitops-runtime/templates/_components/gitops-operator/_env.yaml b/charts/gitops-runtime/templates/_components/gitops-operator/_env.yaml index 81e08f29..96cdf8b3 100644 --- a/charts/gitops-runtime/templates/_components/gitops-operator/_env.yaml +++ b/charts/gitops-runtime/templates/_components/gitops-operator/_env.yaml @@ -41,6 +41,6 @@ RUNTIME_VERSION: configMapKeyRef: name: codefresh-cm key: version -SOURCES_SERVER_URL: http://argo-gateway +SOURCES_SERVER_URL: http://argo-gateway # TODO: remove and leave only ARGO_GATEWAY_URL ARGO_GATEWAY_URL: http://argo-gateway {{- end -}} From 463313f4ca2bbd7ca30791840f9b8e1b6881911a Mon Sep 17 00:00:00 2001 From: Mikhail Klimko Date: Wed, 1 Oct 2025 11:35:00 +0300 Subject: [PATCH 26/37] add component labels --- charts/gitops-runtime/templates/argo-gateway/_helpers.tpl | 1 + .../event-reporters/cluster-event-reporter/_helpers.tpl | 1 + .../event-reporters/runtime-event-reporter/_helpers.tpl | 1 + 3 files changed, 3 insertions(+) diff --git a/charts/gitops-runtime/templates/argo-gateway/_helpers.tpl b/charts/gitops-runtime/templates/argo-gateway/_helpers.tpl index 2a7b09ce..458a805d 100644 --- a/charts/gitops-runtime/templates/argo-gateway/_helpers.tpl +++ b/charts/gitops-runtime/templates/argo-gateway/_helpers.tpl @@ -25,6 +25,7 @@ app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} {{- end }} app.kubernetes.io/managed-by: {{ .Release.Service }} app.kubernetes.io/part-of: argo-gateway +app.kubernetes.io/component: argo-gateway codefresh.io/internal: "true" {{- end }} diff --git a/charts/gitops-runtime/templates/event-reporters/cluster-event-reporter/_helpers.tpl b/charts/gitops-runtime/templates/event-reporters/cluster-event-reporter/_helpers.tpl index fe5c5c91..c7a10fdc 100644 --- a/charts/gitops-runtime/templates/event-reporters/cluster-event-reporter/_helpers.tpl +++ b/charts/gitops-runtime/templates/event-reporters/cluster-event-reporter/_helpers.tpl @@ -25,6 +25,7 @@ app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} {{- end }} app.kubernetes.io/managed-by: {{ .Release.Service }} app.kubernetes.io/part-of: cluster-event-reporter +app.kubernetes.io/component: cluster-event-reporter codefresh.io/internal: "true" {{- end }} diff --git a/charts/gitops-runtime/templates/event-reporters/runtime-event-reporter/_helpers.tpl b/charts/gitops-runtime/templates/event-reporters/runtime-event-reporter/_helpers.tpl index 69dcf42f..85897319 100644 --- a/charts/gitops-runtime/templates/event-reporters/runtime-event-reporter/_helpers.tpl +++ b/charts/gitops-runtime/templates/event-reporters/runtime-event-reporter/_helpers.tpl @@ -25,6 +25,7 @@ app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} {{- end }} app.kubernetes.io/managed-by: {{ .Release.Service }} app.kubernetes.io/part-of: runtime-event-reporter +app.kubernetes.io/component: runtime-event-reporter codefresh.io/internal: "true" {{- end }} From 77c5e9a9eef3185e66368680a107c9894154da65 Mon Sep 17 00:00:00 2001 From: Oleksandr Saulyak Date: Wed, 1 Oct 2025 12:21:39 +0300 Subject: [PATCH 27/37] latest extras 1d99b0b --- charts/gitops-runtime/values.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/charts/gitops-runtime/values.yaml b/charts/gitops-runtime/values.yaml index 5edf71d7..6f9919a3 100644 --- a/charts/gitops-runtime/values.yaml +++ b/charts/gitops-runtime/values.yaml @@ -201,7 +201,7 @@ global: image: registry: quay.io repository: codefresh/dev/cf-argocd-extras - tag: cr-30629-resource-reporter-workqueu-2-495366e + tag: cr-30629-resource-reporter-workqueu-2-1d99b0b nodeSelector: {} tolerations: [] affinity: {} @@ -717,7 +717,7 @@ argo-gateway: image: registry: quay.io repository: codefresh/dev/cf-argocd-extras - tag: cr-30629-resource-reporter-workqueu-2-495366e + tag: cr-30629-resource-reporter-workqueu-2-1d99b0b nodeSelector: {} tolerations: [] affinity: {} From 822d1d6c228e2e394c9a0d0cce640a06923ba336 Mon Sep 17 00:00:00 2001 From: Oleksandr Saulyak Date: Wed, 1 Oct 2025 13:51:35 +0300 Subject: [PATCH 28/37] app-proxy 1.3795.0-cr-31129-resource-reporter-5a7ccae --- charts/gitops-runtime/values.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/charts/gitops-runtime/values.yaml b/charts/gitops-runtime/values.yaml index 6f9919a3..23ea0923 100644 --- a/charts/gitops-runtime/values.yaml +++ b/charts/gitops-runtime/values.yaml @@ -525,15 +525,15 @@ app-proxy: repository: codefreshplugins/argo-hub-codefresh-csdp-image-enricher-jira-info tag: 1.1.15-main image: - repository: quay.io/codefresh/cap-app-proxy - tag: 1.3750.0 + repository: quay.io/codefresh/dev/cap-app-proxy + tag: 1.3795.0-cr-31129-resource-reporter-5a7ccae pullPolicy: IfNotPresent # -- Extra volume mounts for main container extraVolumeMounts: [] initContainer: image: - repository: quay.io/codefresh/cap-app-proxy-init - tag: 1.3750.0 + repository: quay.io/codefresh/dev/cap-app-proxy-init + tag: 1.3795.0-cr-31129-resource-reporter-5a7ccae pullPolicy: IfNotPresent command: - ./init.sh From 88c2ff145e10992f02a3b349f0d8bbdf5a6b5eba Mon Sep 17 00:00:00 2001 From: Oleksandr Saulyak Date: Sat, 4 Oct 2025 08:48:49 +0300 Subject: [PATCH 29/37] bump extras version to prod build - 695977c --- charts/gitops-runtime/values.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/charts/gitops-runtime/values.yaml b/charts/gitops-runtime/values.yaml index 23ea0923..38d3de15 100644 --- a/charts/gitops-runtime/values.yaml +++ b/charts/gitops-runtime/values.yaml @@ -200,8 +200,8 @@ global: replicaCount: 2 image: registry: quay.io - repository: codefresh/dev/cf-argocd-extras - tag: cr-30629-resource-reporter-workqueu-2-1d99b0b + repository: codefresh/cf-argocd-extras + tag: 695977c nodeSelector: {} tolerations: [] affinity: {} @@ -716,8 +716,8 @@ gitops-operator: argo-gateway: image: registry: quay.io - repository: codefresh/dev/cf-argocd-extras - tag: cr-30629-resource-reporter-workqueu-2-1d99b0b + repository: codefresh/cf-argocd-extras + tag: 695977c nodeSelector: {} tolerations: [] affinity: {} From 3882de6ded105ec7c074caf3ce74b168d2ff4d5d Mon Sep 17 00:00:00 2001 From: Mikhail Klimko Date: Mon, 6 Oct 2025 13:33:08 +0300 Subject: [PATCH 30/37] merge main --- charts/gitops-runtime/values.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/charts/gitops-runtime/values.yaml b/charts/gitops-runtime/values.yaml index 27aa831b..58a53adf 100644 --- a/charts/gitops-runtime/values.yaml +++ b/charts/gitops-runtime/values.yaml @@ -778,3 +778,7 @@ argo-gateway: enabled: false minAvailable: "50%" maxUnavailable: "" + +event-reporters: + cluster-event-reporter: {} + runtime-event-reporter: {} From 3e22ac41d78c3bba5c00d7ab9fa5fbf7d69eacb6 Mon Sep 17 00:00:00 2001 From: Mikhail Klimko Date: Mon, 6 Oct 2025 14:54:35 +0300 Subject: [PATCH 31/37] refactor cf-argocd-extras --- charts/gitops-runtime/templates/argo-gateway/_env.yaml | 8 ++++---- .../event-reporters/cluster-event-reporter/_env.yaml | 8 ++++---- .../event-reporters/runtime-event-reporter/_env.yaml | 8 ++++---- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/charts/gitops-runtime/templates/argo-gateway/_env.yaml b/charts/gitops-runtime/templates/argo-gateway/_env.yaml index ab08ca6e..c4f6f154 100644 --- a/charts/gitops-runtime/templates/argo-gateway/_env.yaml +++ b/charts/gitops-runtime/templates/argo-gateway/_env.yaml @@ -3,10 +3,10 @@ HTTP_PROXY: {{ .Values.global.httpProxy | squote}} HTTPS_PROXY: {{ .Values.global.httpsProxy | squote }} NO_PROXY: {{ .Values.global.noProxy | squote }} -{{- if and (eq (index .Values "global" "external-argo-cd" "auth" "type") "token") }} - {{- if not (index .Values "global" "external-argo-cd" "auth" "token") }} -ARGO_CD_TOKEN_SECRET_NAME: {{ required ".Values.global.external-argo-cd.auth.type is set to 'token' therefore .global.external-argo-cd.auth.tokenSecretKeyRef.name is required" (index .Values "global" "external-argo-cd" "auth" "tokenSecretKeyRef" "name") }} -ARGO_CD_TOKEN_SECRET_KEY: {{ required ".Values.global.external-argo-cd.auth.type is set to 'token' therefore .global.external-argo-cd.auth.tokenSecretKeyRef.key is required" (index .Values "global" "external-argo-cd" "auth" "tokenSecretKeyRef" "key" ) }} +{{- if and (eq (index .Values "global" "integrations" "argo-cd" "server" "auth" "type") "token") }} + {{- if not (index .Values "global" "integrations" "argo-cd" "server" "auth" "token") }} +ARGO_CD_TOKEN_SECRET_NAME: {{ required ".Values.global.integrations.argo-cd.server.auth.type is set to 'token' therefore .global.integrations.argo-cd.server.auth.tokenSecretKeyRef.name is required" (index .Values "global" "integrations" "argo-cd" "server" "auth" "tokenSecretKeyRef" "name") }} +ARGO_CD_TOKEN_SECRET_KEY: {{ required ".Values.global.integrations.argo-cd.server.auth.type is set to 'token' therefore .global.integrations.argo-cd.server.auth.tokenSecretKeyRef.key is required" (index .Values "global" "integrations" "argo-cd" "server" "auth" "tokenSecretKeyRef" "key" ) }} {{- else }} ARGO_CD_TOKEN_SECRET_NAME: "gitops-runtime-argo-cd-token" ARGO_CD_TOKEN_SECRET_KEY: "token" diff --git a/charts/gitops-runtime/templates/event-reporters/cluster-event-reporter/_env.yaml b/charts/gitops-runtime/templates/event-reporters/cluster-event-reporter/_env.yaml index 9723a719..f75b0f86 100644 --- a/charts/gitops-runtime/templates/event-reporters/cluster-event-reporter/_env.yaml +++ b/charts/gitops-runtime/templates/event-reporters/cluster-event-reporter/_env.yaml @@ -3,10 +3,10 @@ HTTP_PROXY: {{ .Values.global.httpProxy | squote}} HTTPS_PROXY: {{ .Values.global.httpsProxy | squote }} NO_PROXY: {{ .Values.global.noProxy | squote }} -{{- if and (eq (index .Values "global" "external-argo-cd" "auth" "type") "token") }} - {{- if not (index .Values "global" "external-argo-cd" "auth" "token") }} -ARGO_CD_TOKEN_SECRET_NAME: {{ required ".Values.global.external-argo-cd.auth.type is set to 'token' therefore .global.external-argo-cd.auth.tokenSecretKeyRef.name is required" (index .Values "global" "external-argo-cd" "auth" "tokenSecretKeyRef" "name") }} -ARGO_CD_TOKEN_SECRET_KEY: {{ required ".Values.global.external-argo-cd.auth.type is set to 'token' therefore .global.external-argo-cd.auth.tokenSecretKeyRef.key is required" (index .Values "global" "external-argo-cd" "auth" "tokenSecretKeyRef" "key" ) }} +{{- if and (eq (index .Values "global" "integrations" "argo-cd" "server" "auth" "type") "token") }} + {{- if not (index .Values "global" "integrations" "argo-cd" "server" "auth" "token") }} +ARGO_CD_TOKEN_SECRET_NAME: {{ required ".Values.global.integrations.argo-cd.server.auth.type is set to 'token' therefore .global.integrations.argo-cd.server.auth.tokenSecretKeyRef.name is required" (index .Values "global" "integrations" "argo-cd" "server" "auth" "tokenSecretKeyRef" "name") }} +ARGO_CD_TOKEN_SECRET_KEY: {{ required ".Values.global.integrations.argo-cd.server.auth.type is set to 'token' therefore .global.integrations.argo-cd.server.auth.tokenSecretKeyRef.key is required" (index .Values "global" "integrations" "argo-cd" "server" "auth" "tokenSecretKeyRef" "key" ) }} {{- else }} ARGO_CD_TOKEN_SECRET_NAME: "gitops-runtime-argo-cd-token" ARGO_CD_TOKEN_SECRET_KEY: "token" diff --git a/charts/gitops-runtime/templates/event-reporters/runtime-event-reporter/_env.yaml b/charts/gitops-runtime/templates/event-reporters/runtime-event-reporter/_env.yaml index 4bc161fd..aa4b330b 100644 --- a/charts/gitops-runtime/templates/event-reporters/runtime-event-reporter/_env.yaml +++ b/charts/gitops-runtime/templates/event-reporters/runtime-event-reporter/_env.yaml @@ -3,10 +3,10 @@ HTTP_PROXY: {{ .Values.global.httpProxy | squote}} HTTPS_PROXY: {{ .Values.global.httpsProxy | squote }} NO_PROXY: {{ .Values.global.noProxy | squote }} -{{- if and (eq (index .Values "global" "external-argo-cd" "auth" "type") "token") }} - {{- if not (index .Values "global" "external-argo-cd" "auth" "token") }} -ARGO_CD_TOKEN_SECRET_NAME: {{ required ".Values.global.external-argo-cd.auth.type is set to 'token' therefore .global.external-argo-cd.auth.tokenSecretKeyRef.name is required" (index .Values "global" "external-argo-cd" "auth" "tokenSecretKeyRef" "name") }} -ARGO_CD_TOKEN_SECRET_KEY: {{ required ".Values.global.external-argo-cd.auth.type is set to 'token' therefore .global.external-argo-cd.auth.tokenSecretKeyRef.key is required" (index .Values "global" "external-argo-cd" "auth" "tokenSecretKeyRef" "key" ) }} +{{- if and (eq (index .Values "global" "integrations" "argo-cd" "server" "auth" "type") "token") }} + {{- if not (index .Values "global" "integrations" "argo-cd" "server" "auth" "token") }} +ARGO_CD_TOKEN_SECRET_NAME: {{ required ".Values.global.integrations.argo-cd.server.auth.type is set to 'token' therefore .global.integrations.argo-cd.server.auth.tokenSecretKeyRef.name is required" (index .Values "global" "integrations" "argo-cd" "server" "auth" "tokenSecretKeyRef" "name") }} +ARGO_CD_TOKEN_SECRET_KEY: {{ required ".Values.global.integrations.argo-cd.server.auth.type is set to 'token' therefore .global.integrations.argo-cd.server.auth.tokenSecretKeyRef.key is required" (index .Values "global" "integrations" "argo-cd" "server" "auth" "tokenSecretKeyRef" "key" ) }} {{- else }} ARGO_CD_TOKEN_SECRET_NAME: "gitops-runtime-argo-cd-token" ARGO_CD_TOKEN_SECRET_KEY: "token" From ac350ae6a5095df0d4cd2f784c53b3bf0bbebbac Mon Sep 17 00:00:00 2001 From: Mikhail Klimko Date: Mon, 6 Oct 2025 14:58:04 +0300 Subject: [PATCH 32/37] refactor cf-argocd-extras --- charts/gitops-runtime/values.yaml | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/charts/gitops-runtime/values.yaml b/charts/gitops-runtime/values.yaml index 58a53adf..3a3253bb 100644 --- a/charts/gitops-runtime/values.yaml +++ b/charts/gitops-runtime/values.yaml @@ -736,22 +736,15 @@ argo-gateway: registry: quay.io repository: codefresh/cf-argocd-extras tag: "1556733" - nodeSelector: {} - tolerations: [] - affinity: {} - resources: - requests: - memory: "128Mi" - cpu: "100m" - pdb: - # -- Enable PDB for event-reporter + pdb: + # -- Enable PDB for event-reporter + enabled: false + minAvailable: "50%" + maxUnavailable: "" + serviceMonitor: + main: + # -- Enable ServiceMonitor for event reporter enabled: false - minAvailable: "50%" - maxUnavailable: "" - serviceMonitor: - main: - # -- Enable ServiceMonitor for event reporter - enabled: false # -- Sources server configuration sourcesServer: enabled: true From 5d9d3b2aa1d06e2c4a0f870b4ca6309bb5cdc09a Mon Sep 17 00:00:00 2001 From: Mikhail Klimko Date: Mon, 6 Oct 2025 15:02:31 +0300 Subject: [PATCH 33/37] refactor cf-argocd-extras --- charts/gitops-runtime/values.yaml | 60 +++++++++++++------------------ 1 file changed, 24 insertions(+), 36 deletions(-) diff --git a/charts/gitops-runtime/values.yaml b/charts/gitops-runtime/values.yaml index 3a3253bb..d31ca102 100644 --- a/charts/gitops-runtime/values.yaml +++ b/charts/gitops-runtime/values.yaml @@ -731,46 +731,34 @@ argo-gateway: cpu: "100m" hpa: enabled: true - container: - image: - registry: quay.io - repository: codefresh/cf-argocd-extras - tag: "1556733" + minReplicas: 1 + maxReplicas: 10 + targetCPUUtilizationPercentage: 70 pdb: - # -- Enable PDB for event-reporter - enabled: false + enabled: true minAvailable: "50%" maxUnavailable: "" + service: + type: ClusterIP + serviceAccount: + create: true + readinessProbe: + failureThreshold: 3 + initialDelaySeconds: 10 + periodSeconds: 10 + successThreshold: 1 + timeoutSeconds: 10 + livenessProbe: + failureThreshold: 3 + initialDelaySeconds: 10 + periodSeconds: 10 + successThreshold: 1 + timeoutSeconds: 10 serviceMonitor: - main: - # -- Enable ServiceMonitor for event reporter - enabled: false - # -- Sources server configuration - sourcesServer: - enabled: true - container: - image: - registry: quay.io - repository: codefresh/cf-argocd-extras - tag: "1556733" - nodeSelector: {} - tolerations: [] - affinity: {} - resources: - requests: - memory: "128Mi" - cpu: "100m" - hpa: - # -- Enable HPA for sources server - enabled: false - minReplicas: 1 - maxReplicas: 10 - targetCPUUtilizationPercentage: 70 - pdb: - # -- Enable PDB for sources server - enabled: false - minAvailable: "50%" - maxUnavailable: "" + enabled: false + interval: 30s + scrapeTimeout: 10s + labels: {} event-reporters: cluster-event-reporter: {} From e087c4d1428b883d131dc453f82cd63936f3ecdd Mon Sep 17 00:00:00 2001 From: Mikhail Klimko Date: Mon, 6 Oct 2025 15:08:36 +0300 Subject: [PATCH 34/37] refactor cf-argocd-extras --- charts/gitops-runtime/templates/argo-gateway/_env.yaml | 4 ++-- .../event-reporters/cluster-event-reporter/_env.yaml | 4 ++-- .../event-reporters/runtime-event-reporter/_env.yaml | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/charts/gitops-runtime/templates/argo-gateway/_env.yaml b/charts/gitops-runtime/templates/argo-gateway/_env.yaml index c4f6f154..89fb754e 100644 --- a/charts/gitops-runtime/templates/argo-gateway/_env.yaml +++ b/charts/gitops-runtime/templates/argo-gateway/_env.yaml @@ -5,8 +5,8 @@ NO_PROXY: {{ .Values.global.noProxy | squote }} {{- if and (eq (index .Values "global" "integrations" "argo-cd" "server" "auth" "type") "token") }} {{- if not (index .Values "global" "integrations" "argo-cd" "server" "auth" "token") }} -ARGO_CD_TOKEN_SECRET_NAME: {{ required ".Values.global.integrations.argo-cd.server.auth.type is set to 'token' therefore .global.integrations.argo-cd.server.auth.tokenSecretKeyRef.name is required" (index .Values "global" "integrations" "argo-cd" "server" "auth" "tokenSecretKeyRef" "name") }} -ARGO_CD_TOKEN_SECRET_KEY: {{ required ".Values.global.integrations.argo-cd.server.auth.type is set to 'token' therefore .global.integrations.argo-cd.server.auth.tokenSecretKeyRef.key is required" (index .Values "global" "integrations" "argo-cd" "server" "auth" "tokenSecretKeyRef" "key" ) }} +ARGO_CD_TOKEN_SECRET_NAME: {{ required ".Values.global.integrations.argo-cd.server.auth.type is set to 'token' therefore .Values.global.integrations.argo-cd.server.auth.tokenSecretKeyRef.name is required" (index .Values "global" "integrations" "argo-cd" "server" "auth" "tokenSecretKeyRef" "name") }} +ARGO_CD_TOKEN_SECRET_KEY: {{ required ".Values.global.integrations.argo-cd.server.auth.type is set to 'token' therefore .Values.global.integrations.argo-cd.server.auth.tokenSecretKeyRef.key is required" (index .Values "global" "integrations" "argo-cd" "server" "auth" "tokenSecretKeyRef" "key" ) }} {{- else }} ARGO_CD_TOKEN_SECRET_NAME: "gitops-runtime-argo-cd-token" ARGO_CD_TOKEN_SECRET_KEY: "token" diff --git a/charts/gitops-runtime/templates/event-reporters/cluster-event-reporter/_env.yaml b/charts/gitops-runtime/templates/event-reporters/cluster-event-reporter/_env.yaml index f75b0f86..007edfb8 100644 --- a/charts/gitops-runtime/templates/event-reporters/cluster-event-reporter/_env.yaml +++ b/charts/gitops-runtime/templates/event-reporters/cluster-event-reporter/_env.yaml @@ -5,8 +5,8 @@ NO_PROXY: {{ .Values.global.noProxy | squote }} {{- if and (eq (index .Values "global" "integrations" "argo-cd" "server" "auth" "type") "token") }} {{- if not (index .Values "global" "integrations" "argo-cd" "server" "auth" "token") }} -ARGO_CD_TOKEN_SECRET_NAME: {{ required ".Values.global.integrations.argo-cd.server.auth.type is set to 'token' therefore .global.integrations.argo-cd.server.auth.tokenSecretKeyRef.name is required" (index .Values "global" "integrations" "argo-cd" "server" "auth" "tokenSecretKeyRef" "name") }} -ARGO_CD_TOKEN_SECRET_KEY: {{ required ".Values.global.integrations.argo-cd.server.auth.type is set to 'token' therefore .global.integrations.argo-cd.server.auth.tokenSecretKeyRef.key is required" (index .Values "global" "integrations" "argo-cd" "server" "auth" "tokenSecretKeyRef" "key" ) }} +ARGO_CD_TOKEN_SECRET_NAME: {{ required ".Values.global.integrations.argo-cd.server.auth.type is set to 'token' therefore .Values.global.integrations.argo-cd.server.auth.tokenSecretKeyRef.name is required" (index .Values "global" "integrations" "argo-cd" "server" "auth" "tokenSecretKeyRef" "name") }} +ARGO_CD_TOKEN_SECRET_KEY: {{ required ".Values.global.integrations.argo-cd.server.auth.type is set to 'token' therefore .Values.global.integrations.argo-cd.server.auth.tokenSecretKeyRef.key is required" (index .Values "global" "integrations" "argo-cd" "server" "auth" "tokenSecretKeyRef" "key" ) }} {{- else }} ARGO_CD_TOKEN_SECRET_NAME: "gitops-runtime-argo-cd-token" ARGO_CD_TOKEN_SECRET_KEY: "token" diff --git a/charts/gitops-runtime/templates/event-reporters/runtime-event-reporter/_env.yaml b/charts/gitops-runtime/templates/event-reporters/runtime-event-reporter/_env.yaml index aa4b330b..5ceb04f0 100644 --- a/charts/gitops-runtime/templates/event-reporters/runtime-event-reporter/_env.yaml +++ b/charts/gitops-runtime/templates/event-reporters/runtime-event-reporter/_env.yaml @@ -5,8 +5,8 @@ NO_PROXY: {{ .Values.global.noProxy | squote }} {{- if and (eq (index .Values "global" "integrations" "argo-cd" "server" "auth" "type") "token") }} {{- if not (index .Values "global" "integrations" "argo-cd" "server" "auth" "token") }} -ARGO_CD_TOKEN_SECRET_NAME: {{ required ".Values.global.integrations.argo-cd.server.auth.type is set to 'token' therefore .global.integrations.argo-cd.server.auth.tokenSecretKeyRef.name is required" (index .Values "global" "integrations" "argo-cd" "server" "auth" "tokenSecretKeyRef" "name") }} -ARGO_CD_TOKEN_SECRET_KEY: {{ required ".Values.global.integrations.argo-cd.server.auth.type is set to 'token' therefore .global.integrations.argo-cd.server.auth.tokenSecretKeyRef.key is required" (index .Values "global" "integrations" "argo-cd" "server" "auth" "tokenSecretKeyRef" "key" ) }} +ARGO_CD_TOKEN_SECRET_NAME: {{ required ".Values.global.integrations.argo-cd.server.auth.type is set to 'token' therefore .Values.global.integrations.argo-cd.server.auth.tokenSecretKeyRef.name is required" (index .Values "global" "integrations" "argo-cd" "server" "auth" "tokenSecretKeyRef" "name") }} +ARGO_CD_TOKEN_SECRET_KEY: {{ required ".Values.global.integrations.argo-cd.server.auth.type is set to 'token' therefore .Values.global.integrations.argo-cd.server.auth.tokenSecretKeyRef.key is required" (index .Values "global" "integrations" "argo-cd" "server" "auth" "tokenSecretKeyRef" "key" ) }} {{- else }} ARGO_CD_TOKEN_SECRET_NAME: "gitops-runtime-argo-cd-token" ARGO_CD_TOKEN_SECRET_KEY: "token" From 2d99a056fc40d593f0723eb6fe1a5454beda54f3 Mon Sep 17 00:00:00 2001 From: Oleksandr Saulyak Date: Mon, 6 Oct 2025 15:35:19 +0300 Subject: [PATCH 35/37] app-proxy 1.3806.0 --- charts/gitops-runtime/values.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/charts/gitops-runtime/values.yaml b/charts/gitops-runtime/values.yaml index d31ca102..6221a621 100644 --- a/charts/gitops-runtime/values.yaml +++ b/charts/gitops-runtime/values.yaml @@ -530,14 +530,14 @@ app-proxy: tag: 1.1.16-main image: repository: quay.io/codefresh/cap-app-proxy - tag: 1.3798.0 + tag: 1.3806.0 pullPolicy: IfNotPresent # -- Extra volume mounts for main container extraVolumeMounts: [] initContainer: image: repository: quay.io/codefresh/cap-app-proxy-init - tag: 1.3798.0 + tag: 1.3806.0 pullPolicy: IfNotPresent command: - ./init.sh From d0452e020ef00a780d7998d2c6e248020212f248 Mon Sep 17 00:00:00 2001 From: Mikhail Klimko Date: Tue, 7 Oct 2025 13:50:07 +0300 Subject: [PATCH 36/37] remove eventbus --- .../eventbus/codefresh-eventbus.yaml | 39 ----------- .../templates/eventbus/pdb.yaml | 12 ---- .../gitops-runtime/tests/eventbus_test.yaml | 68 ------------------- charts/gitops-runtime/values.yaml | 53 --------------- 4 files changed, 172 deletions(-) delete mode 100644 charts/gitops-runtime/templates/eventbus/codefresh-eventbus.yaml delete mode 100644 charts/gitops-runtime/templates/eventbus/pdb.yaml delete mode 100644 charts/gitops-runtime/tests/eventbus_test.yaml diff --git a/charts/gitops-runtime/templates/eventbus/codefresh-eventbus.yaml b/charts/gitops-runtime/templates/eventbus/codefresh-eventbus.yaml deleted file mode 100644 index 1ab63879..00000000 --- a/charts/gitops-runtime/templates/eventbus/codefresh-eventbus.yaml +++ /dev/null @@ -1,39 +0,0 @@ -{{- $eventBusName := (include "codefresh-gitops-runtime.eventbus.name" .Values.global.runtime.eventBus) }} -{{- $eventBusSpec := .Values.global.runtime.eventBus }} -{{- $eventBusType := .Values.global.runtime.eventBus.type }} -{{/* Remove name from eventbus spec */}} -{{- if hasKey $eventBusSpec "name" }} -{{- $eventBusSpec = unset $eventBusSpec "name" }} -{{- end }} -{{/* Remove pdb from eventbus spec */}} -{{- if hasKey $eventBusSpec "pdb" }} -{{- $eventBusSpec = unset $eventBusSpec "pdb" }} -{{- end }} -{{/* Remove annotations from eventbus spec */}} -{{- if hasKey $eventBusSpec "annotations" }} -{{- $eventBusSpec = unset $eventBusSpec "annotations" }} -{{- end }} - -{{- if eq $eventBusType "nats" }} - {{- $eventBusSpec = unset $eventBusSpec "jetstream" }} - {{- $_ := set $eventBusSpec.nats.native "nodeSelector" ($eventBusSpec.nats.native.nodeSelector | default .Values.global.nodeSelector) }} - {{- $_ := set $eventBusSpec.nats.native "tolerations" ($eventBusSpec.nats.native.tolerations | default .Values.global.tolerations) }} -{{- end }} - -{{- if eq $eventBusType "jetstream" }} - {{- $eventBusSpec = unset $eventBusSpec "nats" }} - {{- $_ := set $eventBusSpec.jetstream "nodeSelector" ($eventBusSpec.jetstream.nodeSelector | default .Values.global.nodeSelector) }} - {{- $_ := set $eventBusSpec.jetstream "tolerations" ($eventBusSpec.jetstream.tolerations | default .Values.global.tolerations) }} -{{- end }} - -apiVersion: argoproj.io/v1alpha1 -kind: EventBus -metadata: - name: {{ $eventBusName }} - annotations: - {{- .Values.global.runtime.eventBus.annotations | toYaml | nindent 4}} - labels: - app.kubernetes.io/part-of: codefresh-eventbus - codefresh.io/internal: "true" -spec: - {{- $eventBusSpec | toYaml | nindent 2}} diff --git a/charts/gitops-runtime/templates/eventbus/pdb.yaml b/charts/gitops-runtime/templates/eventbus/pdb.yaml deleted file mode 100644 index 1d74d750..00000000 --- a/charts/gitops-runtime/templates/eventbus/pdb.yaml +++ /dev/null @@ -1,12 +0,0 @@ -{{- $eventBusName := (include "codefresh-gitops-runtime.eventbus.name" .Values.global.runtime.eventBus) }} -{{- if .Values.global.runtime.eventBus.pdb.enabled }} -apiVersion: policy/v1 -kind: PodDisruptionBudget -metadata: - name: {{ $eventBusName }} -spec: - minAvailable: 2 - selector: - matchLabels: - eventbus-name: {{ $eventBusName }} -{{- end }} \ No newline at end of file diff --git a/charts/gitops-runtime/tests/eventbus_test.yaml b/charts/gitops-runtime/tests/eventbus_test.yaml deleted file mode 100644 index b6ea09ea..00000000 --- a/charts/gitops-runtime/tests/eventbus_test.yaml +++ /dev/null @@ -1,68 +0,0 @@ -# yaml-language-server: $schema=https://raw.githubusercontent.com/helm-unittest/helm-unittest/main/schema/helm-testsuite.json -suite: eventbus tests -templates: - - eventbus/codefresh-eventbus.yaml -tests: - - it: Should create an EventBus with the correct type (nats) - template: eventbus/codefresh-eventbus.yaml - values: - - ./values/mandatory-values.yaml - set: - global.runtime.eventBus.type: nats - asserts: - - exists: - path: spec.nats - - notExists: - path: spec.jetstream - - equal: - path: metadata.name - value: codefresh-eventbus - - - it: Should create an EventBus with the correct type (jetstream) - template: eventbus/codefresh-eventbus.yaml - values: - - ./values/mandatory-values.yaml - set: - global.runtime.eventBus.type: jetstream - asserts: - - exists: - path: spec.jetstream - - notExists: - path: spec.nats - - - it: Should create an EventBus with the correct default name (nats) - template: eventbus/codefresh-eventbus.yaml - values: - - ./values/mandatory-values.yaml - set: - global.runtime.eventBus.type: nats - asserts: - - equal: - path: metadata.name - value: codefresh-eventbus - - - it: Should create an EventBus with the correct override name (nats) - template: eventbus/codefresh-eventbus.yaml - values: - - ./values/mandatory-values.yaml - set: - global.runtime.eventBus: - name: manual-override - type: nats - asserts: - - equal: - path: metadata.name - value: manual-override - - - it: Should create an EventBus with the correct override name (jetstream) - template: eventbus/codefresh-eventbus.yaml - values: - - ./values/mandatory-values.yaml - set: - global.runtime.eventBus: - name: manual-override - type: jetstream - asserts: - - equal: - path: metadata.name - value: manual-override diff --git a/charts/gitops-runtime/values.yaml b/charts/gitops-runtime/values.yaml index 4e1e0e2a..24ecb5fe 100644 --- a/charts/gitops-runtime/values.yaml +++ b/charts/gitops-runtime/values.yaml @@ -78,59 +78,6 @@ global: value: # -- secretKeyReference for Git credentials password. Provide name and key fields. secretKeyRef: {} - # -- Runtime eventbus - eventBus: - # -- Eventbus name - name: '' - # -- Annotations on EventBus resource - annotations: {} - # -- Pod disruption budget for the eventbus - pdb: - enabled: true - # -- Minimum number of available eventbus pods. For eventbus to stay functional the majority of its replicas should always be available. - minAvailable: 2 - type: nats # -- Eventbus type. Can be nats or jetstream. - nats: - native: - metadata: - labels: - app.kubernetes.io/name: codefresh-eventbus - nodeSelector: {} - tolerations: [] - affinity: {} - replicas: 3 - auth: token - maxPayload: "4MB" - containerTemplate: - resources: - limits: - cpu: 500m - memory: 4Gi - ephemeral-storage: 2Gi - requests: - cpu: 200m - memory: 1Gi - ephemeral-storage: 2Gi - jetstream: - metadata: - labels: - app.kubernetes.io/name: codefresh-eventbus - version: latest - nodeSelector: {} - tolerations: [] - affinity: {} - replicas: 3 - maxPayload: "4MB" - containerTemplate: - resources: - limits: - cpu: 500m - memory: 4Gi - ephemeral-storage: 2Gi - requests: - cpu: 200m - memory: 1Gi - ephemeral-storage: 2Gi integrations: argo-cd: server: From 65e3e67ed4f429d773e2468de14f5dd187056e3b Mon Sep 17 00:00:00 2001 From: Mikhail Klimko Date: Tue, 7 Oct 2025 14:03:22 +0300 Subject: [PATCH 37/37] remove eventbus --- .../tests/global_constraints_test.yaml | 31 ------------------- 1 file changed, 31 deletions(-) diff --git a/charts/gitops-runtime/tests/global_constraints_test.yaml b/charts/gitops-runtime/tests/global_constraints_test.yaml index 35f4baa9..a8bc4891 100644 --- a/charts/gitops-runtime/tests/global_constraints_test.yaml +++ b/charts/gitops-runtime/tests/global_constraints_test.yaml @@ -8,7 +8,6 @@ templates: - tunnel-client.yaml - charts/codefresh-tunnel-client/* - internal-router/deployment.yaml - - eventbus/codefresh-eventbus.yaml - hooks/pre-install/validate-values.yaml - hooks/pre-install/validate-usage.yaml - hooks/pre-uninstall/cleanup-resources.yaml @@ -83,21 +82,6 @@ tests: value: some-value effect: NoSchedule template: argo-gateway/deployment.yaml - # -- codefresh-eventbus - - equal: - path: spec.nats.native.nodeSelector - value: - some-key: some-value - extra-key: extra-value - template: eventbus/codefresh-eventbus.yaml - - equal: - path: spec.nats.native.tolerations - value: - - key: some-key - operator: Equal - value: some-value - effect: NoSchedule - template: eventbus/codefresh-eventbus.yaml # -- validate-values job - equal: path: spec.template.spec.nodeSelector @@ -330,21 +314,6 @@ tests: value: another-value effect: NoSchedule template: internal-router/deployment.yaml - # -- codefresh-eventbus - - equal: - path: spec.nats.native.nodeSelector - value: - some-key: another-value - foo: bar - template: eventbus/codefresh-eventbus.yaml - - equal: - path: spec.nats.native.tolerations - value: - - key: another-key - operator: Equal - value: another-value - effect: NoSchedule - template: eventbus/codefresh-eventbus.yaml # -- validate-values job - equal: path: spec.template.spec.nodeSelector