Skip to content

Commit

Permalink
Add backup and restore related resources in helm-chart
Browse files Browse the repository at this point in the history
  • Loading branch information
abhishekdwivedi3060 committed Oct 16, 2024
1 parent ea882fa commit bc8e5f6
Show file tree
Hide file tree
Showing 13 changed files with 315 additions and 5 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ The Operator supports the following capabilities:
* Configure persistent storage and resource allocation
* Standardize and validate configurations
* Cluster security management
* Aerospike cluster monitoring
* Backup and restore Aerospike clusters

## Building and quick start

Expand Down Expand Up @@ -82,8 +84,8 @@ operator using OLM.

### Install operator-sdk

Install operator-sdk version 1.28.0 using the
installation [guide](https://v1-28-x.sdk.operatorframework.io/docs/installation/)
Install operator-sdk version 1.36.0 using the
installation [guide](https://v1-36-x.sdk.operatorframework.io/docs/installation/)

### Build the bundle

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,8 @@ spec:
- Configure persistent storage and resource allocation
- Standardize and validate configurations
- Cluster security management
- Aerospike cluster monitoring
- Backup and restore Aerospike clusters
displayName: Aerospike Kubernetes Operator
icon:
- base64data: PHN2ZyB3aWR0aD0iMjUwMCIgaGVpZ2h0PSIyNTAwIiB2aWV3Qm94PSIwIDAgMjU2IDI1NiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiBwcmVzZXJ2ZUFzcGVjdFJhdGlvPSJ4TWlkWU1pZCI+PHBhdGggZD0iTTAgMGgyNTZ2MjU2SDBWMHoiIGZpbGw9IiNCMDI1MkEiLz48cGF0aCBkPSJNMTU2LjI5MyA5NS42MDVsLTczLjE2OSAzMi41OTQgNzMuMTcgMzIuODFWOTUuNjA1em0tOTIuMDMyIDM5Ljk3OWwtMTcuMDQ5LTcuMyAxNy4wNDktNy44ODIgMTQ0LjUyNy02NS4zNzZ2MTcuNDAzbC0zNy45MzIgMTYuODI0djc4LjExN2wzNy45MzIgMTd2MTYuNjA0TDY0LjI2IDEzNS41ODR6IiBmaWxsPSIjRkZGIi8+PC9zdmc+
Expand Down
2 changes: 1 addition & 1 deletion helm-charts/aerospike-backup-service/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ backupServiceConfig: {}
# test-policy:
# parallel: 3
# remove-files: KeepAll
# type: 1
# storage:
# local:
# path: /localStorage
Expand All @@ -42,6 +41,7 @@ backupServiceConfig: {}
# type: aws-s3
# path: "s3://test-bucket"
# s3-region: us-east-1
# s3-endpoint-override: ""
# s3-profile: default

## SecretMounts is the list of secret to be mounted in the backup service.
Expand Down
6 changes: 4 additions & 2 deletions helm-charts/aerospike-backup/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,17 @@ backupService: {}
## This config is used to trigger backups. It includes: aerospike-cluster, backup-routines
backupConfig: {}
# aerospike-cluster:
# aerospike-aerospikebackup-test-cluster: # Name format: <backup-namespace>-<backup-name>-<cluster-name>
# Name format: The name must begin with the prefix <backup-namespace>-<backup-name>
# aerospike-aerospikebackup-test-cluster:
# credentials:
# password: admin123
# user: admin
# seed-nodes:
# - host-name: aerocluster.aerospike.svc.cluster.local
# port: 3000
# backup-routines:
# aerospike-aerospikebackup-test-routine: # Name format: <backup-namespace>-<backup-name>-<routine-name>
# Name format: The name must begin with the prefix <backup-namespace>-<backup-name>
# aerospike-aerospikebackup-test-routine:
# backup-policy: test-policy
# interval-cron: "@daily"
# incr-interval-cron: "@hourly"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{{- if .Values.rbac.create }}
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: aerospike-operator-aerospikebackup-editor-role
labels:
app: {{ template "aerospike-kubernetes-operator.fullname" . }}
chart: {{ .Chart.Name }}
release: {{ .Release.Name }}
rules:
- apiGroups:
- asdb.aerospike.com
resources:
- aerospikebackups
verbs:
- create
- delete
- patch
- update
{{- end }}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{{- if .Values.rbac.create }}
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: aerospike-operator-aerospikebackup-viewer-role
labels:
app: {{ template "aerospike-kubernetes-operator.fullname" . }}
chart: {{ .Chart.Name }}
release: {{ .Release.Name }}
rules:
- apiGroups:
- asdb.aerospike.com
resources:
- aerospikebackups
verbs:
- get
- list
- watch
- apiGroups:
- asdb.aerospike.com
resources:
- aerospikebackups/status
verbs:
- get
{{- end }}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{{- if .Values.rbac.create }}
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: aerospike-operator-aerospikebackupservice-editor-role
labels:
app: {{ template "aerospike-kubernetes-operator.fullname" . }}
chart: {{ .Chart.Name }}
release: {{ .Release.Name }}
rules:
- apiGroups:
- asdb.aerospike.com
resources:
- aerospikebackupservices
verbs:
- create
- delete
- patch
- update
{{- end }}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{{- if .Values.rbac.create }}
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: aerospike-operator-aerospikebackupservice-viewer-role
labels:
app: {{ template "aerospike-kubernetes-operator.fullname" . }}
chart: {{ .Chart.Name }}
release: {{ .Release.Name }}
rules:
- apiGroups:
- asdb.aerospike.com
resources:
- aerospikebackupservices
verbs:
- get
- list
- watch
- apiGroups:
- asdb.aerospike.com
resources:
- aerospikebackupservices/status
verbs:
- get
{{- end }}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{{- if .Values.rbac.create }}
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: aerospike-operator-aerospikerestore-editor-role
labels:
app: {{ template "aerospike-kubernetes-operator.fullname" . }}
chart: {{ .Chart.Name }}
release: {{ .Release.Name }}
rules:
- apiGroups:
- asdb.aerospike.com
resources:
- aerospikerestores
verbs:
- create
- delete
- patch
- update
{{- end }}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{{- if .Values.rbac.create }}
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: aerospike-operator-aerospikerestore-viewer-role
labels:
app: {{ template "aerospike-kubernetes-operator.fullname" . }}
chart: {{ .Chart.Name }}
release: {{ .Release.Name }}
rules:
- apiGroups:
- asdb.aerospike.com
resources:
- aerospikerestores
verbs:
- get
- list
- watch
- apiGroups:
- asdb.aerospike.com
resources:
- aerospikerestores/status
verbs:
- get
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,17 @@ metadata:
chart: {{ .Chart.Name }}
release: {{ .Release.Name }}
rules:
- apiGroups:
- apps
resources:
- deployments
verbs:
- create
- delete
- get
- patch
- update
- watch
- apiGroups:
- apps
resources:
Expand All @@ -21,6 +32,58 @@ rules:
- patch
- update
- watch
- apiGroups:
- asdb.aerospike.com
resources:
- aerospikebackups
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- asdb.aerospike.com
resources:
- aerospikebackups/finalizers
verbs:
- update
- apiGroups:
- asdb.aerospike.com
resources:
- aerospikebackups/status
verbs:
- get
- patch
- update
- apiGroups:
- asdb.aerospike.com
resources:
- aerospikebackupservices
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- asdb.aerospike.com
resources:
- aerospikebackupservices/finalizers
verbs:
- update
- apiGroups:
- asdb.aerospike.com
resources:
- aerospikebackupservices/status
verbs:
- get
- patch
- update
- apiGroups:
- asdb.aerospike.com
resources:
Expand All @@ -47,6 +110,32 @@ rules:
- get
- patch
- update
- apiGroups:
- asdb.aerospike.com
resources:
- aerospikerestores
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- asdb.aerospike.com
resources:
- aerospikerestores/finalizers
verbs:
- update
- apiGroups:
- asdb.aerospike.com
resources:
- aerospikerestores/status
verbs:
- get
- patch
- update
- apiGroups:
- ""
resources:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,23 @@ webhooks:
resources:
- aerospikeclusters
sideEffects: None
- admissionReviewVersions:
- v1
clientConfig:
service:
name: aerospike-operator-webhook-service
namespace: {{ .Release.Namespace }}
path: /mutate-asdb-aerospike-com-v1beta1-aerospikerestore
failurePolicy: Fail
name: maerospikerestore.kb.io
rules:
- apiGroups:
- asdb.aerospike.com
apiVersions:
- v1beta1
operations:
- CREATE
- UPDATE
resources:
- aerospikerestores
sideEffects: None
Loading

0 comments on commit bc8e5f6

Please sign in to comment.