diff --git a/charts/redhat-dbaas-operator/.helmignore b/charts/redhat-dbaas-operator/.helmignore new file mode 100644 index 0000000..0e8a0eb --- /dev/null +++ b/charts/redhat-dbaas-operator/.helmignore @@ -0,0 +1,23 @@ +# Patterns to ignore when building packages. +# This supports shell glob matching, relative path matching, and +# negation (prefixed with !). Only one pattern per line. +.DS_Store +# Common VCS dirs +.git/ +.gitignore +.bzr/ +.bzrignore +.hg/ +.hgignore +.svn/ +# Common backup files +*.swp +*.bak +*.tmp +*.orig +*~ +# Various IDEs +.project +.idea/ +*.tmproj +.vscode/ diff --git a/charts/redhat-dbaas-operator/Chart.yaml b/charts/redhat-dbaas-operator/Chart.yaml new file mode 100644 index 0000000..5af07e6 --- /dev/null +++ b/charts/redhat-dbaas-operator/Chart.yaml @@ -0,0 +1,8 @@ +apiVersion: v2 +name: redhat-dbaas-operator +description: A Helm chart for Kubernetes +type: application +version: 0.1.0 +home: "https://rh-mobb.github.io/helm-charts/" +maintainers: + - name: rh-mobb diff --git a/charts/redhat-dbaas-operator/README.md b/charts/redhat-dbaas-operator/README.md new file mode 100644 index 0000000..dff13fb --- /dev/null +++ b/charts/redhat-dbaas-operator/README.md @@ -0,0 +1,32 @@ +# Helm Chart to deploy the Red Hat DBAAS Operator + +This Helm chart will deploy the Red Hat DBAAS Operator. + +## Prerequisites + +* A ROSA 4.10 cluster +* Helm CLI + +## Prepare Environment + +1. Add the MOBB chart repository to your Helm + + ```bash + helm repo add mobb https://rh-mobb.github.io/helm-charts/ + ``` + +1. Update your repositories + + ```bash + helm repo update + ``` + +## Deploy the Helm Chart + + +1. Use helm to deploy the DBAAS Operator + + ```bash +helm upgrade --install -n redhat-dbaas-operator dbaas-operator \ + --create-namespace mobb/redhat-dbaas-operator + ``` diff --git a/charts/redhat-dbaas-operator/files/operatorhub.yaml b/charts/redhat-dbaas-operator/files/operatorhub.yaml new file mode 100644 index 0000000..f017ba2 --- /dev/null +++ b/charts/redhat-dbaas-operator/files/operatorhub.yaml @@ -0,0 +1,21 @@ +subscriptions: + - name: dbaas-operator + channel: alpha + installPlanApproval: Automatic + source: dbaas-operator + sourceNamespace: openshift-dbaas-operator + namespace: openshift-dbaas-operator + startingCSV: dbaas-operator.v0.2.0 + +operatorGroups: + - name: dbaas-operator-group + namespace: openshift-dbaas-operator + targetNamespace: ~ + +catalogSources: + - name: dbaas-operator + namespace: redhat-dbaas-operator + sourceType: grpc + image: quay.io/osd-addons/dbaas-operator-index@sha256:f7bd64974ab6c2d4e055fdd5de7939961db2306e28282350d34c9ddb85bbb50c + displayName: DBaaS Operator + publisher: Red Hat diff --git a/charts/redhat-dbaas-operator/templates/NOTES.txt b/charts/redhat-dbaas-operator/templates/NOTES.txt new file mode 100644 index 0000000..e69de29 diff --git a/charts/redhat-dbaas-operator/templates/_helpers.tpl b/charts/redhat-dbaas-operator/templates/_helpers.tpl new file mode 100644 index 0000000..1a7000e --- /dev/null +++ b/charts/redhat-dbaas-operator/templates/_helpers.tpl @@ -0,0 +1,62 @@ +{{/* +Expand the name of the chart. +*/}} +{{- define "redhat-dbaas-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 "redhat-dbaas-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 "redhat-dbaas-operator.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Common labels +*/}} +{{- define "redhat-dbaas-operator.labels" -}} +helm.sh/chart: {{ include "redhat-dbaas-operator.chart" . }} +{{ include "redhat-dbaas-operator.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "redhat-dbaas-operator.selectorLabels" -}} +app.kubernetes.io/name: {{ include "redhat-dbaas-operator.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} + +{{/* +Create the name of the service account to use +*/}} +{{- define "redhat-dbaas-operator.serviceAccountName" -}} +{{- if .Values.serviceAccount.create }} +{{- default (include "redhat-dbaas-operator.fullname" .) .Values.serviceAccount.name }} +{{- else }} +{{- default "default" .Values.serviceAccount.name }} +{{- end }} +{{- end }} diff --git a/charts/redhat-dbaas-operator/templates/catalogsource.yaml b/charts/redhat-dbaas-operator/templates/catalogsource.yaml new file mode 100644 index 0000000..4ed8479 --- /dev/null +++ b/charts/redhat-dbaas-operator/templates/catalogsource.yaml @@ -0,0 +1,11 @@ +apiVersion: operators.coreos.com/v1alpha1 +kind: CatalogSource +metadata: + name: {{ include "redhat-dbaas-operator.fullname" . }} + namespace: openshift-marketplace + labels: + {{- include "redhat-dbaas-operator.labels" . | nindent 4 }} +spec: + sourceType: grpc + image: {{ .Values.catalogSource.image }} + displayName: DBaaS Operator diff --git a/charts/redhat-dbaas-operator/templates/operatorgroup.yaml b/charts/redhat-dbaas-operator/templates/operatorgroup.yaml new file mode 100644 index 0000000..0be58cd --- /dev/null +++ b/charts/redhat-dbaas-operator/templates/operatorgroup.yaml @@ -0,0 +1,8 @@ +apiVersion: operators.coreos.com/v1 +kind: OperatorGroup +metadata: + # namespace: openshift-dbaas-operator + name: {{ include "redhat-dbaas-operator.fullname" . }} + labels: + {{- include "redhat-dbaas-operator.labels" . | nindent 4 }} +spec: diff --git a/charts/redhat-dbaas-operator/templates/subscription.yaml b/charts/redhat-dbaas-operator/templates/subscription.yaml new file mode 100644 index 0000000..9674c86 --- /dev/null +++ b/charts/redhat-dbaas-operator/templates/subscription.yaml @@ -0,0 +1,14 @@ +apiVersion: operators.coreos.com/v1alpha1 +kind: Subscription +metadata: + # namespace: openshift-dbaas-operator + name: {{ include "redhat-dbaas-operator.fullname" . }} + labels: + {{- include "redhat-dbaas-operator.labels" . | nindent 4 }} +spec: + channel: alpha + installPlanApproval: Automatic + name: dbaas-operator + source: {{ include "redhat-dbaas-operator.fullname" . }} + sourceNamespace: openshift-marketplace + startingCSV: {{ .Values.subscription.startingCSV }} diff --git a/charts/redhat-dbaas-operator/values.yaml b/charts/redhat-dbaas-operator/values.yaml new file mode 100644 index 0000000..35fa963 --- /dev/null +++ b/charts/redhat-dbaas-operator/values.yaml @@ -0,0 +1,5 @@ +catalogSource: + image: quay.io/osd-addons/dbaas-operator-index@sha256:f7bd64974ab6c2d4e055fdd5de7939961db2306e28282350d34c9ddb85bbb50c + +subscription: + startingCSV: dbaas-operator.v0.2.0