Skip to content

Commit

Permalink
RBAC bug fix and helm-charts update
Browse files Browse the repository at this point in the history
  • Loading branch information
abhishekdwivedi3060 committed Jan 27, 2025
1 parent f124d00 commit 1770b24
Show file tree
Hide file tree
Showing 11 changed files with 37 additions and 26 deletions.
1 change: 1 addition & 0 deletions config/rbac/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ rules:
- delete
- get
- list
- update
- watch
- apiGroups:
- ""
Expand Down
42 changes: 25 additions & 17 deletions helm-charts/aerospike-backup-service/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Aerospike Backup Service (Custom Resource) Helm Chart

A Helm chart for `AerospikeBackupService` custom resource to be used with the Aerospike Kubernetes Operator.
A Helm chart for `AerospikeBackupService` (ABS) custom resource to be used with the Aerospike Kubernetes Operator.

## Pre Requisites

Expand All @@ -18,9 +18,21 @@ helm repo update

### Deploy Aerospike Backup Service

#### Prepare the namespace

We recommend using one ABS deployment per Aerospike cluster.

Create the service account for the ABS in the namespace where Aerospike cluster is deployed

```sh
kubectl create serviceaccount aerospike-backup-service -n <namespace>
```

> Note: ServiceAccount name can be configured. Update the configured ServiceAccount in a ABS CR file to use a different service account name.
#### Install the chart

`<namespace>` used to install Aerospike backup service chart must be included in `watchNamespaces` value of
`<namespace>` used to install ABS chart must be included in `watchNamespaces` value of
aerospike-kubernetes-operator's `values.yaml`

```sh
Expand All @@ -38,22 +50,18 @@ helm install aerospike-backup-service aerospike/aerospike-backup-service \

## Configurations

| Name | Description | Default |
|------------------------------|-------------------------------------------------------------------------------|--------------------------------------|
| `image.repository` | Aerospike backup service container image repository | `aerospike/aerospike-backup-service` |
| `image.tag` | Aerospike backup service container image tag | `3.0.0` |
| `customLabels` | Custom labels to add on the AerospikeBackupService resource | `{}` (nil) |
| `serviceAccount.create` | Enable ServiceAccount creation for Aerospike backup service. | true |
| `serviceAccount.annotations` | ServiceAccount annotations | `{}` (nil) |
| `backupServiceConfig` | Aerospike backup service configuration | `{}` (nil) |
| `secrets` | Secrets to be mounted in the Aerospike Backup Service pod like aws creds etc. | `[]` (nil) |
| `resources` | Aerospike backup service pod resource requirements | `{}` (nil) |
| `service` | Kubernetes service configuration for Aerospike backup service | `{}` (nil) |

| Name | Description | Default |
|-----------------------|-------------------------------------------------------------------------------|--------------------------------------|
| `image.repository` | Aerospike backup service container image repository | `aerospike/aerospike-backup-service` |
| `image.tag` | Aerospike backup service container image tag | `3.0.0` |
| `customLabels` | Custom labels to add on the Aerospike backup service resource | `{}` (nil) |
| `backupServiceConfig` | Aerospike backup service configuration | `{}` (nil) |
| `secrets` | Secrets to be mounted in the Aerospike backup service pod like aws creds etc. | `[]` (nil) |
| `resources` | Aerospike backup service pod resource requirements | `{}` (nil) |
| `service` | Kubernetes service configuration for Aerospike backup service | `{}` (nil) |
| `podSpec` | Aerospike backup service pod configuration | `{}` (nil) |

### Configurations Explained

[//]: # (TODO: Update below link when the documentation is available.)
Refer
to [AerospikeBackupService Customer Resource Spec](https://docs.aerospike.com/cloud/kubernetes/operator/cluster-configuration-settings#spec)
to [AerospikeBackupService Customer Resource Spec](https://aerospike.com/docs/cloud/kubernetes/operator/backup-and-restore/backup-service-configuration#spec)
for details on above [configuration fields](#Configurations)
1 change: 0 additions & 1 deletion helm-charts/aerospike-backup-service/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ backupServiceConfig: {}
# backup-policies:
# test-policy:
# parallel: 3
# remove-files: KeepAll
# storage:
# local:
# local-storage:
Expand Down
4 changes: 1 addition & 3 deletions helm-charts/aerospike-backup/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,6 @@ helm install aerospike-backup aerospike/aerospike-backup \
| `onDemandBackups[*].delay` | Delay interval before starting the on-demand backup | |

### Configurations Explained

[//]: # (TODO: Update below link when the documentation is available.)
Refer
to [AerospikeBackup Customer Resource Spec](https://docs.aerospike.com/cloud/kubernetes/operator/cluster-configuration-settings#spec)
to [AerospikeBackup Customer Resource Spec](https://aerospike.com/docs/cloud/kubernetes/operator/backup-and-restore/backup-configuration#spec)
for details on above [configuration fields](#Configurations)
2 changes: 1 addition & 1 deletion helm-charts/aerospike-cluster/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,4 +116,4 @@ validationPolicy:
### Configurations Explained
Refer to [AerospikeCluster Customer Resource Spec](https://docs.aerospike.com/cloud/kubernetes/operator/cluster-configuration-settings#spec) for details on above [configuration fields](#Configurations)
Refer to [AerospikeCluster Customer Resource Spec](https://aerospike.com/docs/cloud/kubernetes/operator/configuration/Cluster-configuration-settings#spec) for details on above [configuration fields](#Configurations)
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ rules:
- get
- list
- watch
- update
- apiGroups:
- ""
resources:
Expand Down
4 changes: 1 addition & 3 deletions helm-charts/aerospike-restore/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,6 @@ helm install aerospike-restore aerospike/aerospike-restore \
| `pollingPeriod` | Polling period for restore operation status | `60s` |

### Configurations Explained

[//]: # (TODO: Update below link when the documentation is available.)
Refer
to [AerospikeRestore Customer Resource Spec](https://docs.aerospike.com/cloud/kubernetes/operator/cluster-configuration-settings#spec)
to [AerospikeRestore Customer Resource Spec](https://aerospike.com/docs/cloud/kubernetes/operator/backup-and-restore/restore-configuration#spec)
for details on above [configuration fields](#Configurations)
2 changes: 2 additions & 0 deletions internal/controller/backup-service/reconciler.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,8 @@ func (r *SingleBackupServiceReconciler) Reconcile() (result ctrl.Result, recErr
return ctrl.Result{}, err
}

r.Log.Info("Reconcile completed successfully")

return ctrl.Result{}, nil
}

Expand Down
2 changes: 2 additions & 0 deletions internal/controller/backup/reconciler.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@ func (r *SingleBackupReconciler) Reconcile() (result ctrl.Result, recErr error)
return reconcile.Result{}, err
}

r.Log.Info("Reconcile completed successfully")

return ctrl.Result{}, nil
}

Expand Down
2 changes: 1 addition & 1 deletion internal/controller/cluster/aerospikecluster_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ type RackState struct {
Size int
}

// +kubebuilder:rbac:groups=core,resources=pods,verbs=get;list;watch;delete
// +kubebuilder:rbac:groups=core,resources=pods,verbs=get;list;watch;delete;update
// +kubebuilder:rbac:groups=core,resources=pods/exec,verbs=create
// +kubebuilder:rbac:groups=core,resources=services,verbs=get;list;watch;create;update;patch;delete
// +kubebuilder:rbac:groups=core,resources=persistentvolumeclaims,verbs=get;list;watch;create;update;patch;delete
Expand Down
2 changes: 2 additions & 0 deletions internal/controller/restore/reconciler.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ func (r *SingleRestoreReconciler) Reconcile() (result ctrl.Result, recErr error)
r.Recorder.Eventf(r.aeroRestore, corev1.EventTypeNormal, "RestoreCompleted",
"Restore completed successfully %s/%s", r.aeroRestore.Namespace, r.aeroRestore.Name)

r.Log.Info("Reconcile completed successfully")

return ctrl.Result{}, nil
}

Expand Down

0 comments on commit 1770b24

Please sign in to comment.