Skip to content

Commit

Permalink
DBAAS-21/24/25: allow DBaaSConn to bind to apps
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremyary committed May 3, 2021
1 parent e21f1d9 commit e7b5806
Show file tree
Hide file tree
Showing 18 changed files with 527 additions and 137 deletions.
9 changes: 9 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ endif

all: build

.PHONY: release
release: build generate bundle docker-build docker-push bundle-build bundle-push catalog-build catalog-push

##@ General
Expand Down Expand Up @@ -116,6 +117,14 @@ deploy: manifests kustomize ## Deploy controller to the K8s cluster specified in
undeploy: ## Undeploy controller from the K8s cluster specified in ~/.kube/config.
$(KUSTOMIZE) build config/default | kubectl delete -f -

.PHONY: catalog-update
catalog-update: catalog-remove catalog-apply

catalog-remove: ## remove the sample catalog source from the dbaas-olm namespace
oc delete catalogsource dbaas-operator -n dbaas-olm

catalog-apply: ## apply the sample catalog source to dbaas-olm namespace
oc apply -f config/samples/catalog-source.yaml

CONTROLLER_GEN = $(shell pwd)/bin/controller-gen
controller-gen: ## Download controller-gen locally if necessary.
Expand Down
9 changes: 7 additions & 2 deletions api/v1/dbaasconnection_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,13 @@ type DBaaSConnectionSpec struct {

// DBaaSConnectionStatus defines the observed state of DBaaSConnection
type DBaaSConnectionStatus struct {
// INSERT ADDITIONAL STATUS FIELD - define observed state of cluster
// Important: Run "make" to regenerate code after modifying this file

// DBConfigMap is the name of the ConfigMap containing the connection info
DBConfigMap string `json:"dbConfigMap"`

//+kubebuilder:validation:Required
// DBCredentials is the name of the Secret containing the database credentials
DBCredentials string `json:"dbCredentials"`
}

//+kubebuilder:object:root=true
Expand Down
2 changes: 1 addition & 1 deletion bundle.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ LABEL operators.operatorframework.io.bundle.manifests.v1=manifests/
LABEL operators.operatorframework.io.bundle.metadata.v1=metadata/
LABEL operators.operatorframework.io.bundle.package.v1=dbaas-operator
LABEL operators.operatorframework.io.bundle.channels.v1=alpha
LABEL operators.operatorframework.io.metrics.project_layout=go.kubebuilder.io/v3
LABEL operators.operatorframework.io.metrics.mediatype.v1=metrics+v1
LABEL operators.operatorframework.io.metrics.builder=operator-sdk-v1.6.1+git
LABEL operators.operatorframework.io.metrics.project_layout=go.kubebuilder.io/v3

# Labels for testing.
LABEL operators.operatorframework.io.test.mediatype.v1=scorecard+v1
Expand Down
70 changes: 30 additions & 40 deletions bundle/manifests/dbaas-operator.clusterserviceversion.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,45 +27,12 @@ metadata:
"provider": {
"name": "MongoDB Atlas"
}
},
"status": {
"projects": [
{
"clusters": [
{
"cloudProvider": "TENANT",
"cloudRegion": "US_EAST_1",
"id": "6086aa1528fd4b5704aed738",
"instanceSizeName": "M0",
"name": "Cluster0"
}
],
"id": "6086aa084e995e38dfd1dd7e",
"name": "different project"
},
{
"clusters": [
{
"cloudProvider": "TENANT",
"cloudRegion": "US_EAST_1",
"id": "608484560795100e26a40caa",
"instanceSizeName": "M0",
"name": "Cluster0"
}
],
"id": "6084842759a7bd6d9b0ea0e8",
"name": "example project",
"users": [
{
"name": "dbExampleUser"
}
]
}
]
}
}
]
capabilities: Basic Install
categories: Database
description: Import provider cloud instances for easy coupling with developer applications.
operators.operatorframework.io/builder: operator-sdk-v1.6.1+git
operators.operatorframework.io/project_layout: go.kubebuilder.io/v3
name: dbaas-operator.v0.0.1
Expand All @@ -80,15 +47,38 @@ spec:
- kind: DBaaSService
name: dbaasservices.dbaas.redhat.com
version: v1
description: DBaaS Operator
displayName: DBaaS Operator
description: Import provider cloud instances for easy coupling with developer applications.
displayName: Database-as-a-Service Operator
icon:
- base64data: ""
mediatype: ""
- base64data: iVBORw0KGgoAAAANSUhEUgAAAH8AAAB/CAYAAADGvR0TAAABhGlDQ1BJQ0MgcHJvZmlsZQAAKJF9kT1Iw0AcxV9TiyIVBzuIOGSoT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o84Y2xKPAgXhFLeFHb2uNhXmDWCyM962wVvAFF+YZXcdOrqohl7W/N/HGfeoowoY6jPfw4LUiQdOA+qdsY8q6jFL7Ks68p87RL41rxQ6W7+oIx8o7GgRe4dPL6wHvgr8wOEgKvgB8Gpnbi/odB6xFQC6C/ijw0e3Er+ys9dWdEkSuaMAsUd8l5HvKEDsEd+l5DsKEFvEdzn5LRRgOuYBQ6LDWZds5/I7u7jrFvJbKMBozORBJxDUcVRZ+/jCSNxJFpFL4lvEAXIxQ48OwsdbmCn0hZG6jC5iHQJ85qsKmIJzGBQuHsWM1VdF8hbCbqkXtqaBCcB6nHyAc+Eo5rFsQXdcPdktvUFaHAfnWgtBB63xnDU+Bd1052j3XwtteYFpmNmlOQ7nlGJeh7PB180P7vauQD5gakLCBkvLl2Pml5+P8AMPArlTExK6nfioWP4ZvEAm8DtioTKo67Aa+AVw0BdFIWzRDcBSguGWJUzrwaRvAO4Hin02EMZWrSAsJehrzYG3A94eQHgAsz5+FbDbZyPBbNkHxFKCDGAO5lnB4BgkvRzzKpS1wCGfDQW0dROY6mYZhwN3Y4Y6020sciXmdWcrMMuiDZ+NhRWxYkYtFCEPmArMxR53BZdZc/kmzAsObU14TJJ/FkXIBK4ARljvl3XD47dbJO+w3g/GEuExT34bCnEpkAWMshaP2Zi35ExoZ1xDx4xGCsuqDwDbgH3Arlgl+kz4f3UfZ0Q/17GrAAAAAElFTkSuQmCC
mediatype: image/png
install:
spec:
clusterPermissions:
- rules:
- apiGroups:
- ""
resources:
- configmaps
- secrets
verbs:
- create
- delete
- get
- list
- update
- watch
- apiGroups:
- apps
resources:
- deployments
verbs:
- create
- delete
- get
- list
- update
- watch
- apiGroups:
- atlas.mongodb.com
resources:
Expand Down Expand Up @@ -272,7 +262,7 @@ spec:
keywords:
- dbaas
links:
- name: Dbaas Operator
- name: Database-as-a-Service Operator
url: https://dbaas-operator.domain
maturity: alpha
provider:
Expand Down
17 changes: 17 additions & 0 deletions bundle/manifests/dbaas.redhat.com_dbaasconnections.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@ kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.4.1
service.binding/db.host: path={.status.dbConfigMap},objectType=ConfigMap
service.binding/db.name: path={.status.dbConfigMap},objectType=ConfigMap
service.binding/db.password: path={.status.dbCredentials},objectType=Secret
service.binding/db.port: path={.status.dbConfigMap},objectType=ConfigMap
service.binding/db.user: path={.status.dbCredentials},objectType=Secret
service.binding/provider: path={.spec.provider}
service.binding/type: path={.spec.type}
creationTimestamp: null
name: dbaasconnections.dbaas.redhat.com
spec:
Expand Down Expand Up @@ -38,6 +45,16 @@ spec:
type: object
status:
description: DBaaSConnectionStatus defines the observed state of DBaaSConnection
properties:
dbConfigMap:
description: DBConfigMap is the name of the ConfigMap containing the connection info
type: string
dbCredentials:
description: DBCredentials is the name of the Secret containing the database credentials
type: string
required:
- dbConfigMap
- dbCredentials
type: object
type: object
served: true
Expand Down
2 changes: 1 addition & 1 deletion bundle/metadata/annotations.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ annotations:
operators.operatorframework.io.bundle.metadata.v1: metadata/
operators.operatorframework.io.bundle.package.v1: dbaas-operator
operators.operatorframework.io.bundle.channels.v1: alpha
operators.operatorframework.io.metrics.project_layout: go.kubebuilder.io/v3
operators.operatorframework.io.metrics.mediatype.v1: metrics+v1
operators.operatorframework.io.metrics.builder: operator-sdk-v1.6.1+git
operators.operatorframework.io.metrics.project_layout: go.kubebuilder.io/v3

# Annotations for testing.
operators.operatorframework.io.test.mediatype.v1: scorecard+v1
Expand Down
12 changes: 12 additions & 0 deletions config/crd/bases/dbaas.redhat.com_dbaasconnections.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,18 @@ spec:
type: object
status:
description: DBaaSConnectionStatus defines the observed state of DBaaSConnection
properties:
dbConfigMap:
description: DBConfigMap is the name of the ConfigMap containing the
connection info
type: string
dbCredentials:
description: DBCredentials is the name of the Secret containing the
database credentials
type: string
required:
- dbConfigMap
- dbCredentials
type: object
type: object
served: true
Expand Down
1 change: 1 addition & 0 deletions config/crd/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ resources:
#+kubebuilder:scaffold:crdkustomizeresource

patchesStrategicMerge:
- patches/service_binding_annotations.yaml
# [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix.
# patches here are for enabling the conversion webhook for each CRD
#- patches/webhook_in_dbaasservices.yaml
Expand Down
12 changes: 12 additions & 0 deletions config/crd/patches/service_binding_annotations.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: dbaasconnections.dbaas.redhat.com
annotations:
service.binding/type: 'path={.spec.type}'
service.binding/provider: 'path={.spec.provider}'
service.binding/db.name: 'path={.status.dbConfigMap},objectType=ConfigMap'
service.binding/db.host: 'path={.status.dbConfigMap},objectType=ConfigMap'
service.binding/db.port: 'path={.status.dbConfigMap},objectType=ConfigMap'
service.binding/db.user: 'path={.status.dbCredentials},objectType=Secret'
service.binding/db.password: 'path={.status.dbCredentials},objectType=Secret'
Loading

0 comments on commit e7b5806

Please sign in to comment.