-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add GCP support and separate out plugin implementations
Signed-off-by: Danil Grigorev <danil.grigorev@suse.com>
- Loading branch information
1 parent
1afad01
commit 91e6fd3
Showing
19 changed files
with
750 additions
and
211 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
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,17 @@ | ||
apiVersion: addons.cluster.x-k8s.io/v1alpha1 | ||
kind: VeleroBackup | ||
metadata: | ||
labels: | ||
app.kubernetes.io/name: velerobackup | ||
app.kubernetes.io/instance: gcpbackup-sample | ||
app.kubernetes.io/part-of: cluster-api-addon-provider-velero | ||
app.kubernetes.io/managed-by: kustomize | ||
app.kubernetes.io/created-by: cluster-api-addon-provider-velero | ||
name: gcpbackup-sample | ||
namespace: creategitops-me7ee7 | ||
spec: | ||
installation: | ||
ref: | ||
kind: VeleroInstallation | ||
name: gcpinstallation-sample | ||
namespace: creategitops-me7ee7 |
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,24 @@ | ||
apiVersion: addons.cluster.x-k8s.io/v1alpha1 | ||
kind: VeleroInstallation | ||
metadata: | ||
labels: | ||
app.kubernetes.io/name: veleroinstallation | ||
app.kubernetes.io/instance: gcpinstallation-sample | ||
app.kubernetes.io/part-of: cluster-api-addon-provider-velero | ||
app.kubernetes.io/managed-by: kustomize | ||
app.kubernetes.io/created-by: cluster-api-addon-provider-velero | ||
name: gcpinstallation-sample | ||
namespace: creategitops-me7ee7 | ||
spec: | ||
bucket: dgrigore-bucket | ||
namespace: velero-gcp | ||
provider: | ||
gcp: | ||
credentialMap: | ||
namespaceName: | ||
name: gcp-credentials | ||
namespace: default | ||
state: | ||
deployNodeAgent: true | ||
cleanUpCRDs: true | ||
credentials: {} |
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,18 @@ | ||
apiVersion: addons.cluster.x-k8s.io/v1alpha1 | ||
kind: VeleroRestore | ||
metadata: | ||
labels: | ||
app.kubernetes.io/name: velerorestore | ||
app.kubernetes.io/instance: gcprestore-sample | ||
app.kubernetes.io/part-of: cluster-api-addon-provider-velero | ||
app.kubernetes.io/managed-by: kustomize | ||
app.kubernetes.io/created-by: cluster-api-addon-provider-velero | ||
name: gcprestore-sample | ||
namespace: creategitops-me7ee7 | ||
spec: | ||
backupName: gcpbackup-sample | ||
installation: | ||
ref: | ||
kind: VeleroInstallation | ||
name: gcpinstallation-sample | ||
namespace: creategitops-me7ee7 |
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,19 @@ | ||
apiVersion: addons.cluster.x-k8s.io/v1alpha1 | ||
kind: VeleroRestore | ||
metadata: | ||
labels: | ||
app.kubernetes.io/name: velerorestore | ||
app.kubernetes.io/instance: gcpschedule-sample | ||
app.kubernetes.io/part-of: cluster-api-addon-provider-velero | ||
app.kubernetes.io/managed-by: kustomize | ||
app.kubernetes.io/created-by: cluster-api-addon-provider-velero | ||
name: gcprestoreshedule-sample | ||
namespace: creategitops-me7ee7 | ||
spec: | ||
backupName: "" | ||
scheduleName: gcpschedule-sample | ||
installation: | ||
ref: | ||
kind: VeleroInstallation | ||
name: gcpinstallation-sample | ||
namespace: creategitops-me7ee7 |
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,19 @@ | ||
apiVersion: addons.cluster.x-k8s.io/v1alpha1 | ||
kind: VeleroSchedule | ||
metadata: | ||
labels: | ||
app.kubernetes.io/name: veleroschedule | ||
app.kubernetes.io/instance: gcpschedule-sample | ||
app.kubernetes.io/part-of: cluster-api-addon-provider-velero | ||
app.kubernetes.io/managed-by: kustomize | ||
app.kubernetes.io/created-by: cluster-api-addon-provider-velero | ||
name: gcpschedule-sample | ||
namespace: creategitops-me7ee7 | ||
spec: | ||
template: {} | ||
schedule: "* * * * *" | ||
installation: | ||
ref: | ||
kind: VeleroInstallation | ||
name: gcpinstallation-sample | ||
namespace: creategitops-me7ee7 |
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,46 @@ | ||
BUCKET=dgrigore-bucket | ||
gsutil mb gs://$BUCKET/ | ||
|
||
PROJECT_ID=$(gcloud config get-value project) | ||
GSA_NAME=velero-dgrigore | ||
gcloud iam service-accounts create $GSA_NAME \ | ||
--display-name "Velero service account dgrigore" | ||
|
||
SERVICE_ACCOUNT_EMAIL=$(gcloud iam service-accounts list \ | ||
--filter="displayName:Velero service account" \ | ||
--format 'value(email)') | ||
|
||
ROLE_PERMISSIONS=( | ||
compute.disks.get | ||
compute.disks.create | ||
compute.disks.createSnapshot | ||
compute.projects.get | ||
compute.snapshots.get | ||
compute.snapshots.create | ||
compute.snapshots.useReadOnly | ||
compute.snapshots.delete | ||
compute.zones.get | ||
storage.objects.create | ||
storage.objects.delete | ||
storage.objects.get | ||
storage.objects.list | ||
iam.serviceAccounts.signBlob | ||
) | ||
|
||
gcloud iam roles create dgrigorevelero.server \ | ||
--project $PROJECT_ID \ | ||
--title "Velero Server" \ | ||
--permissions "$(IFS=","; echo "${ROLE_PERMISSIONS[*]}")" | ||
|
||
gcloud projects add-iam-policy-binding $PROJECT_ID \ | ||
--member serviceAccount:$SERVICE_ACCOUNT_EMAIL \ | ||
--role projects/$PROJECT_ID/roles/dgrigorevelero.server | ||
|
||
gsutil iam ch serviceAccount:$SERVICE_ACCOUNT_EMAIL:objectAdmin gs://${BUCKET} | ||
|
||
gcloud iam service-accounts keys create credentials-velero \ | ||
--iam-account $SERVICE_ACCOUNT_EMAIL | ||
|
||
kubectl create secret generic -n default gcp-credentials --from-file=gcp=credentials-velero | ||
|
||
rm credentials-velero |
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
Oops, something went wrong.