Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support singleNamespace option #266

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions charts/gitops-runtime/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,15 @@ dependencies:
- name: sealed-secrets
repository: https://bitnami-labs.github.io/sealed-secrets/
version: 2.14.1
condition: sealed-secrets.enabled
- name: codefresh-tunnel-client
repository: oci://quay.io/codefresh/charts
version: 0.1.17
alias: tunnel-client
condition: tunnel-client.enabled
- name: codefresh-gitops-operator
repository: oci://quay.io/codefresh/charts
version: 0.2.12
repository: oci://quay.io/codefresh/charts/dev
version: 0.0.0-feat-cr-24670-namespaced-install
alias: gitops-operator
condition: gitops-operator.enabled
- name: garage
Expand Down
7 changes: 5 additions & 2 deletions charts/gitops-runtime/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -232,10 +232,13 @@ Output comma separated list of installed runtime components
{{- define "codefresh-gitops-runtime.component-list"}}
{{- $argoCD := dict "name" "argocd" "version" (get .Subcharts "argo-cd").Chart.AppVersion }}
{{- $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") }}
{{- $comptList := list $argoCD $argoEvents $appProxy $sealedSecrets $internalRouter}}
{{- $comptList := list $argoCD $argoEvents $appProxy $internalRouter}}
{{- if index (get .Values "sealed-secrets") "enabled" }}
{{- $sealedSecrets := dict "name" "sealed-secrets" "version" (get .Subcharts "sealed-secrets").Chart.AppVersion }}
{{- $comptList = append $comptList $sealedSecrets }}
{{- 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 }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,18 @@
{{- $_ := set $appProxyContext "Values" (get .Values "app-proxy") }}
{{- $_ := set $appProxyContext.Values "global" (get .Values "global") }}
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
kind: {{ $appProxyContext.Values.singleNamespace | ternary "RoleBinding" "ClusterRoleBinding" }}
metadata:
name: cap-app-proxy-argo-workflows
{{- if $appProxyContext.Values.singleNamespace }}
namespace: {{ .Release.Namespace }}
{{- end }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
kind: {{ $appProxyContext.Values.singleNamespace | ternary "Role" "ClusterRole" }}
name: {{ include "codefresh-gitops-runtime.argo-workflows.server.name" . }}
subjects:
- kind: ServiceAccount
name: {{ include "cap-app-proxy.serviceAccountName" $appProxyContext }}
namespace: {{ .Release.Namespace }}
{{- end }}
{{- end }}
2 changes: 1 addition & 1 deletion charts/gitops-runtime/templates/gitops-operator.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- if index (get .Values "gitops-operator") "libraryMode" }}
{{- if and (index (get .Values "gitops-operator") "libraryMode") (index (get .Values "gitops-operator") "enabled") }}
{{- $gitopsOperatorContext := (index .Subcharts "gitops-operator")}}
{{- $argoCDImageDict := index .Subcharts "argo-cd" "Values" "global" "image" }}
{{- if not $argoCDImageDict.tag }}
Expand Down
3 changes: 3 additions & 0 deletions charts/gitops-runtime/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ installer:
# Sealed secrets
# -----------------------------------------------------------------------------------------------------------------------
sealed-secrets:
enabled: true
fullnameOverride: sealed-secrets-controller
keyrenewperiod: "720h"
image:
Expand Down Expand Up @@ -370,6 +371,7 @@ tunnel-client:
#-----------------------------------------------------------------------------------------------------------------------
app-proxy:
replicaCount: 1
singleNamespace: false
# -- Image enrichment process configuration
image-enrichment:
# -- Enable or disable enrichment process. Please note that for enrichemnt, argo-workflows has to be enabled as well.
Expand Down Expand Up @@ -549,6 +551,7 @@ gitops-operator:
# -- Additional labels for gitops operator CRDs
additionalLabels: {}

singleNamespace: false
env: {}
image: {}
# -- defaults
Expand Down