Skip to content
Open
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
7 changes: 5 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ VERSION ?= $(shell git describe --exact-match 2> /dev/null || \
RELEASE_VERSION ?= $(shell cat ./version/version.go | grep "Version =" | awk '{ print $$3}' | tr -d '"')
PREVIOUS_VERSION := 3.23.0
LATEST_VERSION ?= latest
DESCRIPTION ?= "A Helm chart for the IBM Common Service Operator"

LOCAL_OS := $(shell uname)
ifeq ($(LOCAL_OS),Linux)
Expand Down Expand Up @@ -255,8 +256,10 @@ deploy-dryrun: manifests kustomize ## Deploy controller to the K8s cluster speci

.PHONY: helm
helm: deploy-dryrun kustohelmize
$(KUSTOHELMIZE) create --from=config/ibm-common-service-operator.yaml helm/ibm-common-service-operator
helm lint helm/ibm-common-service-operator
$(KUSTOHELMIZE) create --from=config/ibm-common-service-operator.yaml generate-helm/ibm-common-service-operator --version=$(RELEASE_VERSION) --app-version=$(RELEASE_VERSION) --description=$(DESCRIPTION)
helm lint generate-helm/ibm-common-service-operator
bash scripts/restructure_helm.sh
helm lint helm

KUBERNETES-SPLIT-YAML ?= $(LOCALBIN)/kubernetes-split-yaml
KUSTOHELMIZE ?= $(LOCALBIN)/kustohelmize
Expand Down
3 changes: 3 additions & 0 deletions config/ibm-common-service-operator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -696,6 +696,7 @@ spec:
app.kubernetes.io/instance: ibm-common-service-operator
app.kubernetes.io/managed-by: ibm-common-service-operator
app.kubernetes.io/name: ibm-common-service-operator
intent: projected
name: ibm-common-service-operator
productName: IBM_Cloud_Platform_Common_Services
spec:
Expand Down Expand Up @@ -768,6 +769,8 @@ spec:
runAsNonRoot: true
seccompProfile:
type: RuntimeDefault
imagePullSecrets:
- name: ibm-entitlement-key
serviceAccountName: ibm-common-service-operator
terminationGracePeriodSeconds: 10
---
Expand Down
3 changes: 3 additions & 0 deletions config/manager/manager.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ spec:
app.kubernetes.io/managed-by: "ibm-common-service-operator"
app.kubernetes.io/name: "ibm-common-service-operator"
productName: IBM_Cloud_Platform_Common_Services
intent: projected
annotations:
productName: "IBM Cloud Platform Common Services"
productID: "068a62892a1e4db39641342e592daa25"
Expand Down Expand Up @@ -98,4 +99,6 @@ spec:
privileged: false
readOnlyRootFilesystem: true
runAsNonRoot: true
imagePullSecrets:
- name: ibm-entitlement-key
terminationGracePeriodSeconds: 10
52 changes: 52 additions & 0 deletions generate-helm/ibm-common-service-operator.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
logger: {}
chartname: ibm-common-service-operator
sharedValues:
imagePullPrefix: icr.io
imagePullSecret: ibm-entitlement-key
imageRegistryNamespaceOperand: cpopen/cpfs
imageRegistryNamespaceOperator: cpopen
operatorImage: ibm-common-service-operator
operatorNamespace: operators
servicesNamespace: service
operatorVersion: latest
globalConfig:
metadata.labels:
- strategy: newline
key: ibm-common-service-operator.labels
metadata.name:
- strategy: inline
key: ibm-common-service-operator.fullname
metadata.namespace:
- strategy: inline
key: sharedValues.operatorNamespace
fileConfig:
generate-helm/ibm-common-service-operator-generated/commonservices.operator.ibm.com-crd.yaml: {}
generate-helm/ibm-common-service-operator-generated/ibm-common-service-operator-cr.yaml: {}
generate-helm/ibm-common-service-operator-generated/ibm-common-service-operator-crb.yaml:
subjects[0].namespace:
- strategy: inline
key: sharedValues.operatorNamespace
generate-helm/ibm-common-service-operator-generated/ibm-common-service-operator-deployment.yaml:
spec.template.spec.imagePullSecrets[0].name:
- strategy: inline
key: sharedValues.imagePullSecret
spec.template.spec.containers[0].image:
- strategy: inline
key: sharedValues.imagePullPrefix
- strategy: inline
key: sharedValues.imageRegistryNamespaceOperator
- strategy: inline
key: sharedValues.operatorImage
- strategy: inline
key: sharedValues.operatorVersion
generate-helm/ibm-common-service-operator-generated/ibm-common-service-operator-rb.yaml:
subjects[0].namespace:
- strategy: inline
key: sharedValues.operatorNamespace
generate-helm/ibm-common-service-operator-generated/ibm-common-service-operator-role.yaml: {}
generate-helm/ibm-common-service-operator-generated/ibm-common-service-operator-sa.yaml: {}
generate-helm/ibm-common-service-operator-generated/mutating-webhook-configuration-mutatingwebhookconfiguration.yaml: {}
generate-helm/ibm-common-service-operator-generated/selfsigned-issuer-issuer.yaml: {}
generate-helm/ibm-common-service-operator-generated/serving-cert-certificate.yaml: {}
generate-helm/ibm-common-service-operator-generated/validating-webhook-configuration-validatingwebhookconfiguration.yaml: {}
generate-helm/ibm-common-service-operator-generated/webhook-service-svc.yaml: {}
26 changes: 22 additions & 4 deletions helm-cluster-scoped/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,24 @@
apiVersion: v2
name: ibm-common-service-operator
description: A Helm chart for ibm-common-service-operator
name: ibm-common-service-operator-cluster-scoped
description: A Helm chart for the IBM Common Service Operator

# A chart can be either an 'application' or a 'library' chart.
#
# Application charts are a collection of templates that can be packaged into versioned archives
# to be deployed.
#
# Library charts provide useful utilities or functions for the chart developer. They're included as
# a dependency of application charts to inject those utilities and functions into the rendering
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
type: application
version: 4.6.11
appVersion: 4.6.11

# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 4.11.0

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "4.11.0"
62 changes: 62 additions & 0 deletions helm-cluster-scoped/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "ibm-common-service-operator.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "ibm-common-service-operator.fullname" -}}
{{- if .Values.fullnameOverride }}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- $name := default .Chart.Name .Values.nameOverride }}
{{- if contains $name .Release.Name }}
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
{{- end }}
{{- end }}
{{- end }}

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

{{/*
Common labels
*/}}
{{- define "ibm-common-service-operator.labels" -}}
helm.sh/chart: {{ include "ibm-common-service-operator.chart" . }}
{{ include "ibm-common-service-operator.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}

{{/*
Selector labels
*/}}
{{- define "ibm-common-service-operator.selectorLabels" -}}
app.kubernetes.io/name: {{ include "ibm-common-service-operator.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}

{{/*
Create the name of the service account to use
*/}}
{{- define "ibm-common-service-operator.serviceAccountName" -}}
{{- if .Values.serviceAccount.create }}
{{- default (include "ibm-common-service-operator.fullname" .) .Values.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}
101 changes: 101 additions & 0 deletions helm-cluster-scoped/templates/cluster-rbac.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: {{ include "ibm-common-service-operator.fullname" . }}
labels:
{{- include "ibm-common-service-operator.labels" . | nindent 4 }}
roleRef:
kind: ClusterRole
apiGroup: rbac.authorization.k8s.io
name: ibm-common-service-operator
subjects:
- kind: ServiceAccount
name: ibm-common-service-operator
namespace: {{ .Values.operatorNamespace }}

---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: {{ include "ibm-common-service-operator.fullname" . }}
rules:
- apiGroups:
- ""
resourceNames:
- common-service-maps
resources:
- configmaps
verbs:
- delete
- update
- apiGroups:
- ""
resourceNames:
- cloud-native-postgresql-image-list
resources:
- configmaps
verbs:
- delete
- apiGroups:
- ""
resources:
- configmaps
verbs:
- create
- get
- list
- watch
- update
- apiGroups:
- ""
resources:
- secrets
verbs:
- get
- apiGroups:
- storage.k8s.io
resources:
- storageclasses
verbs:
- get
- list
- watch
- apiGroups:
- admissionregistration.k8s.io
resources:
- mutatingwebhookconfigurations
- validatingwebhookconfigurations
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- config.openshift.io
resources:
- infrastructures
verbs:
- get
- apiGroups:
- rbac.authorization.k8s.io
resources:
- clusterrolebindings
- clusterroles
verbs:
- create
- delete
- get
- list
- patch
- update
- watch

---
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ include "ibm-common-service-operator.fullname" . }}
namespace: {{ .Values.operatorNamespace }}
Empty file.
File renamed without changes.
26 changes: 18 additions & 8 deletions helm-cluster-scoped/values.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,22 @@
imagePullPrefix: icr.io
imagePullSecret: ibm-entitlement-key

# Note there are no leading or trailing /'s
imageRegistryNamespaceOperator: cpopen
imageRegistryNamespaceOperand: cpopen/cpfs

# other configuration you think you might need for your operator
# following are examples, not required:
operatorNamespace: ibm-common-services
imageRegistryNamespaceOperator: cpopen
operatorImage: ibm-common-service-operator
operatorNamespace: operators
operatorVersion: latest
servicesNamespace: service
operatorImage: ibm-common-service-operator

commonservicesOperatorIbmComCrd: {}
ibmCommonServiceOperatorCr: {}
ibmCommonServiceOperatorCrb: {}
ibmCommonServiceOperatorDeployment: {}
ibmCommonServiceOperatorRb: {}
ibmCommonServiceOperatorRole: {}
ibmCommonServiceOperatorSa: {}
mutatingWebhookConfigurationMutatingwebhookconfiguration: {}
selfsignedIssuerIssuer: {}
servingCertCertificate: {}
validatingWebhookConfigurationValidatingwebhookconfiguration: {}
webhookServiceSvc: {}

24 changes: 21 additions & 3 deletions helm/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,24 @@
apiVersion: v2
name: ibm-common-service-operator
description: A Helm chart for ibm-common-service-operator
description: A Helm chart for the IBM Common Service Operator

# A chart can be either an 'application' or a 'library' chart.
#
# Application charts are a collection of templates that can be packaged into versioned archives
# to be deployed.
#
# Library charts provide useful utilities or functions for the chart developer. They're included as
# a dependency of application charts to inject those utilities and functions into the rendering
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
type: application
version: 4.6.11
appVersion: 4.6.11

# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 4.11.0

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "4.11.0"
Loading