Skip to content

Commit 9ee6ad3

Browse files
committed
restructure Helm chart output directories
Signed-off-by: YuChen <[email protected]>
1 parent 475abf9 commit 9ee6ad3

File tree

14 files changed

+432
-135
lines changed

14 files changed

+432
-135
lines changed

Makefile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -255,8 +255,10 @@ deploy-dryrun: manifests kustomize ## Deploy controller to the K8s cluster speci
255255

256256
.PHONY: helm
257257
helm: deploy-dryrun kustohelmize
258-
$(KUSTOHELMIZE) create --from=config/ibm-common-service-operator.yaml helm/ibm-common-service-operator
259-
helm lint helm/ibm-common-service-operator
258+
$(KUSTOHELMIZE) create --from=config/ibm-common-service-operator.yaml generate-helm/ibm-common-service-operator
259+
helm lint generate-helm/ibm-common-service-operator
260+
bash scripts/restructure_helm.sh
261+
helm lint helm
260262

261263
KUBERNETES-SPLIT-YAML ?= $(LOCALBIN)/kubernetes-split-yaml
262264
KUSTOHELMIZE ?= $(LOCALBIN)/kustohelmize
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
logger: {}
2+
chartname: ibm-common-service-operator
3+
sharedValues:
4+
operatorNamespace: operator-ns
5+
affinity: {}
6+
nodeSelector: {}
7+
podSecurityContext: {}
8+
resources: {}
9+
securityContext: {}
10+
tolerations: {}
11+
globalConfig:
12+
metadata.labels:
13+
- strategy: newline
14+
key: ibm-common-service-operator.labels
15+
metadata.name:
16+
- strategy: inline
17+
key: ibm-common-service-operator.fullname
18+
metadata.namespace:
19+
- strategy: inline
20+
key: sharedValues.operatorNamespace
21+
fileConfig:
22+
generate-helm/ibm-common-service-operator-generated/commonservices.operator.ibm.com-crd.yaml: {}
23+
generate-helm/ibm-common-service-operator-generated/ibm-common-service-operator-cr.yaml: {}
24+
generate-helm/ibm-common-service-operator-generated/ibm-common-service-operator-crb.yaml:
25+
subjects[0].namespace:
26+
- strategy: inline
27+
key: sharedValues.operatorNamespace
28+
generate-helm/ibm-common-service-operator-generated/ibm-common-service-operator-deployment.yaml: {}
29+
generate-helm/ibm-common-service-operator-generated/ibm-common-service-operator-rb.yaml:
30+
subjects[0].namespace:
31+
- strategy: inline
32+
key: sharedValues.operatorNamespace
33+
generate-helm/ibm-common-service-operator-generated/ibm-common-service-operator-role.yaml: {}
34+
generate-helm/ibm-common-service-operator-generated/ibm-common-service-operator-sa.yaml: {}
35+
generate-helm/ibm-common-service-operator-generated/mutating-webhook-configuration-mutatingwebhookconfiguration.yaml: {}
36+
generate-helm/ibm-common-service-operator-generated/selfsigned-issuer-issuer.yaml: {}
37+
generate-helm/ibm-common-service-operator-generated/serving-cert-certificate.yaml: {}
38+
generate-helm/ibm-common-service-operator-generated/validating-webhook-configuration-validatingwebhookconfiguration.yaml: {}
39+
generate-helm/ibm-common-service-operator-generated/webhook-service-svc.yaml: {}

helm-cluster-scoped/Chart.yaml

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,24 @@
11
apiVersion: v2
22
name: ibm-common-service-operator
3-
description: A Helm chart for ibm-common-service-operator
3+
description: A Helm chart for Kubernetes
4+
5+
# A chart can be either an 'application' or a 'library' chart.
6+
#
7+
# Application charts are a collection of templates that can be packaged into versioned archives
8+
# to be deployed.
9+
#
10+
# Library charts provide useful utilities or functions for the chart developer. They're included as
11+
# a dependency of application charts to inject those utilities and functions into the rendering
12+
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
413
type: application
5-
version: 4.6.11
6-
appVersion: 4.6.11
14+
15+
# This is the chart version. This version number should be incremented each time you make changes
16+
# to the chart and its templates, including the app version.
17+
# Versions are expected to follow Semantic Versioning (https://semver.org/)
18+
version: 0.1.0
19+
20+
# This is the version number of the application being deployed. This version number should be
21+
# incremented each time you make changes to the application. Versions are not expected to
22+
# follow Semantic Versioning. They should reflect the version the application is using.
23+
# It is recommended to use it with quotes.
24+
appVersion: "1.16.0"
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
{{/*
2+
Expand the name of the chart.
3+
*/}}
4+
{{- define "ibm-common-service-operator.name" -}}
5+
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
6+
{{- end }}
7+
8+
{{/*
9+
Create a default fully qualified app name.
10+
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
11+
If release name contains chart name it will be used as a full name.
12+
*/}}
13+
{{- define "ibm-common-service-operator.fullname" -}}
14+
{{- if .Values.fullnameOverride }}
15+
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
16+
{{- else }}
17+
{{- $name := default .Chart.Name .Values.nameOverride }}
18+
{{- if contains $name .Release.Name }}
19+
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
20+
{{- else }}
21+
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
22+
{{- end }}
23+
{{- end }}
24+
{{- end }}
25+
26+
{{/*
27+
Create chart name and version as used by the chart label.
28+
*/}}
29+
{{- define "ibm-common-service-operator.chart" -}}
30+
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
31+
{{- end }}
32+
33+
{{/*
34+
Common labels
35+
*/}}
36+
{{- define "ibm-common-service-operator.labels" -}}
37+
helm.sh/chart: {{ include "ibm-common-service-operator.chart" . }}
38+
{{ include "ibm-common-service-operator.selectorLabels" . }}
39+
{{- if .Chart.AppVersion }}
40+
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
41+
{{- end }}
42+
app.kubernetes.io/managed-by: {{ .Release.Service }}
43+
{{- end }}
44+
45+
{{/*
46+
Selector labels
47+
*/}}
48+
{{- define "ibm-common-service-operator.selectorLabels" -}}
49+
app.kubernetes.io/name: {{ include "ibm-common-service-operator.name" . }}
50+
app.kubernetes.io/instance: {{ .Release.Name }}
51+
{{- end }}
52+
53+
{{/*
54+
Create the name of the service account to use
55+
*/}}
56+
{{- define "ibm-common-service-operator.serviceAccountName" -}}
57+
{{- if .Values.serviceAccount.create }}
58+
{{- default (include "ibm-common-service-operator.fullname" .) .Values.serviceAccount.name }}
59+
{{- else }}
60+
{{- default "default" .Values.serviceAccount.name }}
61+
{{- end }}
62+
{{- end }}
Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
# Generated by [Kustohelmize](https://github.com/yeahdongcn/kustohelmize)
2+
apiVersion: rbac.authorization.k8s.io/v1
3+
kind: ClusterRoleBinding
4+
metadata:
5+
name: {{ include "ibm-common-service-operator.fullname" . }}
6+
labels:
7+
{{- include "ibm-common-service-operator.labels" . | nindent 4 }}
8+
roleRef:
9+
kind: ClusterRole
10+
apiGroup: rbac.authorization.k8s.io
11+
name: ibm-common-service-operator
12+
subjects:
13+
- kind: ServiceAccount
14+
name: ibm-common-service-operator
15+
namespace: {{ .Values.operatorNamespace }}
16+
17+
---
18+
# Generated by [Kustohelmize](https://github.com/yeahdongcn/kustohelmize)
19+
apiVersion: rbac.authorization.k8s.io/v1
20+
kind: ClusterRole
21+
metadata:
22+
name: {{ include "ibm-common-service-operator.fullname" . }}
23+
rules:
24+
- apiGroups:
25+
- ""
26+
resourceNames:
27+
- common-service-maps
28+
resources:
29+
- configmaps
30+
verbs:
31+
- delete
32+
- update
33+
- apiGroups:
34+
- ""
35+
resourceNames:
36+
- cloud-native-postgresql-image-list
37+
resources:
38+
- configmaps
39+
verbs:
40+
- delete
41+
- apiGroups:
42+
- ""
43+
resources:
44+
- configmaps
45+
verbs:
46+
- create
47+
- get
48+
- list
49+
- watch
50+
- update
51+
- apiGroups:
52+
- ""
53+
resources:
54+
- secrets
55+
verbs:
56+
- get
57+
- apiGroups:
58+
- storage.k8s.io
59+
resources:
60+
- storageclasses
61+
verbs:
62+
- get
63+
- list
64+
- watch
65+
- apiGroups:
66+
- admissionregistration.k8s.io
67+
resources:
68+
- mutatingwebhookconfigurations
69+
- validatingwebhookconfigurations
70+
verbs:
71+
- create
72+
- delete
73+
- get
74+
- list
75+
- patch
76+
- update
77+
- watch
78+
- apiGroups:
79+
- config.openshift.io
80+
resources:
81+
- infrastructures
82+
verbs:
83+
- get
84+
- apiGroups:
85+
- rbac.authorization.k8s.io
86+
resources:
87+
- clusterrolebindings
88+
- clusterroles
89+
verbs:
90+
- create
91+
- delete
92+
- get
93+
- list
94+
- patch
95+
- update
96+
- watch
97+
98+
---
99+
# Generated by [Kustohelmize](https://github.com/yeahdongcn/kustohelmize)
100+
apiVersion: v1
101+
kind: ServiceAccount
102+
metadata:
103+
name: {{ include "ibm-common-service-operator.fullname" . }}
104+
namespace: {{ .Values.operatorNamespace }}

helm-cluster-scoped/templates/cluster-webhook.yaml

Whitespace-only changes.

helm-cluster-scoped/values.yaml

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,22 @@
1-
imagePullPrefix: icr.io
2-
imagePullSecret: ibm-entitlement-key
1+
# Generated by [Kustohelmize](https://github.com/yeahdongcn/kustohelmize)
2+
affinity: {}
3+
nodeSelector: {}
4+
operatorNamespace: operator-ns
5+
podSecurityContext: {}
6+
resources: {}
7+
securityContext: {}
8+
tolerations: {}
39

4-
# Note there are no leading or trailing /'s
5-
imageRegistryNamespaceOperator: cpopen
6-
imageRegistryNamespaceOperand: cpopen/cpfs
10+
commonservicesOperatorIbmComCrd: {}
11+
ibmCommonServiceOperatorCr: {}
12+
ibmCommonServiceOperatorCrb: {}
13+
ibmCommonServiceOperatorDeployment: {}
14+
ibmCommonServiceOperatorRb: {}
15+
ibmCommonServiceOperatorRole: {}
16+
ibmCommonServiceOperatorSa: {}
17+
mutatingWebhookConfigurationMutatingwebhookconfiguration: {}
18+
selfsignedIssuerIssuer: {}
19+
servingCertCertificate: {}
20+
validatingWebhookConfigurationValidatingwebhookconfiguration: {}
21+
webhookServiceSvc: {}
722

8-
# other configuration you think you might need for your operator
9-
# following are examples, not required:
10-
operatorNamespace: ibm-common-services
11-
servicesNamespace: service
12-
operatorImage: ibm-common-service-operator

helm/Chart.yaml

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,24 @@
11
apiVersion: v2
22
name: ibm-common-service-operator
3-
description: A Helm chart for ibm-common-service-operator
3+
description: A Helm chart for Kubernetes
4+
5+
# A chart can be either an 'application' or a 'library' chart.
6+
#
7+
# Application charts are a collection of templates that can be packaged into versioned archives
8+
# to be deployed.
9+
#
10+
# Library charts provide useful utilities or functions for the chart developer. They're included as
11+
# a dependency of application charts to inject those utilities and functions into the rendering
12+
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
413
type: application
5-
version: 4.6.11
6-
appVersion: 4.6.11
14+
15+
# This is the chart version. This version number should be incremented each time you make changes
16+
# to the chart and its templates, including the app version.
17+
# Versions are expected to follow Semantic Versioning (https://semver.org/)
18+
version: 0.1.0
19+
20+
# This is the version number of the application being deployed. This version number should be
21+
# incremented each time you make changes to the application. Versions are not expected to
22+
# follow Semantic Versioning. They should reflect the version the application is using.
23+
# It is recommended to use it with quotes.
24+
appVersion: "1.16.0"

helm/templates/_helpers.tpl

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
{{/*
2+
Expand the name of the chart.
3+
*/}}
4+
{{- define "ibm-common-service-operator.name" -}}
5+
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
6+
{{- end }}
7+
8+
{{/*
9+
Create a default fully qualified app name.
10+
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
11+
If release name contains chart name it will be used as a full name.
12+
*/}}
13+
{{- define "ibm-common-service-operator.fullname" -}}
14+
{{- if .Values.fullnameOverride }}
15+
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
16+
{{- else }}
17+
{{- $name := default .Chart.Name .Values.nameOverride }}
18+
{{- if contains $name .Release.Name }}
19+
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
20+
{{- else }}
21+
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
22+
{{- end }}
23+
{{- end }}
24+
{{- end }}
25+
26+
{{/*
27+
Create chart name and version as used by the chart label.
28+
*/}}
29+
{{- define "ibm-common-service-operator.chart" -}}
30+
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
31+
{{- end }}
32+
33+
{{/*
34+
Common labels
35+
*/}}
36+
{{- define "ibm-common-service-operator.labels" -}}
37+
helm.sh/chart: {{ include "ibm-common-service-operator.chart" . }}
38+
{{ include "ibm-common-service-operator.selectorLabels" . }}
39+
{{- if .Chart.AppVersion }}
40+
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
41+
{{- end }}
42+
app.kubernetes.io/managed-by: {{ .Release.Service }}
43+
{{- end }}
44+
45+
{{/*
46+
Selector labels
47+
*/}}
48+
{{- define "ibm-common-service-operator.selectorLabels" -}}
49+
app.kubernetes.io/name: {{ include "ibm-common-service-operator.name" . }}
50+
app.kubernetes.io/instance: {{ .Release.Name }}
51+
{{- end }}
52+
53+
{{/*
54+
Create the name of the service account to use
55+
*/}}
56+
{{- define "ibm-common-service-operator.serviceAccountName" -}}
57+
{{- if .Values.serviceAccount.create }}
58+
{{- default (include "ibm-common-service-operator.fullname" .) .Values.serviceAccount.name }}
59+
{{- else }}
60+
{{- default "default" .Values.serviceAccount.name }}
61+
{{- end }}
62+
{{- end }}

0 commit comments

Comments
 (0)