diff --git a/charts/gitops-runtime/README.md b/charts/gitops-runtime/README.md index 51679005e..7fa79bb5c 100644 --- a/charts/gitops-runtime/README.md +++ b/charts/gitops-runtime/README.md @@ -395,6 +395,27 @@ argo-gateway: ... ``` +- `.Values.global.external-argo-cd` was changed to `.Values.global.integrations.argo-cd` + +```yaml +# Before: +global: + external-argo-cd: + server: + svc: argocd-server + port: 80 + ... + +# After: +global: + integrations: + argo-cd: + server: + svc: argocd-server + port: 80 + ... +``` + ## Values | Key | Type | Default | Description | @@ -430,14 +451,14 @@ argo-gateway: | app-proxy.image-enrichment.serviceAccount.name | string | `"codefresh-image-enrichment-sa"` | Name of the service account to create or the name of the existing one to use | | app-proxy.image.pullPolicy | string | `"IfNotPresent"` | | | app-proxy.image.repository | string | `"quay.io/codefresh/cap-app-proxy"` | | -| app-proxy.image.tag | string | `"1.3806.0"` | | +| app-proxy.image.tag | string | `"1.3883.0"` | | | app-proxy.imagePullSecrets | list | `[]` | | | app-proxy.initContainer.command[0] | string | `"./init.sh"` | | | app-proxy.initContainer.env | object | `{}` | | | app-proxy.initContainer.extraVolumeMounts | list | `[]` | Extra volume mounts for init container | | app-proxy.initContainer.image.pullPolicy | string | `"IfNotPresent"` | | | app-proxy.initContainer.image.repository | string | `"quay.io/codefresh/cap-app-proxy-init"` | | -| app-proxy.initContainer.image.tag | string | `"1.3806.0"` | | +| app-proxy.initContainer.image.tag | string | `"1.3883.0"` | | | app-proxy.initContainer.resources.limits | object | `{}` | | | app-proxy.initContainer.resources.requests.cpu | string | `"0.2"` | | | app-proxy.initContainer.resources.requests.memory | string | `"256Mi"` | | @@ -494,17 +515,19 @@ argo-gateway: | app-proxy.serviceMonitor.labels | object | `{}` | | | app-proxy.serviceMonitor.name | string | `""` | | | app-proxy.tolerations | list | `[]` | | -| argo-cd.applicationVersioning.enabled | bool | `true` | Enable application versioning | -| argo-cd.applicationVersioning.useApplicationConfiguration | bool | `true` | Extract application version based on ApplicationConfiguration CRD | | argo-cd.configs.cm."accounts.admin" | string | `"apiKey,login"` | | +| argo-cd.configs.cm."application.instanceLabelKey" | string | `""` | | | argo-cd.configs.cm."application.resourceTrackingMethod" | string | `"annotation+label"` | | -| argo-cd.configs.cm."resource.customizations.actions.argoproj.io_Rollout" | string | `"mergeBuiltinActions: true\ndiscovery.lua: |\n actions = {}\n local fullyPromoted = obj.status.currentPodHash == obj.status.stableRS\n actions[\"pause\"] = {[\"disabled\"] = fullyPromoted or obj.spec.paused == true}\n actions[\"skip-current-step\"] = {[\"disabled\"] = obj.spec.strategy.canary == nil or obj.spec.strategy.canary.steps == nil or obj.status.currentStepIndex == table.getn(obj.spec.strategy.canary.steps)}\n return actions\ndefinitions:\n- name: pause\n action.lua: |\n obj.spec.paused = true\n return obj\n- name: skip-current-step\n action.lua: |\n if obj.status ~= nil then\n if obj.spec.strategy.canary ~= nil and obj.spec.strategy.canary.steps ~= nil and obj.status.currentStepIndex < table.getn(obj.spec.strategy.canary.steps) then\n if obj.status.pauseConditions ~= nil and table.getn(obj.status.pauseConditions) > 0 then\n obj.status.pauseConditions = nil\n end\n obj.status.currentStepIndex = obj.status.currentStepIndex + 1\n end\n end\n return obj\n"` | | | argo-cd.configs.cm."timeout.reconciliation" | string | `"20s"` | | | argo-cd.configs.params."application.namespaces" | string | `"cf-*"` | | | argo-cd.configs.params."server.insecure" | bool | `true` | | -| argo-cd.crds.install | bool | `true` | | | argo-cd.enabled | bool | `true` | | -| argo-cd.fullnameOverride | string | `"argo-cd"` | | +| argo-cd.fullnameOverride | string | `"argocd"` | | +| argo-cd.notifications.enabled | bool | `false` | | +| argo-cd.redis-ha.image.repository | string | `"ecr-public.aws.com/docker/library/redis"` | Redis repository | +| argo-cd.redis-ha.image.tag | string | `"8.2.2-alpine"` | Redis tag | +| argo-cd.redis.image.repository | string | `"ecr-public.aws.com/docker/library/redis"` | Redis repository | +| argo-cd.redis.image.tag | string | `"8.2.2-alpine"` | Redis tag | | argo-events.configs.jetstream.versions[0].configReloaderImage | string | `"natsio/nats-server-config-reloader:0.19.1"` | | | argo-events.configs.jetstream.versions[0].metricsExporterImage | string | `"natsio/prometheus-nats-exporter:0.17.3"` | | | argo-events.configs.jetstream.versions[0].natsImage | string | `"nats:2.11.4"` | | @@ -514,9 +537,9 @@ argo-gateway: | argo-events.configs.nats.versions[0].natsStreamingImage | string | `"nats-streaming:0.25.6"` | | | argo-events.configs.nats.versions[0].version | string | `"0.22.1"` | | | argo-events.crds.install | bool | `false` | | -| argo-events.enabled | bool | `false` | | +| argo-events.enabled | bool | `true` | | | argo-events.fullnameOverride | string | `"argo-events"` | | -| argo-gateway | object | `{"affinity":{},"hpa":{"enabled":true,"maxReplicas":10,"minReplicas":1,"targetCPUUtilizationPercentage":70},"image":{"registry":"quay.io","repository":"codefresh/cf-argocd-extras","tag":"695977c"},"livenessProbe":{"failureThreshold":3,"initialDelaySeconds":10,"periodSeconds":10,"successThreshold":1,"timeoutSeconds":10},"nodeSelector":{},"pdb":{"enabled":true,"maxUnavailable":"","minAvailable":"50%"},"readinessProbe":{"failureThreshold":3,"initialDelaySeconds":10,"periodSeconds":10,"successThreshold":1,"timeoutSeconds":10},"resources":{"requests":{"cpu":"100m","memory":"128Mi"}},"service":{"type":"ClusterIP"},"serviceAccount":{"create":true},"serviceMonitor":{"enabled":false,"interval":"30s","labels":{},"scrapeTimeout":"10s"},"tolerations":[]}` | Argo Gateway Argo Gateway is used to perform operations on ArgoCD from Codefresh platform | +| argo-gateway | object | `{"affinity":{},"hpa":{"enabled":true,"maxReplicas":10,"minReplicas":1,"targetCPUUtilizationPercentage":70},"image":{"registry":"quay.io","repository":"codefresh/cf-argocd-extras","tag":"d4fefcb"},"livenessProbe":{"failureThreshold":3,"initialDelaySeconds":10,"periodSeconds":10,"successThreshold":1,"timeoutSeconds":10},"nodeSelector":{},"pdb":{"enabled":true,"maxUnavailable":"","minAvailable":"50%"},"readinessProbe":{"failureThreshold":3,"initialDelaySeconds":10,"periodSeconds":10,"successThreshold":1,"timeoutSeconds":10},"resources":{"requests":{"cpu":"100m","memory":"128Mi"}},"service":{"type":"ClusterIP"},"serviceAccount":{"create":true},"serviceMonitor":{"enabled":false,"interval":"30s","labels":{},"scrapeTimeout":"10s"},"tolerations":[]}` | Argo Gateway Argo Gateway is used to perform operations on ArgoCD from Codefresh platform | | argo-rollouts.controller.replicas | int | `1` | | | argo-rollouts.enabled | bool | `true` | | | argo-rollouts.fullnameOverride | string | `"argo-rollouts"` | | @@ -534,6 +557,7 @@ argo-gateway: | gitops-operator.affinity | object | `{}` | | | gitops-operator.config.commitStatusPollingInterval | string | `"10s"` | Commit status polling interval | | gitops-operator.config.maxConcurrentReleases | int | `100` | Maximum number of concurrent releases being processed by the operator (this will not affect the number of releases being processed by the gitops runtime) | +| gitops-operator.config.maxReconcileRetries | int | `10` | Maximum number of reconcile retries on promotion-related resources before failing a promotion task | | gitops-operator.config.promotionWrapperTemplate | string | `""` | An optional template for the promotion wrapper (empty default will use the embedded one) | | gitops-operator.config.taskPollingInterval | string | `"10s"` | Task polling interval | | gitops-operator.config.workflowMonitorPollingInterval | string | `"10s"` | Workflow monitor polling interval | @@ -547,7 +571,7 @@ argo-gateway: | gitops-operator.fullnameOverride | string | `""` | | | gitops-operator.image.registry | string | `"quay.io"` | defaults | | gitops-operator.image.repository | string | `"codefresh/codefresh-gitops-operator"` | | -| gitops-operator.image.tag | string | `"a1316ff"` | | +| gitops-operator.image.tag | string | `"293f24f"` | | | gitops-operator.imagePullSecrets | list | `[]` | | | gitops-operator.nameOverride | string | `""` | | | gitops-operator.nodeSelector | object | `{}` | | @@ -577,20 +601,15 @@ argo-gateway: | global.codefresh.userToken | object | `{"secretKeyRef":{},"token":""}` | User token. Used for runtime registration against the patform. One of token (for plain text value) or secretKeyRef must be provided. | | global.codefresh.userToken.secretKeyRef | object | `{}` | User token that references an existing secret containing the token. | | global.codefresh.userToken.token | string | `""` | User token in plain text. The chart creates and manages the secret for this token. | -| global.event-reporters | object | `{"affinity":{},"config":{},"image":{"registry":"quay.io","repository":"codefresh/cf-argocd-extras","tag":"695977c"},"livenessProbe":{"failureThreshold":3,"initialDelaySeconds":10,"periodSeconds":10,"successThreshold":1,"timeoutSeconds":10},"nodeSelector":{},"pdb":{"enabled":true,"maxUnavailable":"","minAvailable":"50%"},"readinessProbe":{"failureThreshold":3,"initialDelaySeconds":10,"periodSeconds":10,"successThreshold":1,"timeoutSeconds":10},"replicaCount":2,"resources":{"requests":{"cpu":"100m","memory":"128Mi"}},"service":{"ports":{"http":{"port":8088,"targetPort":8088},"metrics":{"port":8087,"targetPort":8087}},"type":"ClusterIP"},"serviceAccount":{"create":true},"serviceMonitor":{"enabled":false,"interval":"30s","labels":{},"scrapeTimeout":"10s"},"tolerations":[]}` | Global settings for event reporters Event reporters are used for reporting runtime and cluster resources to Codefresh platform | -| global.external-argo-cd | object | `{"repoServer":{"port":8081,"svc":"argocd-repo-server"},"server":{"port":80,"rootpath":"","svc":"argocd-server"}}` | Configuration for external ArgoCD Should be used when `argo-cd.enabled` is set to false | -| global.external-argo-cd.repoServer.port | int | `8081` | Port of the ArgoCD repo server | -| global.external-argo-cd.repoServer.svc | string | `"argocd-repo-server"` | Service name of the ArgoCD repo server | -| global.external-argo-cd.server | object | `{"port":80,"rootpath":"","svc":"argocd-server"}` | ArgoCD server settings | -| global.external-argo-cd.server.port | int | `80` | Port of the ArgoCD server | -| global.external-argo-cd.server.rootpath | string | `""` | Set if Argo CD is running behind reverse proxy under subpath different from / e.g. rootpath: '/argocd' | -| global.external-argo-cd.server.svc | string | `"argocd-server"` | Service name of the ArgoCD server | +| global.event-reporters | object | `{"affinity":{},"config":{},"image":{"registry":"quay.io","repository":"codefresh/cf-argocd-extras","tag":"d4fefcb"},"livenessProbe":{"failureThreshold":3,"initialDelaySeconds":10,"periodSeconds":10,"successThreshold":1,"timeoutSeconds":10},"nodeSelector":{},"pdb":{"enabled":true,"maxUnavailable":"","minAvailable":"50%"},"readinessProbe":{"failureThreshold":3,"initialDelaySeconds":10,"periodSeconds":10,"successThreshold":1,"timeoutSeconds":10},"replicaCount":2,"resources":{"requests":{"cpu":"100m","memory":"128Mi"}},"service":{"ports":{"http":{"port":8088,"targetPort":8088},"metrics":{"port":8087,"targetPort":8087}},"type":"ClusterIP"},"serviceAccount":{"create":true},"serviceMonitor":{"enabled":false,"interval":"30s","labels":{},"scrapeTimeout":"10s"},"tolerations":[]}` | Global settings for event reporters Event reporters are used for reporting runtime and cluster resources to Codefresh platform | | global.external-argo-rollouts | object | `{"rollout-reporter":{"enabled":false}}` | Configuration for external Argo Rollouts | | global.external-argo-rollouts.rollout-reporter | object | `{"enabled":false}` | Rollout reporter settings | | global.external-argo-rollouts.rollout-reporter.enabled | bool | `false` | Enable or disable rollout reporter Configuration is defined at .Values.event-reporters.rollout | | global.httpProxy | string | `""` | global HTTP_PROXY for all components | | global.httpsProxy | string | `""` | global HTTPS_PROXY for all components | | global.imageRegistry | string | `""` | | +| global.integrations.argo-cd.repoServer.port | int | `8081` | Port of the ArgoCD repo server | +| global.integrations.argo-cd.repoServer.svc | string | `"argocd-repo-server"` | Service name of the ArgoCD repo server | | global.integrations.argo-cd.server.auth | object | `{"password":"","passwordSecretKeyRef":{"key":"password","name":"argocd-initial-admin-secret"},"token":"","tokenSecretKeyRef":{},"type":"password","username":"admin"}` | How GitOps Runtime should authenticate with ArgoCD server | | global.integrations.argo-cd.server.auth.password | string | `""` | ArgoCD password in plain text | | global.integrations.argo-cd.server.auth.passwordSecretKeyRef | object | `{"key":"password","name":"argocd-initial-admin-secret"}` | ArgoCD password referenced by an existing secret | @@ -598,9 +617,12 @@ argo-gateway: | global.integrations.argo-cd.server.auth.tokenSecretKeyRef | object | `{}` | ArgoCD token referenced by an existing secret | | global.integrations.argo-cd.server.auth.type | string | `"password"` | Authentication type. Can be password or token | | global.integrations.argo-cd.server.auth.username | string | `"admin"` | ArgoCD username in plain text | +| global.integrations.argo-cd.server.port | int | `80` | Port of the ArgoCD server | +| global.integrations.argo-cd.server.rootpath | string | `""` | Set if Argo CD is running behind reverse proxy under subpath different from / e.g. rootpath: '/argocd' | +| global.integrations.argo-cd.server.svc | string | `"argocd-server"` | Service name of the ArgoCD server | | global.noProxy | string | `""` | global NO_PROXY for all components | | global.nodeSelector | object | `{}` | Global nodeSelector for all components | -| global.runtime | object | `{"cluster":"https://kubernetes.default.svc","codefreshHosted":false,"gitCredentials":{"password":{"secretKeyRef":{},"value":null},"username":"username"},"ingress":{"annotations":{},"className":"nginx","enabled":false,"hosts":[],"labels":{},"protocol":"https","skipValidation":false,"tls":[]},"ingressUrl":"","isConfigurationRuntime":false,"name":null}` | Runtime level settings | +| global.runtime | object | `{"cluster":"https://kubernetes.default.svc","codefreshHosted":false,"gitCredentials":{"password":{"secretKeyRef":{},"value":null},"username":"username"},"ingress":{"annotations":{},"className":"nginx","enabled":false,"hosts":[],"labels":{},"protocol":"https","skipValidation":false,"tls":[]},"ingressUrl":"","isConfigurationRuntime":false,"name":null,"singleNamespace":false}` | Runtime level settings | | global.runtime.cluster | string | `"https://kubernetes.default.svc"` | Runtime cluster. Should not be changed. | | global.runtime.codefreshHosted | bool | `false` | Defines whether this is a Codefresh hosted runtime. Should not be changed. | | global.runtime.gitCredentials | object | `{"password":{"secretKeyRef":{},"value":null},"username":"username"}` | Git credentials runtime. Runtime is not fully functional without those credentials. If not provided through the installation, they must be provided through the Codefresh UI. | @@ -616,6 +638,7 @@ argo-gateway: | global.runtime.ingressUrl | string | `""` | Explicit url for runtime ingress. Provide this value only if you don't want the chart to create and ingress (global.runtime.ingress.enabled=false) and tunnel-client is not used (tunnel-client.enabled=false) | | global.runtime.isConfigurationRuntime | bool | `false` | is the runtime set as a "configuration runtime". | | global.runtime.name | string | `nil` | Runtime name. Must be unique per platform account. | +| global.runtime.singleNamespace | bool | `false` | Defines if runtime is namespace scoped. Required for running multiple runtimes in the same cluster | | global.tolerations | list | `[]` | Global tolerations for all components | | installer | object | `{"affinity":{},"argoCdVersionCheck":{"argoServerLabels":{"app.kubernetes.io/component":"server","app.kubernetes.io/part-of":"argocd"}},"image":{"pullPolicy":"IfNotPresent","repository":"quay.io/codefresh/gitops-runtime-installer","tag":""},"nodeSelector":{},"skipUsageValidation":false,"skipValidation":false,"tolerations":[]}` | Runtime installer used for running hooks and checks on the release | | installer.skipUsageValidation | bool | `false` | if set to true, pre-install hook will *not* run | diff --git a/charts/gitops-runtime/README.md.gotmpl b/charts/gitops-runtime/README.md.gotmpl index 53ddf3e24..444f73462 100644 --- a/charts/gitops-runtime/README.md.gotmpl +++ b/charts/gitops-runtime/README.md.gotmpl @@ -399,4 +399,25 @@ argo-gateway: ... ``` +- `.Values.global.external-argo-cd` was changed to `.Values.global.integrations.argo-cd` + +```yaml +# Before: +global: + external-argo-cd: + server: + svc: argocd-server + port: 80 + ... + +# After: +global: + integrations: + argo-cd: + server: + svc: argocd-server + port: 80 + ... +``` + {{ template "chart.valuesSection" . }} diff --git a/charts/gitops-runtime/templates/_helpers.tpl b/charts/gitops-runtime/templates/_helpers.tpl index ce356168f..f8faffc08 100644 --- a/charts/gitops-runtime/templates/_helpers.tpl +++ b/charts/gitops-runtime/templates/_helpers.tpl @@ -77,28 +77,18 @@ Create the name of the service account to use Determine argocd server service name. Must be called with chart root context */}} {{- define "codefresh-gitops-runtime.argocd.server.servicename" -}} -{{/* For now use template from ArgoCD chart until better approach */}} -{{- template "argo-cd.server.fullname" (dict "Values" (get .Values "argo-cd") "Release" .Release ) }} -{{- end }} - -{{/* -Determine argocd redis service name. Must be called with chart root context -*/}} -{{- define "codefresh-gitops-runtime.argocd.redis.servicename" -}} -{{/* For now use template from ArgoCD chart until better approach */}} -{{- template "argo-cd.redis.fullname" (dict "Values" (get .Values "argo-cd") "Release" .Release ) }} +{{- printf "%s-%s" (index .Values "argo-cd" "fullnameOverride") (index .Values "argo-cd" "server" "name") }} {{- end }} {{/* Determine argocd repo server service name. Must be called with chart root context */}} {{- define "codefresh-gitops-runtime.argocd.reposerver.servicename" -}} -{{/* For now use template from ArgoCD chart until better approach */}} {{- if (index .Subcharts "argo-cd") }} - {{- template "argo-cd.repoServer.fullname" (dict "Values" (get .Values "argo-cd") "Release" .Release ) }} + {{- printf "%s-%s" (index .Values "argo-cd" "fullnameOverride") (index .Values "argo-cd" "repoServer" "name") }} {{- else }} - {{- $repoServer := index .Values "global" "external-argo-cd" "repoServer" }} - {{- $svc := required "ArgoCD is not enabled and .Values.global.external-argo-cd.repoServer.svc is not set" $repoServer.svc }} + {{- $repoServer := index .Values "global" "integrations" "argo-cd" "repoServer" }} + {{- $svc := required ".Values.global.integrations.argo-cd.repoServer.svc is not set" $repoServer.svc }} {{- printf "%s" $svc }} {{- end }} {{- end }} @@ -107,12 +97,11 @@ Determine argocd repo server service name. Must be called with chart root contex Determine argocd argocd repo server port */}} {{- define "codefresh-gitops-runtime.argocd.reposerver.serviceport" -}} -{{/* For now use template from ArgoCD chart until better approach */}} {{- if (index .Subcharts "argo-cd") }} {{- index .Values "argo-cd" "repoServer" "service" "port" }} {{- else }} - {{- $repoServer := index .Values "global" "external-argo-cd" "repoServer" }} - {{- $port := required "ArgoCD is not enabled and .Values.global.external-argo-cd.repoServer.svc is not set" $repoServer.port }} + {{- $repoServer := index .Values "global" "integrations" "argo-cd" "repoServer" }} + {{- $port := required ".Values.global.integrations.argo-cd.repoServer.svc is not set" $repoServer.port }} {{- printf "%v" $port }} {{- end }} {{- end }} @@ -122,30 +111,18 @@ Determine argocd argocd repo server port Determine argocd repoServer url */}} {{- define "codefresh-gitops-runtime.argocd.reposerver.url" -}} -{{- $argoCDValues := (get .Values "argo-cd") }} -{{- if (index .Values "argo-cd" "enabled") }} - {{- $serviceName := include "codefresh-gitops-runtime.argocd.reposerver.servicename" . }} - {{- $port := include "codefresh-gitops-runtime.argocd.reposerver.serviceport" . }} - {{- printf "%s:%s" $serviceName $port }} -{{- else if (index .Values "global" "external-argo-cd" "repoServer") }} - {{- $repoServer := (index .Values "global" "external-argo-cd" "repoServer") }} - {{- $svc := required "ArgoCD is not enabled and .Values.global.external-argo-cd.repoServer.svc is not set" $repoServer.svc }} - {{- $port := required "ArgoCD is not enabled and .Values.global.external-argo-cd.repoServer.port is not set" $repoServer.port }} - {{- printf "%s:%v" $svc $port }} -{{- else }} - {{- fail "ArgoCD is not enabled and .Values.global.external-argo-cd.repoServer is not set" }} -{{- end }} + {{- if (index .Values "argo-cd" "enabled") }} + {{- $serviceName := include "codefresh-gitops-runtime.argocd.reposerver.servicename" . }} + {{- $port := include "codefresh-gitops-runtime.argocd.reposerver.serviceport" . }} + {{- printf "%s:%s" $serviceName $port }} + {{- else }} + {{- $repoServer := (index .Values "global" "integrations" "argo-cd" "repoServer") }} + {{- $svc := required ".Values.global.integrations.argo-cd.repoServer.svc is not set" $repoServer.svc }} + {{- $port := required ".Values.global.integrations.argo-cd.repoServer.port is not set" $repoServer.port }} + {{- printf "%s:%v" $svc $port }} + {{- end }} {{- end}} - -{{/* -Determine argocd servicename. Must be called with chart root context -*/}} -{{- define "codefresh-gitops-runtime.argocd.appcontroller.serviceAccountName" -}} -{{/* For now use template from ArgoCD chart until better approach */}} -{{- template "argo-cd.controllerServiceAccountName" (dict "Values" (get .Values "argo-cd") "Release" .Release ) }} -{{- end }} - {{/* Determine rollouts name */}} @@ -158,7 +135,6 @@ Determine rollouts name {{- end }} {{- end }} - {{/* Determine argocd server service port. Must be called with chart root context */}} @@ -174,7 +150,7 @@ Determine argocd server service port. Must be called with chart root context {{- end }} {{- end }} {{- end }} -{{- print $port }} +{{- printf "%v" $port }} {{- end}} {{/* @@ -183,7 +159,7 @@ Determine argocd redis service port. Must be called with chart root context {{- define "codefresh-gitops-runtime.argocd.redis.serviceport" -}} {{- $argoCDValues := (get .Values "argo-cd") }} {{- $port := $argoCDValues.redis.servicePort }} -{{- print $port }} +{{- printf "%v" $port }} {{- end}} {{/* @@ -198,19 +174,17 @@ Determine argocd server url. Must be called with chart root context {{- end }} {{- $url := include "codefresh-gitops-runtime.argocd.server.no-protocol-url" . }} {{- printf "%s://%s" $protocol $url }} - {{- else if (index .Values "global" "external-argo-cd" "server") }} - {{- $argoCDSrv := (index .Values "global" "external-argo-cd" "server") }} + {{- else }} + {{- $argoCDSrv := (index .Values "global" "integrations" "argo-cd" "server") }} {{- $protocol := "http" }} - {{- $svc := required "ArgoCD is not enabled and .Values.global.external-argo-cd.server.svc is not set" $argoCDSrv.svc }} - {{- $port := (required "ArgoCD is not enabled and .Values.global.external-argo-cd.server.port is not port" $argoCDSrv.port) | toString }} - {{- $rootpath := (index .Values "global" "external-argo-cd" "server" "rootpath") }} + {{- $svc := required ".Values.global.integrations.argo-cd.server.svc is not set" $argoCDSrv.svc }} + {{- $port := (required ".Values.global.integrations.argo-cd.server.port is not set" $argoCDSrv.port) | toString }} + {{- $rootpath := (index .Values "global" "integrations" "argo-cd" "server" "rootpath") }} {{- if (eq $port "80") }} {{- printf "%s://%s%s" $protocol $svc $rootpath }} {{- else }} - {{- printf "%s://%s:%s%s" $protocol $svc $port $rootpath }} + {{- printf "%s://%s:%v%s" $protocol $svc $port $rootpath }} {{- end }} - {{- else }} - {{- fail "ArgoCD is not enabled and .Values.global.external-argo-cd.server is not set" }} {{- end }} {{- end}} @@ -218,21 +192,19 @@ Determine argocd server url. Must be called with chart root context Determine argocd server url witout the protocol. Must be called with chart root context */}} {{- define "codefresh-gitops-runtime.argocd.server.no-protocol-url" -}} -{{- $argoCDValues := (get .Values "argo-cd") }} -{{- if (index .Values "argo-cd" "enabled") }} - {{- $serverName := include "codefresh-gitops-runtime.argocd.server.servicename" . }} - {{- $port := include "codefresh-gitops-runtime.argocd.server.serviceport" . }} - {{- $path := (get $argoCDValues.configs.params "server.rootpath") }} - {{- printf "%s:%s%s" $serverName $port $path }} -{{- else if (index .Values "global" "external-argo-cd" "server") }} - {{- $argoCDSrv := (index .Values "global" "external-argo-cd" "server") }} - {{- $svc := required "ArgoCD is not enabled and .Values.global.external-argo-cd.server.svc is not set" $argoCDSrv.svc }} - {{- $port := required "ArgoCD is not enabled and .Values.global.external-argo-cd.server.port is not set" $argoCDSrv.port }} - {{- $rootpath := (index .Values "global" "external-argo-cd" "server" "rootpath") }} - {{- printf "%s:%v%s" $svc $port $rootpath }} -{{- else }} - {{- fail "ArgoCD is not enabled and .Values.global.external-argo-cd.server is not set" }} -{{- end }} + {{- $argoCDValues := (get .Values "argo-cd") }} + {{- if (index .Values "argo-cd" "enabled") }} + {{- $serverName := include "codefresh-gitops-runtime.argocd.server.servicename" . }} + {{- $port := include "codefresh-gitops-runtime.argocd.server.serviceport" . }} + {{- $path := (get $argoCDValues.configs.params "server.rootpath") }} + {{- printf "%s:%s%s" $serverName $port $path }} + {{- else }} + {{- $argoCDSrv := (index .Values "global" "integrations" "argo-cd" "server") }} + {{- $svc := required ".Values.global.integrations.argo-cd.server.svc is not set" $argoCDSrv.svc }} + {{- $port := required ".Values.global.integrations.argo-cd.server.port is not set" $argoCDSrv.port }} + {{- $rootpath := (index .Values "global" "integrations" "argo-cd" "server" "rootpath") }} + {{- printf "%s:%v%s" $svc $port $rootpath }} + {{- end }} {{- end}} {{- define "codefresh-gitops-runtime.argocd-auth" -}} diff --git a/charts/gitops-runtime/templates/argo-gateway/_env.yaml b/charts/gitops-runtime/templates/argo-gateway/_env.yaml index d38f6d2f7..e3f3c2074 100644 --- a/charts/gitops-runtime/templates/argo-gateway/_env.yaml +++ b/charts/gitops-runtime/templates/argo-gateway/_env.yaml @@ -13,7 +13,7 @@ ARGO_CD_TOKEN_SECRET_KEY: "token" {{- end }} {{- end }} -ARGOCD_SERVER_ROOTPATH: {{ dig "server" "rootpath" "/" (index .Values "global" "external-argo-cd") | quote }} +ARGOCD_SERVER_ROOTPATH: {{ dig "server" "rootpath" "/" (index .Values "global" "integrations" "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/cluster-event-reporter/_env.yaml b/charts/gitops-runtime/templates/event-reporters/cluster-event-reporter/_env.yaml index 982f3624c..08790bb67 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 @@ -13,7 +13,7 @@ ARGO_CD_TOKEN_SECRET_KEY: "token" {{- end }} {{- end }} -ARGOCD_SERVER_ROOTPATH: {{ dig "server" "rootpath" "/" (index .Values "global" "external-argo-cd") | quote }} +ARGOCD_SERVER_ROOTPATH: {{ dig "server" "rootpath" "/" (index .Values "global" "integrations" "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-event-reporter/_env.yaml b/charts/gitops-runtime/templates/event-reporters/runtime-event-reporter/_env.yaml index 64cb9d970..e18a210e8 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 @@ -13,7 +13,7 @@ ARGO_CD_TOKEN_SECRET_KEY: "token" {{- end }} {{- end }} -ARGOCD_SERVER_ROOTPATH: {{ dig "server" "rootpath" "/" (index .Values "global" "external-argo-cd") | quote }} +ARGOCD_SERVER_ROOTPATH: {{ dig "server" "rootpath" "/" (index .Values "global" "integrations" "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 92a6e3dda..f116d0690 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_SERVER_ROOTPATH: {{ dig "server" "rootpath" "/" (index .Values "global" "external-argo-cd") | quote }} +ARGOCD_SERVER_ROOTPATH: {{ dig "server" "rootpath" "/" (index .Values "global" "integrations" "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 index 1f02ef8be..d6a06e73b 100644 --- a/charts/gitops-runtime/tests/argo-api-gateway_test.yaml +++ b/charts/gitops-runtime/tests/argo-api-gateway_test.yaml @@ -10,13 +10,13 @@ tests: asserts: - equal: path: data["argocd.server"] - value: argo-cd-server:80 + value: argocd-server:80 - equal: path: data["redis.server"] value: runtime-redis:6379 - equal: path: data["repo.server"] - value: argo-cd-repo-server:8081 + value: argocd-repo-server:8081 - it: Argo Api Gateway Deployment should have valid matchLabel selectors template: argo-gateway/deployment.yaml diff --git a/charts/gitops-runtime/tests/event-reporters_test.yaml b/charts/gitops-runtime/tests/event-reporters_test.yaml index c86c55265..f9b3c91fd 100644 --- a/charts/gitops-runtime/tests/event-reporters_test.yaml +++ b/charts/gitops-runtime/tests/event-reporters_test.yaml @@ -37,13 +37,13 @@ tests: asserts: - equal: path: data["argocd.server"] - value: argo-cd-server:80 + value: argocd-server:80 - equal: path: data["redis.server"] value: runtime-redis:6379 - equal: path: data["repo.server"] - value: argo-cd-repo-server:8081 + value: argocd-repo-server:8081 - it: Runtime Reporter ConfigMap should have valid redis-ha url template: event-reporters/runtime-event-reporter/configmap.yaml diff --git a/charts/gitops-runtime/tests/external_argocd_test.yaml b/charts/gitops-runtime/tests/external_argocd_test.yaml index a0b26c2a6..eb34ce5d3 100644 --- a/charts/gitops-runtime/tests/external_argocd_test.yaml +++ b/charts/gitops-runtime/tests/external_argocd_test.yaml @@ -675,18 +675,6 @@ tests: name: ARGO_CD_TOKEN_SECRET_KEY value: token - - 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 @@ -709,9 +697,10 @@ tests: - ./values/external-argocd-values.yaml set: global: - external-argo-cd: - server: - rootpath: /argocd + integrations: + argo-cd: + server: + rootpath: /argocd asserts: - contains: path: spec.template.spec.containers[0].env @@ -726,9 +715,10 @@ tests: - ./values/external-argocd-values.yaml set: global: - external-argo-cd: - server: - rootpath: /argocd + integrations: + argo-cd: + server: + rootpath: /argocd asserts: - contains: path: spec.template.spec.containers[0].env @@ -743,9 +733,10 @@ tests: template: app-proxy/config.yaml set: global: - external-argo-cd: - server: - rootpath: /argocd + integrations: + argo-cd: + server: + rootpath: /argocd asserts: - equal: path: data.argoCdUrl @@ -758,9 +749,10 @@ tests: - ./values/external-argocd-values.yaml set: global: - external-argo-cd: - server: - rootpath: /argocd + integrations: + argo-cd: + server: + rootpath: /argocd asserts: - contains: path: spec.template.spec.containers[0].env @@ -843,15 +835,3 @@ tests: asserts: - failedTemplate: errorMessage: ".Values.global.integrations.argo-cd.server.auth.type is set to 'token' therefore .Values.global.integrations.argo-cd.server.auth.tokenSecretKeyRef.name is required" - - - it: should require ArgoCd server address if it's not provided - values: - - ./values/mandatory-values-ingress.yaml - - ./values/external-argocd-values.yaml - set: - global: - external-argo-cd: - server: null - asserts: - - failedTemplate: - errorMessage: "ArgoCD is not enabled and .Values.global.external-argo-cd.server is not set" diff --git a/charts/gitops-runtime/tests/values/external-argocd-values.yaml b/charts/gitops-runtime/tests/values/external-argocd-values.yaml index 3e8a4ecc4..098a33b56 100644 --- a/charts/gitops-runtime/tests/values/external-argocd-values.yaml +++ b/charts/gitops-runtime/tests/values/external-argocd-values.yaml @@ -1,18 +1,13 @@ global: - external-argo-cd: - server: - protocol: http - svc: my-argocd-server - port: 80 - image: - repository: quay.io/argoproj/argocd - tag: v2.14.2 - redis: - svc: my-argocd-redis - port: 6379 - repoServer: - svc: my-argocd-repo-server - port: 8081 + integrations: + argo-cd: + server: + protocol: http + svc: my-argocd-server + port: 80 + repoServer: + svc: my-argocd-repo-server + port: 8081 argo-cd: enabled: false diff --git a/charts/gitops-runtime/values.yaml b/charts/gitops-runtime/values.yaml index 089660f8f..a15dbc56e 100644 --- a/charts/gitops-runtime/values.yaml +++ b/charts/gitops-runtime/values.yaml @@ -105,24 +105,19 @@ global: # tokenSecretKeyRef: # name: argocd-token # key: token - # -- Configuration for external ArgoCD - # Should be used when `argo-cd.enabled` is set to false - external-argo-cd: - # -- ArgoCD server settings - server: - # -- Service name of the ArgoCD server - svc: argocd-server - # -- Port of the ArgoCD server - port: 80 - # -- Set if Argo CD is running behind reverse proxy under subpath different from / - # e.g. - # rootpath: '/argocd' - rootpath: '' - repoServer: - # -- Service name of the ArgoCD repo server - svc: argocd-repo-server - # -- Port of the ArgoCD repo server - port: 8081 + # -- Service name of the ArgoCD server + svc: argocd-server + # -- Port of the ArgoCD server + port: 80 + # -- Set if Argo CD is running behind reverse proxy under subpath different from / + # e.g. + # rootpath: '/argocd' + rootpath: '' + repoServer: + # -- Service name of the ArgoCD repo server + svc: argocd-repo-server + # -- Port of the ArgoCD repo server + port: 8081 # -- Configuration for external Argo Rollouts external-argo-rollouts: # -- Rollout reporter settings @@ -232,7 +227,7 @@ sealed-secrets: #----------------------------------------------------------------------------------------------------------------------- argo-cd: enabled: true - fullnameOverride: argo-cd + fullnameOverride: argocd notifications: enabled: false