-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Generate RBAC files using operator-sdk
Temporarily delete mariadbaccount sample files then run: operator-sdk create api --group mariadb --version v1beta1 --kind MariaDBAccount
- Loading branch information
Showing
9 changed files
with
155 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# The following patch adds a directive for certmanager to inject CA into the CRD | ||
apiVersion: apiextensions.k8s.io/v1 | ||
kind: CustomResourceDefinition | ||
metadata: | ||
annotations: | ||
cert-manager.io/inject-ca-from: $(CERTIFICATE_NAMESPACE)/$(CERTIFICATE_NAME) | ||
name: mariadbaccounts.mariadb.openstack.org |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# The following patch enables a conversion webhook for the CRD | ||
apiVersion: apiextensions.k8s.io/v1 | ||
kind: CustomResourceDefinition | ||
metadata: | ||
name: mariadbaccounts.mariadb.openstack.org | ||
spec: | ||
conversion: | ||
strategy: Webhook | ||
webhook: | ||
clientConfig: | ||
service: | ||
namespace: system | ||
name: webhook-service | ||
path: /convert | ||
conversionReviewVersions: | ||
- v1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# permissions for end users to edit mariadbaccounts. | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRole | ||
metadata: | ||
labels: | ||
app.kubernetes.io/name: clusterrole | ||
app.kubernetes.io/instance: mariadbaccount-editor-role | ||
app.kubernetes.io/component: rbac | ||
app.kubernetes.io/created-by: mariadb-operator | ||
app.kubernetes.io/part-of: mariadb-operator | ||
app.kubernetes.io/managed-by: kustomize | ||
name: mariadbaccount-editor-role | ||
rules: | ||
- apiGroups: | ||
- mariadb.openstack.org | ||
resources: | ||
- mariadbaccounts | ||
verbs: | ||
- create | ||
- delete | ||
- get | ||
- list | ||
- patch | ||
- update | ||
- watch | ||
- apiGroups: | ||
- mariadb.openstack.org | ||
resources: | ||
- mariadbaccounts/status | ||
verbs: | ||
- get |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# permissions for end users to view mariadbaccounts. | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRole | ||
metadata: | ||
labels: | ||
app.kubernetes.io/name: clusterrole | ||
app.kubernetes.io/instance: mariadbaccount-viewer-role | ||
app.kubernetes.io/component: rbac | ||
app.kubernetes.io/created-by: mariadb-operator | ||
app.kubernetes.io/part-of: mariadb-operator | ||
app.kubernetes.io/managed-by: kustomize | ||
name: mariadbaccount-viewer-role | ||
rules: | ||
- apiGroups: | ||
- mariadb.openstack.org | ||
resources: | ||
- mariadbaccounts | ||
verbs: | ||
- get | ||
- list | ||
- watch | ||
- apiGroups: | ||
- mariadb.openstack.org | ||
resources: | ||
- mariadbaccounts/status | ||
verbs: | ||
- get |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
apiVersion: mariadb.openstack.org/v1beta1 | ||
kind: Galera | ||
metadata: | ||
name: mikegalera | ||
spec: | ||
containerImage: quay.io/podified-antelope-centos9/openstack-mariadb:current-podified | ||
secret: osp-secret | ||
storageClass: local-storage | ||
storageRequest: 500M | ||
replicas: 3 | ||
|
||
--- | ||
|
||
apiVersion: mariadb.openstack.org/v1beta1 | ||
kind: MariaDBDatabase | ||
metadata: | ||
name: neutron | ||
labels: | ||
dbName: mikegalera | ||
spec: | ||
name: neutron | ||
secret: openstackdb-secret | ||
|
||
--- | ||
|
||
apiVersion: mariadb.openstack.org/v1beta1 | ||
kind: MariaDBAccount | ||
metadata: | ||
labels: | ||
mariaDBDatabaseName: neutron | ||
name: neutron1 | ||
spec: | ||
userName: neutron1 | ||
secret: neutrondb-secret | ||
|
||
--- | ||
|
||
apiVersion: v1 | ||
data: | ||
# 12345678 | ||
DatabasePassword: MTIzNDU2Nzg= | ||
kind: Secret | ||
metadata: | ||
name: openstackdb-secret | ||
type: Opaque | ||
|
||
--- | ||
|
||
apiVersion: v1 | ||
data: | ||
# neutron123 | ||
DatabasePassword: bmV1dHJvbjEyMw== | ||
kind: Secret | ||
metadata: | ||
name: neutrondb-secret | ||
type: Opaque | ||
|