Skip to content

Commit

Permalink
Merge pull request #27 from rh-mobb/rh-dbaas-operator
Browse files Browse the repository at this point in the history
add redhat dbaas operator
  • Loading branch information
paulczar authored Aug 1, 2022
2 parents 59de7e4 + 3bad6a1 commit 23ce835
Show file tree
Hide file tree
Showing 10 changed files with 184 additions and 0 deletions.
23 changes: 23 additions & 0 deletions charts/redhat-dbaas-operator/.helmignore
Original file line number Diff line number Diff line change
@@ -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/
8 changes: 8 additions & 0 deletions charts/redhat-dbaas-operator/Chart.yaml
Original file line number Diff line number Diff line change
@@ -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
32 changes: 32 additions & 0 deletions charts/redhat-dbaas-operator/README.md
Original file line number Diff line number Diff line change
@@ -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
```
21 changes: 21 additions & 0 deletions charts/redhat-dbaas-operator/files/operatorhub.yaml
Original file line number Diff line number Diff line change
@@ -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
Empty file.
62 changes: 62 additions & 0 deletions charts/redhat-dbaas-operator/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -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 }}
11 changes: 11 additions & 0 deletions charts/redhat-dbaas-operator/templates/catalogsource.yaml
Original file line number Diff line number Diff line change
@@ -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
8 changes: 8 additions & 0 deletions charts/redhat-dbaas-operator/templates/operatorgroup.yaml
Original file line number Diff line number Diff line change
@@ -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:
14 changes: 14 additions & 0 deletions charts/redhat-dbaas-operator/templates/subscription.yaml
Original file line number Diff line number Diff line change
@@ -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 }}
5 changes: 5 additions & 0 deletions charts/redhat-dbaas-operator/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
catalogSource:
image: quay.io/osd-addons/dbaas-operator-index@sha256:f7bd64974ab6c2d4e055fdd5de7939961db2306e28282350d34c9ddb85bbb50c

subscription:
startingCSV: dbaas-operator.v0.2.0

0 comments on commit 23ce835

Please sign in to comment.