-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add secrets propagation from management cluster to othres using Clust…
…erProfile
- Loading branch information
Showing
23 changed files
with
241 additions
and
124 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{{- if .Values.grafana.security.create_secret }} | ||
{{- $secret := (lookup "v1" "Secret" .Release.Namespace .Values.grafana.security.credentials_secret_name) }} | ||
{{- if not $secret }} | ||
--- | ||
kind: Secret | ||
apiVersion: v1 | ||
metadata: | ||
name: {{ .Values.grafana.security.credentials_secret_name }} | ||
namespace: {{ .Release.Namespace }} | ||
stringData: | ||
GF_SECURITY_ADMIN_USER: {{ randAlpha (.Values.global.random_username_length | int) | quote }} # Grafana username | ||
GF_SECURITY_ADMIN_PASSWORD: {{ randAlpha (.Values.global.random_password_length | int) | quote }} # Grafana password | ||
type: Opaque | ||
{{- end }} | ||
{{- end }} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
charts/kof-mothership/templates/kcm/sveltos/copy-template.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: copy-resource-template | ||
namespace: {{ $.Release.Namespace }} | ||
annotations: | ||
projectsveltos.io/template: "true" # add annotation to indicate Sveltos content is a template | ||
data: | ||
secret.yaml: | | ||
{{` {{ copy "Resource" }} `}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
charts/kof-mothership/templates/sveltos/copy-secrets-cluster-profile.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{{- if .Values.kcm.kof.secrets_copy.secrets }} | ||
{{- /* Distributing secrets to clusters automatically*/}} | ||
--- | ||
apiVersion: config.projectsveltos.io/v1beta1 | ||
kind: ClusterProfile | ||
metadata: | ||
name: kof-secrets | ||
spec: | ||
clusterSelector: | ||
matchLabels: {{ .Values.kcm.kof.secrets_copy.matchLabels | toYaml | nindent 6 }} | ||
templateResourceRefs: | ||
{{- range .Values.kcm.kof.secrets_copy.secrets }} | ||
- resource: | ||
apiVersion: v1 | ||
kind: Secret | ||
name: {{ . }} | ||
namespace: {{ $.Release.Namespace }} | ||
identifier: Resource | ||
{{- end }} | ||
policyRefs: | ||
- kind: ConfigMap | ||
name: copy-resource-template | ||
namespace: {{ $.Release.Namespace }} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{{- if .Values.grafana.security.create_secret }} | ||
{{- $secret := (lookup "v1" "Secret" .Release.Namespace .Values.grafana.security.credentials_secret_name) }} | ||
{{- if not $secret }} | ||
--- | ||
kind: Secret | ||
apiVersion: v1 | ||
metadata: | ||
name: {{ .Values.grafana.security.credentials_secret_name }} | ||
namespace: {{ .Release.Namespace }} | ||
stringData: | ||
GF_SECURITY_ADMIN_USER: {{ randAlpha (.Values.global.random_username_length | int) | quote }} # Grafana username | ||
GF_SECURITY_ADMIN_PASSWORD: {{ randAlpha (.Values.global.random_password_length | int) | quote }} # Grafana password | ||
type: Opaque | ||
{{- end }} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.