-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
389 additions
and
177 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,2 @@ | ||
# sample-charts | ||
|
||
My sample charts | ||
small change | ||
# Redis Enterprise Operator Helm Chart | ||
# IMPORTANT preview version - don't use in production. |
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,11 +1,39 @@ | ||
{{- define "redis-enterprise-operator.operator.image" }} | ||
{{- if and .Values.global .Values.global.azure .Values.global.azure.images .Values.global.azure.images.operator }} | ||
{{- if (.Values.global).azure }} | ||
{{- with .Values.global.azure.images.operator }} | ||
{{ .registry }}/{{ .image }}@{{ .digest }} | ||
{{- end }} | ||
{{- else }} | ||
{{- $defaultRepository := ternary "registry.connect.redhat.com/redislabs/redis-enterprise-operator" "redislabs/operator" .Values.isOpenshift }} | ||
{{- $defaultRepository := ternary "registry.connect.redhat.com/redislabs/redis-enterprise-operator" "redislabs/operator-internal" .Values.openshift.mode }} | ||
{{- $repository := default $defaultRepository .Values.operator.image.repository }} | ||
{{ $repository }}:{{ .Values.operator.image.tag }} | ||
{{- end }} | ||
{{- end }} | ||
|
||
{{- define "redis-enterprise-operator.annotations" }} | ||
{{- if ne .Values.versionAnnotations false -}} | ||
redis.io/helm-chart-ver: {{ .Chart.Version }} | ||
redis.io/operator-ver: {{ .Values.operator.image.tag }} | ||
{{- end }} | ||
{{- end }} | ||
|
||
{{/* | ||
Evaluates to a TLS configuration for the admission webhook, either by retrieving an | ||
existing configuration from the "admission-tls" Secret, or by generating a new one. | ||
Returns a TLS configuration YAML object with a "cert" and "privateKey" keys. | ||
*/}} | ||
{{- define "redis-enterprise-operator.admissionTLSConfig" }} | ||
{{- $tlsConfig := dict }} | ||
{{- $secret := (lookup "v1" "Secret" .Release.Namespace "admission-tls") }} | ||
{{- if $secret }} | ||
{{ $tlsConfig = $secret.data }} | ||
{{- else}} | ||
{{ $cna := printf "admission.%s" .Release.Namespace }} | ||
{{ $cnb := printf "admission.%s.svc" .Release.Namespace }} | ||
{{ $cnc := printf "admission.%s.svc.cluster.local" .Release.Namespace }} | ||
{{ $cert := genSelfSignedCert $cnb nil (list $cna $cnb $cnc) (int (mul 365 5)) }} | ||
{{ $_ := set $tlsConfig "cert" ($cert.Cert | b64enc) }} | ||
{{ $_ := set $tlsConfig "privateKey" ($cert.Key | b64enc) }} | ||
{{- end }} | ||
{{ $tlsConfig | toYaml | nindent 2 }} | ||
{{- 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
146 changes: 146 additions & 0 deletions
146
charts/redis-enterprise-operator/templates/jobs/patch-namespace-label.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,146 @@ | ||
{{- if .Values.admission.limitToNamespace }} | ||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
name: redis-enterprise-namespace-labels | ||
labels: | ||
app: redis-enterprise | ||
namespace: {{ .Release.Namespace }} | ||
annotations: | ||
"helm.sh/hook": post-install,post-upgrade,post-delete | ||
"helm.sh/hook-weight": "1" | ||
"helm.sh/hook-delete-policy": hook-succeeded,before-hook-creation | ||
{{- include "redis-enterprise-operator.annotations" . | nindent 4}} | ||
--- | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRole | ||
metadata: | ||
name: redis-enterprise-namespace-labels | ||
labels: | ||
app: redis-enterprise | ||
annotations: | ||
"helm.sh/hook": post-install,post-upgrade,post-delete | ||
"helm.sh/hook-weight": "1" | ||
"helm.sh/hook-delete-policy": hook-succeeded,before-hook-creation | ||
{{- include "redis-enterprise-operator.annotations" . | nindent 4}} | ||
rules: | ||
- apiGroups: [""] | ||
resources: ["namespaces"] | ||
verbs: ["patch"] | ||
--- | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRoleBinding | ||
metadata: | ||
name: redis-enterprise-namespace-labels | ||
labels: | ||
app: redis-enterprise | ||
annotations: | ||
"helm.sh/hook": post-install,post-upgrade,post-delete | ||
"helm.sh/hook-weight": "1" | ||
"helm.sh/hook-delete-policy": hook-succeeded,before-hook-creation | ||
{{- include "redis-enterprise-operator.annotations" . | nindent 4}} | ||
subjects: | ||
- kind: ServiceAccount | ||
name: redis-enterprise-namespace-labels | ||
namespace: {{ .Release.Namespace }} | ||
roleRef: | ||
kind: ClusterRole | ||
name: redis-enterprise-namespace-labels | ||
apiGroup: rbac.authorization.k8s.io | ||
|
||
--- | ||
apiVersion: batch/v1 | ||
kind: Job | ||
metadata: | ||
name: redis-enterprise-namespace-labels | ||
labels: | ||
app: redis-enterprise | ||
annotations: | ||
"helm.sh/hook": post-install,post-upgrade | ||
"helm.sh/hook-weight": "1" | ||
"helm.sh/hook-delete-policy": hook-succeeded,before-hook-creation | ||
{{- include "redis-enterprise-operator.annotations" . | nindent 4}} | ||
spec: | ||
backoffLimit: 6 | ||
completions: 1 | ||
parallelism: 1 | ||
template: | ||
metadata: | ||
labels: | ||
app: redis-enterprise | ||
spec: | ||
containers: | ||
- name: redis-enterprise-namespace-labels | ||
resources: | ||
limits: | ||
cpu: 100m | ||
memory: 100Mi | ||
image: {{ include "redis-enterprise-operator.operator.image" . | printf "%s" | trim }} | ||
imagePullPolicy: IfNotPresent | ||
securityContext: | ||
allowPrivilegeEscalation: false | ||
capabilities: | ||
drop: ["ALL"] | ||
runAsNonRoot: true | ||
seccompProfile: | ||
type: "RuntimeDefault" | ||
command: | ||
- crd-installer | ||
args: | ||
- "-action=patchNamespace" | ||
- -namespace={{ .Release.Namespace }} | ||
restartPolicy: OnFailure | ||
serviceAccountName: redis-enterprise-namespace-labels | ||
imagePullSecrets: | ||
{{- range .Values.imagePullSecrets }} | ||
- name: {{ . }} | ||
{{- end }} | ||
--- | ||
|
||
apiVersion: batch/v1 | ||
kind: Job | ||
metadata: | ||
name: redis-enterprise-namespace-labels-cleanup | ||
labels: | ||
app: redis-enterprise | ||
annotations: | ||
"helm.sh/hook": post-delete | ||
"helm.sh/hook-weight": "1" | ||
"helm.sh/hook-delete-policy": hook-succeeded,before-hook-creation | ||
{{- include "redis-enterprise-operator.annotations" . | nindent 4}} | ||
spec: | ||
backoffLimit: 6 | ||
completions: 1 | ||
parallelism: 1 | ||
template: | ||
metadata: | ||
labels: | ||
app: redis-enterprise | ||
spec: | ||
containers: | ||
- name: redis-enterprise-namespace-labels-cleanup | ||
resources: | ||
limits: | ||
cpu: 100m | ||
memory: 100Mi | ||
image: {{ include "redis-enterprise-operator.operator.image" . | printf "%s" | trim }} | ||
imagePullPolicy: IfNotPresent | ||
securityContext: | ||
allowPrivilegeEscalation: false | ||
capabilities: | ||
drop: ["ALL"] | ||
runAsNonRoot: true | ||
seccompProfile: | ||
type: "RuntimeDefault" | ||
command: | ||
- crd-installer | ||
args: | ||
- "-action=unpatchNamespace" | ||
- -namespace={{ .Release.Namespace }} | ||
restartPolicy: OnFailure | ||
serviceAccountName: redis-enterprise-namespace-labels | ||
imagePullSecrets: | ||
{{- range .Values.imagePullSecrets }} | ||
- name: {{ . }} | ||
{{- end }} | ||
{{- end }}{{- /* if limitToNamespace */ -}} |
Oops, something went wrong.