Skip to content
Prev Previous commit
Next Next commit
Support custom crd domain
  • Loading branch information
markphillips100 committed Jun 24, 2025
commit ee7a6264beaab43b5603cb57b60a8be746b519e8
4 changes: 2 additions & 2 deletions manifests/helm/templates/crds/gitops-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: gitopsconfigs.example.com # Replace 'example.com' with your domain
name: gitopsconfigs.{{ .Values.multipleInstances.clusterDomain }}
spec:
group: example.com # Replace 'example.com' with your domain
group: {{ .Values.multipleInstances.clusterDomain }}
names:
kind: GitOpsConfig
plural: gitopsconfigs
Expand Down
6 changes: 5 additions & 1 deletion manifests/helm/templates/service-account.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,13 @@ metadata:
automountServiceAccountToken: {{ .Values.serviceAccount.automount }}
{{- end }}
---
{{- if not .Values.singleInstance }}
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: gitops-connector-config-reader
rules:
- apiGroups: ["example.com"] # "" indicates the core API group
- apiGroups: [{{ .Values.multipleInstances.clusterDomain | quote }}] # "" indicates the core API group
resources: ["gitopsconfigs"]
verbs: ["get", "watch", "list", "patch"]
- apiGroups: [""] # "" indicates the core API group
Expand All @@ -28,7 +29,9 @@ rules:
- apiGroups: [""]
resources: ["namespaces"]
verbs: ["watch", "list"]
{{- end }}
---
{{- if not .Values.singleInstance }}
apiVersion: rbac.authorization.k8s.io/v1
# This role binding allows "jane" to read pods in the "default" namespace.
# You need to already have a Role named "pod-reader" in that namespace.
Expand All @@ -45,3 +48,4 @@ roleRef:
kind: ClusterRole #this must be Role or ClusterRole
name: gitops-connector-config-reader # this must match the name of the Role or ClusterRole you wish to bind to
apiGroup: rbac.authorization.k8s.io
{{- end }}
2 changes: 1 addition & 1 deletion manifests/helm/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ singleInstance:

# specify values for a multiple instances configuration
multipleInstances:
clusterDomain: apps-crc.testing
clusterDomain: example.com

# -- Partially override resource names (adds suffix)
# @section -- Common
Expand Down