generated from onedr0p/cluster-template
-
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.
- Loading branch information
Showing
24 changed files
with
306 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
19 changes: 19 additions & 0 deletions
19
...rnetes/main/apps/security/external-secrets/stores/storage-secrets/clustersecretstore.yaml
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: external-secrets.io/v1beta1 | ||
kind: ClusterSecretStore | ||
metadata: | ||
name: storage-secrets-store | ||
spec: | ||
provider: | ||
kubernetes: | ||
remoteNamespace: storage | ||
auth: | ||
serviceAccount: | ||
name: storage-secrets-manager | ||
namespace: security | ||
server: | ||
caProvider: | ||
type: ConfigMap | ||
name: kube-root-ca.crt | ||
namespace: security | ||
key: ca.crt |
7 changes: 7 additions & 0 deletions
7
kubernetes/main/apps/security/external-secrets/stores/storage-secrets/kustomization.yaml
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 @@ | ||
--- | ||
# yaml-language-server: $schema=https://json.schemastore.org/kustomization | ||
apiVersion: kustomize.config.k8s.io/v1beta1 | ||
kind: Kustomization | ||
resources: | ||
- ./clustersecretstore.yaml | ||
- ./serviceaccount.yaml |
5 changes: 5 additions & 0 deletions
5
kubernetes/main/apps/security/external-secrets/stores/storage-secrets/serviceaccount.yaml
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,5 @@ | ||
--- | ||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
name: storage-secrets-manager |
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
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,21 @@ | ||
--- | ||
# yaml-language-server: $schema=https://raw.githubusercontent.com/fluxcd-community/flux2-schemas/main/kustomization-kustomize-v1.json | ||
apiVersion: kustomize.toolkit.fluxcd.io/v1 | ||
kind: Kustomization | ||
metadata: | ||
name: &app storage-secrets | ||
namespace: flux-system | ||
spec: | ||
targetNamespace: storage | ||
commonMetadata: | ||
labels: | ||
app.kubernetes.io/name: *app | ||
path: "./kubernetes/main/apps/storage/storage-secrets/rbac" | ||
prune: true | ||
sourceRef: | ||
kind: GitRepository | ||
name: home-ops | ||
wait: true | ||
interval: 30m | ||
retryInterval: 1m | ||
timeout: 5m |
7 changes: 7 additions & 0 deletions
7
kubernetes/main/apps/storage/storage-secrets/rbac/kustomization.yaml
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 @@ | ||
--- | ||
# yaml-language-server: $schema=https://json.schemastore.org/kustomization | ||
apiVersion: kustomize.config.k8s.io/v1beta1 | ||
kind: Kustomization | ||
resources: | ||
- ./role.yaml | ||
- ./rolebinding.yaml |
22 changes: 22 additions & 0 deletions
22
kubernetes/main/apps/storage/storage-secrets/rbac/role.yaml
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,22 @@ | ||
--- | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: Role | ||
metadata: | ||
name: storage-secrets-manager | ||
rules: | ||
- apiGroups: [""] | ||
resources: | ||
- secrets | ||
resourceNames: | ||
- minio-secret | ||
- volsync-secret | ||
verbs: | ||
- get | ||
- list | ||
- watch | ||
- apiGroups: | ||
- authorization.k8s.io | ||
resources: | ||
- selfsubjectrulesreviews | ||
verbs: | ||
- create |
13 changes: 13 additions & 0 deletions
13
kubernetes/main/apps/storage/storage-secrets/rbac/rolebinding.yaml
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,13 @@ | ||
--- | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: RoleBinding | ||
metadata: | ||
name: storage-secrets-manager-binding | ||
subjects: | ||
- kind: ServiceAccount | ||
name: storage-secrets-manager | ||
namespace: security | ||
roleRef: | ||
apiGroup: rbac.authorization.k8s.io | ||
kind: Role | ||
name: storage-secrets-manager |
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 @@ | ||
--- | ||
# yaml-language-server: $schema=https://kubernetes-schemas.pages.dev/helm.toolkit.fluxcd.io/helmrelease_v2beta2.json | ||
apiVersion: helm.toolkit.fluxcd.io/v2beta2 | ||
kind: HelmRelease | ||
metadata: | ||
name: volsync | ||
spec: | ||
interval: 30m | ||
chart: | ||
spec: | ||
chart: volsync | ||
version: 0.9.1 | ||
sourceRef: | ||
kind: HelmRepository | ||
name: backube | ||
namespace: flux-system | ||
install: | ||
remediation: | ||
retries: 3 | ||
upgrade: | ||
cleanupOnFail: true | ||
remediation: | ||
strategy: rollback | ||
retries: 3 | ||
dependsOn: | ||
- name: openebs | ||
- name: rook-ceph-cluster | ||
- name: snapshot-controller | ||
values: | ||
metrics: | ||
disableAuth: true |
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 @@ | ||
--- | ||
# yaml-language-server: $schema=https://json.schemastore.org/kustomization | ||
apiVersion: kustomize.config.k8s.io/v1beta1 | ||
kind: Kustomization | ||
resources: | ||
- ./helmrelease.yaml | ||
- ./secret.sops.yaml |
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,26 @@ | ||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
name: volsync-secret | ||
stringData: | ||
RESTIC_PASSWORD: ENC[AES256_GCM,data:OutPX3ZJDNcW4ZnSxeUj/47RBKf1bbkge/52H3xfTy3XO7n4BObuEHOqfEjITnxt0dpDM588a0bTclmB8MoDJQ==,iv:8RSryIOUNsLj6c9JlAYPyWSia87ojwqe12/CRUxXlas=,tag:YoidVddlHlXl4q7MOP9Ljw==,type:str] | ||
sops: | ||
kms: [] | ||
gcp_kms: [] | ||
azure_kv: [] | ||
hc_vault: [] | ||
age: | ||
- recipient: age1ve9kzacrwq7l9l0emvs326uk6t576d75r596e083r2tq6xu28qcsacy3s7 | ||
enc: | | ||
-----BEGIN AGE ENCRYPTED FILE----- | ||
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBVK1FDUE5ydDM2SzA0ZWFr | ||
ZElOb1JXUjA3Z0NIYW1wZnJvZjdXNC8zV0Y0CjRKbHpvVmtKRVIvRmF4V1dGY3ly | ||
SWpuc0RhcEdqcHpKcTZiNko5VG1LS2cKLS0tIFVvOERtQVF4ZFVTMk1MZ3A1QnFT | ||
RFN6U2lQU2Q3M0wwYmNuc0pLN1IzczQKwRAph52iWkz4M/qYBepyfe0OKZV9Qyje | ||
LglPEeuTwBc+sybPVtiXIcFzPfIcI03yPsvdFbTbn5eRJWBOA7t3JQ== | ||
-----END AGE ENCRYPTED FILE----- | ||
lastmodified: "2024-05-08T23:38:24Z" | ||
mac: ENC[AES256_GCM,data:+nKFQ0QKPg0MfztqzaR7TDqQDljTxhwZmu9MxaJHdMUbNgdaZEd6XQYdX/8HpsOPAk3rG4kkHWIV6BNg0AcNvMygnD0l60yavql697qyy0fZ+YnHdO2QrXKFRgAd9ZExQcmOoOu97vYMIAqK2TgStHe74ojxrf7H/7cbd8Uhcoc=,iv:bz0gnOfd02onDxJfIXL+MA9nTtL62p9Uy51BLIWqMtQ=,tag:k1Ny2QJRfwzTFXVlz5SnHA==,type:str] | ||
pgp: [] | ||
encrypted_regex: ^(data|stringData)$ | ||
version: 3.8.1 |
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,21 @@ | ||
--- | ||
# yaml-language-server: $schema=https://kubernetes-schemas.pages.dev/kustomize.toolkit.fluxcd.io/kustomization_v1.json | ||
apiVersion: kustomize.toolkit.fluxcd.io/v1 | ||
kind: Kustomization | ||
metadata: | ||
name: &app volsync | ||
namespace: flux-system | ||
spec: | ||
targetNamespace: storage | ||
commonMetadata: | ||
labels: | ||
app.kubernetes.io/name: *app | ||
path: ./kubernetes/main/apps/storage/volsync/app | ||
prune: true | ||
sourceRef: | ||
kind: GitRepository | ||
name: home-ops | ||
wait: false | ||
interval: 30m | ||
retryInterval: 1m | ||
timeout: 5m |
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,10 @@ | ||
--- | ||
# yaml-language-server: $schema=https://kubernetes-schemas.pages.dev/source.toolkit.fluxcd.io/helmrepository_v1beta2.json | ||
apiVersion: source.toolkit.fluxcd.io/v1beta2 | ||
kind: HelmRepository | ||
metadata: | ||
name: backube | ||
namespace: flux-system | ||
spec: | ||
interval: 1h | ||
url: https://backube.github.io/helm-charts/ |
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 @@ | ||
--- | ||
# yaml-language-server: $schema=https://json.schemastore.org/kustomization | ||
apiVersion: kustomize.config.k8s.io/v1beta1 | ||
kind: Kustomization | ||
resources: | ||
- ./minio | ||
- ./pvc.yaml |
25 changes: 25 additions & 0 deletions
25
kubernetes/main/templates/volsync/minio/externalsecret.yaml
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,25 @@ | ||
--- | ||
# yaml-language-server: $schema=https://raw.githubusercontent.com/datreeio/CRDs-catalog/main/external-secrets.io/externalsecret_v1beta1.json | ||
apiVersion: external-secrets.io/v1beta1 | ||
kind: ExternalSecret | ||
metadata: | ||
name: "${APP}-volsync-minio" | ||
spec: | ||
secretStoreRef: | ||
kind: ClusterSecretStore | ||
name: storage-secrets-store | ||
dataFrom: | ||
- extract: | ||
key: minio-secret | ||
- extract: | ||
key: volsync-secret | ||
target: | ||
name: "${APP}-volsync-minio" | ||
creationPolicy: Owner | ||
template: | ||
engineVersion: v2 | ||
data: | ||
RESTIC_REPOSITORY: "s3:s3.${STORAGE_DOMAIN}/${SECRET_CLUSTER_NAME}-volsync/${APP}" | ||
RESTIC_PASSWORD: "{{ .RESTIC_PASSWORD }}" | ||
AWS_ACCESS_KEY_ID: "{{ .MINIO_ROOT_USER }}" | ||
AWS_SECRET_ACCESS_KEY: "{{ .MINIO_ROOT_PASSWORD }}" |
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,8 @@ | ||
--- | ||
# yaml-language-server: $schema=https://json.schemastore.org/kustomization | ||
apiVersion: kustomize.config.k8s.io/v1beta1 | ||
kind: Kustomization | ||
resources: | ||
- ./externalsecret.yaml | ||
- ./replicationdestination.yaml | ||
- ./replicationsource.yaml |
24 changes: 24 additions & 0 deletions
24
kubernetes/main/templates/volsync/minio/replicationdestination.yaml
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 @@ | ||
--- | ||
# yaml-language-server: $schema=https://raw.githubusercontent.com/datreeio/CRDs-catalog/main/volsync.backube/replicationdestination_v1alpha1.json | ||
apiVersion: volsync.backube/v1alpha1 | ||
kind: ReplicationDestination | ||
metadata: | ||
name: "${APP}-bootstrap" | ||
spec: | ||
trigger: | ||
manual: restore-once | ||
restic: | ||
copyMethod: Snapshot | ||
repository: "${APP}-volsync-minio" | ||
cacheStorageClassName: "${VOLSYNC_CACHE_SNAPSHOTCLASS:-local-generic}" | ||
cacheAccessModes: ["${VOLSYNC_CACHE_ACCESSMODES:-ReadWriteOnce}"] | ||
cacheCapacity: "${VOLSYNC_CACHE_CAPACITY:-1Gi}" | ||
storageClassName: "${VOLSYNC_STORAGECLASS:-ceph-block}" | ||
volumeSnapshotClassName: "${VOLSYNC_SNAPSHOTCLASS:-csi-ceph-blockpool}" | ||
moverSecurityContext: | ||
runAsUser: ${APP_UID:-568} | ||
runAsGroup: ${APP_GID:-568} | ||
fsGroup: ${APP_GID:-568} | ||
accessModes: | ||
- "${VOLSYNC_ACCESSMODES:-ReadWriteOnce}" | ||
capacity: "${VOLSYNC_CAPACITY:-1Gi}" |
27 changes: 27 additions & 0 deletions
27
kubernetes/main/templates/volsync/minio/replicationsource.yaml
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 @@ | ||
--- | ||
# yaml-language-server: $schema=https://raw.githubusercontent.com/datreeio/CRDs-catalog/main/volsync.backube/replicationsource_v1alpha1.json | ||
apiVersion: volsync.backube/v1alpha1 | ||
kind: ReplicationSource | ||
metadata: | ||
name: "${APP}-backup-local" | ||
spec: | ||
sourcePVC: "${APP}" | ||
trigger: | ||
schedule: "0 * * * *" | ||
restic: | ||
copyMethod: Snapshot | ||
repository: ${APP}-volsync-minio | ||
cacheStorageClassName: "${VOLSYNC_CACHE_SNAPSHOTCLASS:-local-generic}" | ||
cacheAccessModes: ["${VOLSYNC_CACHE_ACCESSMODES:-ReadWriteOnce}"] | ||
cacheCapacity: "${VOLSYNC_CACHE_CAPACITY:-1Gi}" | ||
storageClassName: "${VOLSYNC_STORAGECLASS:-ceph-block}" | ||
volumeSnapshotClassName: "${VOLSYNC_SNAPSHOTCLASS:-csi-ceph-blockpool}" | ||
moverSecurityContext: | ||
runAsUser: ${APP_UID:-568} | ||
runAsGroup: ${APP_GID:-568} | ||
fsGroup: ${APP_GID:-568} | ||
pruneIntervalDays: 7 | ||
retain: | ||
hourly: 24 | ||
daily: 7 | ||
weekly: 5 |
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 @@ | ||
--- | ||
apiVersion: v1 | ||
kind: PersistentVolumeClaim | ||
metadata: | ||
name: "${APP}" | ||
spec: | ||
accessModes: | ||
- "${VOLSYNC_ACCESSMODES:-ReadWriteOnce}" | ||
dataSourceRef: | ||
kind: ReplicationDestination | ||
apiGroup: volsync.backube | ||
name: "${APP}-bootstrap" | ||
resources: | ||
requests: | ||
storage: "${VOLSYNC_CAPACITY:-1Gi}" | ||
storageClassName: "${VOLSYNC_STORAGECLASS:-ceph-block}" |
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