Skip to content

Commit

Permalink
feat: [CDS-95529]: Improve helm charts, fix for openshift (#26)
Browse files Browse the repository at this point in the history
Signed-off-by: Mirko Teodorovic <[email protected]>
  • Loading branch information
mteodor authored Apr 26, 2024
1 parent a2deb03 commit a19a19c
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 14 deletions.
16 changes: 16 additions & 0 deletions templates/_common.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -95,3 +95,19 @@ Disaster Recovery cluster name
{{ .Values.agent.harnessName }}-agent
{{- end -}}
{{- end -}}

{{/*
Set value for redis server, this can be used in case of external redis server also
just set the value of .Values.harness.configMap.argocd.redisSvc
*/}}
{{- define "redisServer" -}}
{{- if .Values.harness.configMap.argocd.redisSvc -}}
{{- .Values.harness.configMap.argocd.redisSvc -}}
{{- else -}}
{{- if .Values.agent.highAvailability -}}
{{- .Values.harness.configMap.argocd.redisHaProxy -}}
{{- else -}}
{{- .Values.harness.configMap.argocd.redis -}}
{{- end -}}
{{- end -}}
{{- end -}}
19 changes: 9 additions & 10 deletions templates/gitops-agent/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,21 +25,20 @@ data:
GITOPS_AGENT_DISCOVER_APPLICATION_PODS_DURATION_IN_SECS: "{{ .Values.harness.configMap.reconcile.podsDiscovery }}"
LOG_LEVEL: {{ .Values.harness.configMap.logLevel }}
GITOPS_AGENT_FETCH_TYPE: "{{ .Values.harness.configMap.agentFetchType }}"
GITOPS_ARGOCD_REPO: "{{ .Values.harness.configMap.argocd.repoServer }}"
GITOPS_ARGOCD_REDIS: "{{ .Values.harness.configMap.argocd.redis }}"
GITOPS_ARGOCD_REDIS_HA: "{{ .Values.harness.configMap.argocd.redisHa }}"
GITOPS_ARGOCD_REDIS_HA_PROXY: "{{ .Values.harness.configMap.argocd.redisHaProxy }}"
GITOPS_ARGOCD_APP_CONTROLLER: "{{ .Values.harness.configMap.argocd.controller }}"
GITOPS_ARGOCD_APPSET_CONTROLLER: "{{ .Values.harness.configMap.argocd.applicationSet }}"
GITOPS_AGENT_AVAILABILITY_MODE: "{{ if .Values.agent.highAvailability }}HA{{ else }}NON-HA{{ end }}"
GITOPS_ARGOCD_REPO: {{ .Values.harness.configMap.argocd.repoServer }}
GITOPS_ARGOCD_REDIS: {{ .Values.harness.configMap.argocd.redis }}
GITOPS_ARGOCD_REDIS_HA: {{ .Values.harness.configMap.argocd.redisHa }}
GITOPS_ARGOCD_REDIS_HA_PROXY: {{ .Values.harness.configMap.argocd.redisHaProxy }}
GITOPS_ARGOCD_APP_CONTROLLER: {{ .Values.harness.configMap.argocd.controller }}
GITOPS_ARGOCD_APPSET_CONTROLLER: {{ .Values.harness.configMap.argocd.applicationSet }}
GITOPS_AGENT_AVAILABILITY_MODE: {{ if .Values.agent.highAvailability }}HA{{ else }}NON-HA{{ end }}
ARGOCD_SERVER_REPO_SERVER: {{ if .Values.harness.configMap.argocd.repoServerSvc }} {{ .Values.harness.configMap.argocd.repoServerSvc }}:8081{{ else }}{{ .Values.harness.configMap.argocd.repoServer }}:8081{{ end }}
{{- if .Values.agent.proxy.enabled }}
HTTPS_PROXY: {{ .Values.agent.proxy.httpsProxy }}
HTTP_PROXY: {{ .Values.agent.proxy.httpProxy }}
NO_PROXY: localhost,argocd-repo-server,argocd-redis,127.0.0.1,argocd-redis-ha-haproxy,$(KUBERNETES_SERVICE_HOST),kubernetes.default.svc,{{ .Values.agent.name }}
{{- end }}
{{- if and $argo.enabled $redisHa.haproxy.enabled }}
REDIS_SERVER: argocd-redis-ha-haproxy:6379
{{- end }}
REDIS_SERVER: {{ include "redisServer" . }}:6379
kind: ConfigMap
metadata:
labels:
Expand Down
4 changes: 0 additions & 4 deletions templates/gitops-agent/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,8 @@ spec:
name: certvol
subPath: ca.bundle
{{- end }}
{{- if .Values.agent.openshift.enabled }}
- mountPath: /app/logs
name: log-volume
{{- end }}
startupProbe:
exec:
command:
Expand Down Expand Up @@ -207,10 +205,8 @@ spec:
- key: ca.bundle
path: ca.bundle
{{- end }}
{{- if .Values.agent.openshift.enabled }}
- name: log-volume
emptyDir: { }
{{- end }}
{{- if .Values.agent.hostNetwork }}
hostNetwork: {{ .Values.agent.hostNetwork }}
{{- end }}
Expand Down
4 changes: 4 additions & 0 deletions values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -196,13 +196,17 @@ harness:
agentFetchType: "POLLER"

# -- non-default Argo CD name overrides for Harness GitOps Agent
# -- this is matched against app.kubernetes.io/name label

argocd:
repoServer: "argocd-repo-server"
redis: "argocd-redis"
redisHa: "argocd-redis-ha"
redisHaProxy: "argocd-redis-ha-haproxy"
controller: "argocd-application-controller"
applicationSet: "argocd-applicationset-controller"
repoServerSvc: ""
redisSvc: ""

secrets:
# -- DoNotEdit - GitOps Agent Secret uniquely identifies a GitOps Agent in the Service
Expand Down

0 comments on commit a19a19c

Please sign in to comment.