Skip to content

Commit

Permalink
Merge pull request #7 from harness/CDS-99063
Browse files Browse the repository at this point in the history
techdebt: [CDS-99063]: align with gitops-helm charts
  • Loading branch information
ashinsabu3 authored Jul 30, 2024
2 parents 4c76992 + 2adc599 commit 699f796
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 2 deletions.
32 changes: 32 additions & 0 deletions templates/_common.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -105,3 +105,35 @@ just set the value of .Values.harness.configMap.argocd.redisSvc
{{- end -}}
{{- end -}}
{{- 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 "argo-cd.fullname" -}}
{{- if .Values.fullnameOverride -}}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- $name := default "argo-cd" .Values.nameOverride -}}
{{- if contains $name .Release.Name -}}
{{- .Release.Name | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{- end -}}
{{- end -}}

{{/*
Create redis name and version as used by the chart label.
*/}}
{{- define "argo-cd.redis.fullname" -}}
{{- $redisHa := (index .Values "redis-ha") -}}
{{- if $redisHa.enabled -}}
{{- if $redisHa.haproxy.enabled -}}
{{- printf "%s-%s-haproxy" (index .Values "fullnameOverride") $redisHa.name | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{- else -}}
{{- printf "%s-%s" (include "argo-cd.fullname" .) .Values.redis.name | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{- end -}}
2 changes: 1 addition & 1 deletion templates/gitops-agent/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,10 @@ spec:
name: {{ default "argocd-redis" .Values.externalRedis.existingSecret }}
{{- if .Values.externalRedis.host }}
key: redis-password
optional: true
{{- else }}
key: auth
{{- end }}
optional: true
- name: REDIS_SENTINEL_USERNAME
valueFrom:
secretKeyRef:
Expand Down
15 changes: 14 additions & 1 deletion values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ agent:
repository: harness/gitops-agent
# -- Tag to use for the GitOps Agent
# @default -- `""` (defaults to global.image.tag)
tag: v0.73.0
tag: v0.77.0
# -- Image pull policy for GitOps Agent
# @default -- `""` (defaults to global.image.imagePullPolicy)
imagePullPolicy: Always
Expand Down Expand Up @@ -397,6 +397,19 @@ controller:
redis:
name: redis

# Enable and set appropriate values from your argocd redis configuration if redis is being used in HA mode
redis-ha:
enabled: false
# This value should be equal to redis-ha.fullname generated and set there from your redis-ha subchart
# This will be used to get redis auth details from given secret name generated from this field
# Usually is the same as the value .Values.harness.configmap.argocd.redisHa
name: "redis-ha"
haproxy:
enabled: true
# -- Existing Secret to use for redis-ha authentication.
# By default the redis-secret-init Job from Argo-CD is generating this Secret.
existingSecret: argocd-redis

# External Redis parameters
externalRedis:
# -- External Redis server host
Expand Down

0 comments on commit 699f796

Please sign in to comment.