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

Reformat chart templates with minor property fixes #1647

Merged
merged 5 commits into from
Jun 27, 2023
Merged
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
2 changes: 1 addition & 1 deletion helm/operator/templates/NOTES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ apiVersion: v1
kind: Secret
metadata:
name: console-sa-secret
namespace: minio-operator
namespace: {{ .Release.Namespace }}
annotations:
kubernetes.io/service-account.name: console-sa
type: kubernetes.io/service-account-token
Expand Down
20 changes: 10 additions & 10 deletions helm/operator/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Expand the name of the chart.
*/}}
{{- define "minio-operator.name" -}}
{{- default .Chart.Name | trunc 63 | trimSuffix "-" -}}
{{- default .Chart.Name | trunc 63 | trimSuffix "-" -}}
{{- end -}}

{{/*
Expand All @@ -12,19 +12,19 @@ We truncate at 63 chars because some Kubernetes name fields are limited to this
If release name contains chart name it will be used as a full name.
*/}}
{{- define "minio-operator.fullname" -}}
{{- $name := default .Chart.Name -}}
{{- if contains $name .Release.Name -}}
{{- .Release.Name | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{- $name := default .Chart.Name -}}
{{- if contains $name .Release.Name -}}
{{- .Release.Name | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{- end -}}

{{/*
Expand the name of the Operator Console.
*/}}
{{- define "minio-operator.console-name" -}}
{{- printf "%s-%s" .Chart.Name "console" | trunc 63 | trimSuffix "-" -}}
{{- printf "%s-%s" .Chart.Name "console" | trunc 63 | trimSuffix "-" -}}
{{- end -}}

{{/*
Expand All @@ -33,14 +33,14 @@ We truncate at 63 chars because some Kubernetes name fields are limited to this
If release name contains chart name it will be used as a full name.
*/}}
{{- define "minio-operator.console-fullname" -}}
{{- printf "%s-%s" .Release.Name "console" | trunc 63 | trimSuffix "-" -}}
{{- printf "%s-%s" .Release.Name "console" | trunc 63 | trimSuffix "-" -}}
{{- end -}}

{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "minio-operator.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
{{- end -}}

{{/*
Expand Down
63 changes: 24 additions & 39 deletions helm/operator/templates/console-deployment.yaml
Original file line number Diff line number Diff line change
@@ -1,48 +1,45 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: "console"
labels:
{{- include "minio-operator.labels" . | nindent 4 }}
name: console
labels: {{- include "minio-operator.labels" . | nindent 4 }}
spec:
replicas: {{ .Values.console.replicaCount }}
selector:
matchLabels:
{{- include "minio-operator.console-selectorLabels" . | nindent 6 }}
matchLabels: {{- include "minio-operator.console-selectorLabels" . | nindent 6 }}
template:
metadata:
labels:
{{- include "minio-operator.console-selectorLabels" . | nindent 8 }}
labels: {{- include "minio-operator.console-selectorLabels" . | nindent 8 }}
spec:
{{- with .Values.operator.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- with .Values.console.imagePullSecrets }}
imagePullSecrets: {{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.console.runtimeClassName }}
runtimeClassName: {{ . }}
{{- end }}
serviceAccountName: console-sa
{{- with .Values.console.securityContext }}
securityContext:
{{- toYaml . | nindent 8 }}
securityContext: {{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.console.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
nodeSelector: {{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.console.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
affinity: {{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.console.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
tolerations: {{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.console.topologySpreadConstraints }}
topologySpreadConstraints:
{{- toYaml . | nindent 8 }}
topologySpreadConstraints: {{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.console.initContainers }}
initContainers: {{- toYaml . | nindent 8 }}
{{- end }}
containers:
- name: {{ .Chart.Name }}
image: "{{ .Values.console.image.repository }}:{{ .Values.console.image.tag }}"
imagePullPolicy: {{ .Values.operator.image.pullPolicy }}
imagePullPolicy: {{ .Values.console.image.pullPolicy }}
ports:
- containerPort: 9090
name: http
Expand All @@ -51,25 +48,13 @@ spec:
args:
- ui
- --certs-dir=/tmp/certs
resources:
{{- toYaml .Values.console.resources | nindent 12 }}
volumeMounts:
{{- with .Values.console.volumeMounts }}
{{- toYaml . | nindent 12 }}
{{- end }}
securityContext:
resources: {{- toYaml .Values.console.resources | nindent 12 }}
{{- with .Values.console.containerSecurityContext }}
{{- toYaml . | nindent 12 }}
securityContext: {{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.console.volumeMounts }}
volumeMounts: {{- toYaml . | nindent 12 }}
{{- end }}
volumes:
{{- with .Values.console.volumes }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.console.initContainers }}
initContainers:
{{- toYaml . | nindent 8 }}
volumes: {{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.operator.runtimeClassName }}
runtimeClassName:
{{- toYaml . | nindent 8 }}
{{- end}}
6 changes: 3 additions & 3 deletions helm/operator/templates/console-ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ metadata:
annotations: {{ toYaml . | nindent 4 }}
{{- end }}
spec:
{{- if .Values.console.ingress.ingressClassName }}
ingressClassName: {{ .Values.console.ingress.ingressClassName }}
{{- with .Values.console.ingress.ingressClassName }}
ingressClassName: {{ . }}
{{- end }}
{{- if .Values.console.ingress.tls }}
tls:
Expand All @@ -34,4 +34,4 @@ spec:
name: "console"
port:
name: http
{{ end }}
{{- end }}
6 changes: 2 additions & 4 deletions helm/operator/templates/console-service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,11 @@ apiVersion: v1
kind: Service
metadata:
name: "console"
labels:
{{- include "minio-operator.labels" . | nindent 4 }}
labels: {{- include "minio-operator.labels" . | nindent 4 }}
spec:
ports:
- name: http
port: 9090
- name: https
port: 9443
selector:
{{- include "minio-operator.console-selectorLabels" . | nindent 4 }}
selector: {{- include "minio-operator.console-selectorLabels" . | nindent 4 }}
1 change: 0 additions & 1 deletion helm/operator/templates/minio.min.io_tenants.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
Expand Down
50 changes: 18 additions & 32 deletions helm/operator/templates/operator-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,67 +2,53 @@ apiVersion: apps/v1
kind: Deployment
metadata:
name: "minio-operator"
labels:
{{- include "minio-operator.labels" . | nindent 4 }}
labels: {{- include "minio-operator.labels" . | nindent 4 }}
spec:
replicas: {{ .Values.operator.replicaCount }}
selector:
matchLabels:
{{- include "minio-operator.selectorLabels" . | nindent 6 }}
matchLabels: {{- include "minio-operator.selectorLabels" . | nindent 6 }}
template:
metadata:
labels:
{{- include "minio-operator.selectorLabels" . | nindent 8 }}
labels: {{- include "minio-operator.selectorLabels" . | nindent 8 }}
spec:
{{- with .Values.operator.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
imagePullSecrets: {{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.operator.runtimeClassName }}
runtimeClassName: {{ . }}
{{- end }}
serviceAccountName: minio-operator
{{- with .Values.operator.securityContext }}
securityContext:
{{- toYaml . | nindent 8 }}
securityContext: {{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.operator.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
nodeSelector: {{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.operator.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
affinity: {{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.operator.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
tolerations: {{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.operator.topologySpreadConstraints }}
topologySpreadConstraints:
{{- toYaml . | nindent 8 }}
topologySpreadConstraints: {{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.operator.priorityClassName }}
priorityClassName: {{ . }}
{{- end }}
{{- with .Values.operator.initContainers }}
initContainers: {{- toYaml . | nindent 8 }}
{{- end }}
containers:
- name: {{ .Chart.Name }}
image: "{{ .Values.operator.image.repository }}:{{ .Values.operator.image.tag }}"
imagePullPolicy: {{ .Values.operator.image.pullPolicy }}
args:
- controller
{{- with .Values.operator.env }}
env:
{{ toYaml . | nindent 10 }}
env: {{- toYaml . | nindent 12 }}
{{- end }}
resources:
{{- toYaml .Values.operator.resources | nindent 12 }}
securityContext:
resources: {{- toYaml .Values.operator.resources | nindent 12 }}
{{- with .Values.operator.containerSecurityContext }}
{{- toYaml . | nindent 12 }}
securityContext: {{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.operator.initContainers }}
initContainers:
{{- toYaml . | nindent 8 }}
{{- end}}
{{- with .Values.operator.runtimeClassName }}
runtimeClassName:
{{- toYaml . | nindent 8 }}
{{- end }}
9 changes: 3 additions & 6 deletions helm/operator/templates/operator-service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ apiVersion: v1
kind: Service
metadata:
name: "operator"
labels:
{{- include "minio-operator.labels" . | nindent 4 }}
labels: {{- include "minio-operator.labels" . | nindent 4 }}
spec:
type: ClusterIP
ports:
Expand All @@ -17,12 +16,10 @@ apiVersion: v1
kind: Service
metadata:
name: "sts"
labels:
{{- include "minio-operator.labels" . | nindent 4 }}
labels: {{- include "minio-operator.labels" . | nindent 4 }}
spec:
type: ClusterIP
ports:
- port: 4223
name: https
selector:
{{- include "minio-operator.selectorLabels" . | nindent 4 }}
selector: {{- include "minio-operator.selectorLabels" . | nindent 4 }}
3 changes: 1 addition & 2 deletions helm/operator/templates/serviceaccount.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,4 @@ apiVersion: v1
kind: ServiceAccount
metadata:
name: minio-operator
labels:
{{ include "minio-operator.labels" . | nindent 4 }}
labels: {{- include "minio-operator.labels" . | nindent 4 }}
1 change: 0 additions & 1 deletion helm/operator/templates/sts.min.io_policybindings.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
Expand Down
7 changes: 5 additions & 2 deletions helm/operator/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ operator:
tag: v5.0.5
pullPolicy: IfNotPresent
imagePullSecrets: [ ]
initcontainers: [ ]
runtimeClassName: ~
initContainers: [ ]
env: [ ]
replicaCount: 2
securityContext:
runAsUser: 1000
Expand Down Expand Up @@ -51,7 +53,8 @@ console:
tag: v5.0.5
pullPolicy: IfNotPresent
imagePullSecrets: [ ]
initcontainers: [ ]
runtimeClassName: ~
initContainers: [ ]
replicaCount: 1
nodeSelector: { }
affinity: { }
Expand Down
20 changes: 10 additions & 10 deletions helm/tenant/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Expand the name of the chart.
*/}}
{{- define "minio-operator.name" -}}
{{- default .Chart.Name | trunc 63 | trimSuffix "-" -}}
{{- default .Chart.Name | trunc 63 | trimSuffix "-" -}}
{{- end -}}

{{/*
Expand All @@ -12,19 +12,19 @@ We truncate at 63 chars because some Kubernetes name fields are limited to this
If release name contains chart name it will be used as a full name.
*/}}
{{- define "minio-operator.fullname" -}}
{{- $name := default .Chart.Name -}}
{{- if contains $name .Release.Name -}}
{{- .Release.Name | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{- $name := default .Chart.Name -}}
{{- if contains $name .Release.Name -}}
{{- .Release.Name | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{- end -}}

{{/*
Expand the name of the Operator Console.
*/}}
{{- define "minio-operator.console-name" -}}
{{- printf "%s-%s" .Chart.Name "console" | trunc 63 | trimSuffix "-" -}}
{{- printf "%s-%s" .Chart.Name "console" | trunc 63 | trimSuffix "-" -}}
{{- end -}}

{{/*
Expand All @@ -33,14 +33,14 @@ We truncate at 63 chars because some Kubernetes name fields are limited to this
If release name contains chart name it will be used as a full name.
*/}}
{{- define "minio-operator.console-fullname" -}}
{{- printf "%s-%s" .Release.Name "console" | trunc 63 | trimSuffix "-" -}}
{{- printf "%s-%s" .Release.Name "console" | trunc 63 | trimSuffix "-" -}}
{{- end -}}

{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "minio-operator.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
{{- end -}}

{{/*
Expand Down
Loading