migrate
This commit is contained in:
9
clusters/cl01tl/helm/talos/Chart.lock
Normal file
9
clusters/cl01tl/helm/talos/Chart.lock
Normal file
@@ -0,0 +1,9 @@
|
||||
dependencies:
|
||||
- name: app-template
|
||||
repository: https://bjw-s-labs.github.io/helm-charts/
|
||||
version: 4.4.0
|
||||
- name: app-template
|
||||
repository: https://bjw-s-labs.github.io/helm-charts/
|
||||
version: 4.4.0
|
||||
digest: sha256:517cad1eb10278a33029c793bf00129f29e00998a3c4e97aabd7397736df7481
|
||||
generated: "2025-12-01T20:27:39.798695-06:00"
|
||||
26
clusters/cl01tl/helm/talos/Chart.yaml
Normal file
26
clusters/cl01tl/helm/talos/Chart.yaml
Normal file
@@ -0,0 +1,26 @@
|
||||
apiVersion: v2
|
||||
name: talos
|
||||
version: 1.0.0
|
||||
description: Talos
|
||||
keywords:
|
||||
- talos
|
||||
- etcd
|
||||
- kubernetes
|
||||
home: https://wiki.alexlebens.dev/s/c5ead573-34b6-442b-a286-7819e6e71f78
|
||||
sources:
|
||||
- https://github.com/siderolabs/talos-backup
|
||||
- https://github.com/siderolabs/talos-backup/pkgs/container/talos-backup
|
||||
- https://github.com/bjw-s-labs/helm-charts/tree/main/charts/other/app-template
|
||||
maintainers:
|
||||
- name: alexlebens
|
||||
dependencies:
|
||||
- name: app-template
|
||||
alias: etcd-backup
|
||||
repository: https://bjw-s-labs.github.io/helm-charts/
|
||||
version: 4.4.0
|
||||
- name: app-template
|
||||
alias: etcd-defrag
|
||||
repository: https://bjw-s-labs.github.io/helm-charts/
|
||||
version: 4.4.0
|
||||
icon: https://avatars.githubusercontent.com/u/13804887?s=200&v=4
|
||||
appVersion: v0.1.0-beta.3
|
||||
74
clusters/cl01tl/helm/talos/templates/external-secret.yaml
Normal file
74
clusters/cl01tl/helm/talos/templates/external-secret.yaml
Normal file
@@ -0,0 +1,74 @@
|
||||
apiVersion: external-secrets.io/v1
|
||||
kind: ExternalSecret
|
||||
metadata:
|
||||
name: talos-etcd-backup-secret
|
||||
namespace: {{ .Release.Namespace }}
|
||||
labels:
|
||||
app.kubernetes.io/name: talos-etcd-backup-secret
|
||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||
app.kubernetes.io/part-of: {{ .Release.Name }}
|
||||
annotations:
|
||||
kubernetes.io/service-account.name: talos-backup-secrets
|
||||
spec:
|
||||
secretStoreRef:
|
||||
kind: ClusterSecretStore
|
||||
name: vault
|
||||
data:
|
||||
- secretKey: AWS_ACCESS_KEY_ID
|
||||
remoteRef:
|
||||
conversionStrategy: Default
|
||||
decodingStrategy: None
|
||||
key: /digital-ocean/home-infra/etcd-backup
|
||||
metadataPolicy: None
|
||||
property: AWS_ACCESS_KEY_ID
|
||||
- secretKey: AWS_SECRET_ACCESS_KEY
|
||||
remoteRef:
|
||||
conversionStrategy: Default
|
||||
decodingStrategy: None
|
||||
key: /digital-ocean/home-infra/etcd-backup
|
||||
metadataPolicy: None
|
||||
property: AWS_SECRET_ACCESS_KEY
|
||||
- secretKey: .s3cfg
|
||||
remoteRef:
|
||||
conversionStrategy: Default
|
||||
decodingStrategy: None
|
||||
key: /digital-ocean/home-infra/etcd-backup
|
||||
metadataPolicy: None
|
||||
property: s3cfg
|
||||
- secretKey: BUCKET
|
||||
remoteRef:
|
||||
conversionStrategy: Default
|
||||
decodingStrategy: None
|
||||
key: /digital-ocean/home-infra/etcd-backup
|
||||
metadataPolicy: None
|
||||
property: BUCKET
|
||||
- secretKey: AGE_X25519_PUBLIC_KEY
|
||||
remoteRef:
|
||||
conversionStrategy: Default
|
||||
decodingStrategy: None
|
||||
key: /cl01tl/talos/etcd-backup
|
||||
metadataPolicy: None
|
||||
property: AGE_X25519_PUBLIC_KEY
|
||||
|
||||
---
|
||||
apiVersion: external-secrets.io/v1
|
||||
kind: ExternalSecret
|
||||
metadata:
|
||||
name: talos-etcd-defrag-secret
|
||||
namespace: {{ .Release.Namespace }}
|
||||
labels:
|
||||
app.kubernetes.io/name: talos-etcd-defrag-secret
|
||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||
app.kubernetes.io/part-of: {{ .Release.Name }}
|
||||
spec:
|
||||
secretStoreRef:
|
||||
kind: ClusterSecretStore
|
||||
name: vault
|
||||
data:
|
||||
- secretKey: config
|
||||
remoteRef:
|
||||
conversionStrategy: Default
|
||||
decodingStrategy: None
|
||||
key: /cl01tl/talos/etcd-defrag
|
||||
metadataPolicy: None
|
||||
property: config
|
||||
11
clusters/cl01tl/helm/talos/templates/secret.yaml
Normal file
11
clusters/cl01tl/helm/talos/templates/secret.yaml
Normal file
@@ -0,0 +1,11 @@
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: talos-backup-secrets
|
||||
namespace: {{ .Release.Namespace }}
|
||||
labels:
|
||||
app.kubernetes.io/name: talos-backup-secrets
|
||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||
app.kubernetes.io/part-of: {{ .Release.Name }}
|
||||
annotations:
|
||||
kubernetes.io/service-account.name: talos-backup-secrets
|
||||
12
clusters/cl01tl/helm/talos/templates/service-account.yaml
Normal file
12
clusters/cl01tl/helm/talos/templates/service-account.yaml
Normal file
@@ -0,0 +1,12 @@
|
||||
apiVersion: talos.dev/v1alpha1
|
||||
kind: ServiceAccount
|
||||
metadata:
|
||||
name: talos-backup-secrets
|
||||
namespace: {{ .Release.Namespace }}
|
||||
labels:
|
||||
app.kubernetes.io/name: talos-backup-secrets
|
||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||
app.kubernetes.io/part-of: {{ .Release.Name }}
|
||||
spec:
|
||||
roles:
|
||||
- os:etcd:backup
|
||||
293
clusters/cl01tl/helm/talos/values.yaml
Normal file
293
clusters/cl01tl/helm/talos/values.yaml
Normal file
@@ -0,0 +1,293 @@
|
||||
etcd-backup:
|
||||
controllers:
|
||||
main:
|
||||
type: cronjob
|
||||
pod:
|
||||
nodeSelector:
|
||||
node-role.kubernetes.io/control-plane: ""
|
||||
tolerations:
|
||||
- key: node-role.kubernetes.io/control-plane
|
||||
operator: Exists
|
||||
effect: NoSchedule
|
||||
cronjob:
|
||||
suspend: false
|
||||
concurrencyPolicy: Forbid
|
||||
timeZone: US/Central
|
||||
schedule: "0 2 * * *"
|
||||
startingDeadlineSeconds: 90
|
||||
successfulJobsHistory: 3
|
||||
failedJobsHistory: 3
|
||||
backoffLimit: 3
|
||||
parallelism: 1
|
||||
containers:
|
||||
main:
|
||||
image:
|
||||
repository: ghcr.io/siderolabs/talos-backup
|
||||
tag: v0.1.0-beta.3@sha256:05c86663b251a407551dc948097e32e163a345818117eb52c573b0447bd0c7a7
|
||||
pullPolicy: IfNotPresent
|
||||
command:
|
||||
- /talos-backup
|
||||
workingDir: /tmp
|
||||
securityContext:
|
||||
runAsUser: 1000
|
||||
runAsGroup: 1000
|
||||
allowPrivilegeEscalation: false
|
||||
runAsNonRoot: true
|
||||
capabilities:
|
||||
drop:
|
||||
- ALL
|
||||
seccompProfile:
|
||||
type: RuntimeDefault
|
||||
env:
|
||||
- name: AWS_ACCESS_KEY_ID
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: talos-etcd-backup-secret
|
||||
key: AWS_ACCESS_KEY_ID
|
||||
- name: AWS_SECRET_ACCESS_KEY
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: talos-etcd-backup-secret
|
||||
key: AWS_SECRET_ACCESS_KEY
|
||||
- name: AWS_REGION
|
||||
value: nyc3
|
||||
- name: CUSTOM_S3_ENDPOINT
|
||||
value: https://nyc3.digitaloceanspaces.com
|
||||
- name: BUCKET
|
||||
value: talos-backups-bee8585f7b8a4d0239c9b823
|
||||
- name: S3_PREFIX
|
||||
value: "cl01tl/etcd"
|
||||
- name: CLUSTER_NAME
|
||||
value: "cl01tl"
|
||||
- name: AGE_X25519_PUBLIC_KEY
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: talos-etcd-backup-secret
|
||||
key: AGE_X25519_PUBLIC_KEY
|
||||
- name: USE_PATH_STYLE
|
||||
value: "false"
|
||||
resources:
|
||||
requests:
|
||||
cpu: 100m
|
||||
memory: 128Mi
|
||||
s3-prune:
|
||||
image:
|
||||
repository: d3fk/s3cmd
|
||||
tag: latest@sha256:7bdbd33bb3d044884598898b9e9b383385759fbd6ebf52888700bd9b0e0fab91
|
||||
pullPolicy: IfNotPresent
|
||||
command:
|
||||
- /bin/sh
|
||||
args:
|
||||
- -ec
|
||||
- |
|
||||
export DATE_RANGE=$(date -d @$(( $(date +%s) - 1209600 )) +%Y-%m-%dT%H:%M:%SZ);
|
||||
export FILE_MATCH="$BUCKET/cl01tl/etcd/cl01tl-$DATE_RANGE.snap.age"
|
||||
echo ">> Running S3 prune for Talos backup repository"
|
||||
echo ">> Backups prior to '$DATE_RANGE' will be removed"
|
||||
echo ">> Backups to be removed:"
|
||||
s3cmd ls ${BUCKET}/cl01tl/etcd/ |
|
||||
awk -v file_match="$FILE_MATCH" '$4 < file_match {print $4}'
|
||||
echo ">> Deleting ..."
|
||||
s3cmd ls ${BUCKET}/cl01tl/etcd/ |
|
||||
awk -v file_match="$FILE_MATCH" '$4 < file_match {print $4}' |
|
||||
while read file; do
|
||||
s3cmd del "$file";
|
||||
done;
|
||||
echo ">> Completed S3 prune for Talos backup repository"
|
||||
env:
|
||||
- name: BUCKET
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: talos-etcd-backup-secret
|
||||
key: BUCKET
|
||||
resources:
|
||||
requests:
|
||||
cpu: 100m
|
||||
memory: 128Mi
|
||||
persistence:
|
||||
tmp:
|
||||
type: emptyDir
|
||||
medium: Memory
|
||||
advancedMounts:
|
||||
main:
|
||||
main:
|
||||
- path: /tmp
|
||||
readOnly: false
|
||||
talos:
|
||||
type: emptyDir
|
||||
medium: Memory
|
||||
advancedMounts:
|
||||
main:
|
||||
main:
|
||||
- path: /.talos
|
||||
readOnly: false
|
||||
secret:
|
||||
enabled: true
|
||||
type: secret
|
||||
name: talos-backup-secrets
|
||||
advancedMounts:
|
||||
main:
|
||||
main:
|
||||
- path: /var/run/secrets/talos.dev
|
||||
readOnly: true
|
||||
mountPropagation: None
|
||||
s3cmd-config:
|
||||
enabled: true
|
||||
type: secret
|
||||
name: talos-etcd-backup-secret
|
||||
advancedMounts:
|
||||
main:
|
||||
s3-prune:
|
||||
- path: /root/.s3cfg
|
||||
readOnly: true
|
||||
mountPropagation: None
|
||||
subPath: .s3cfg
|
||||
etcd-defrag:
|
||||
global:
|
||||
fullnameOverride: etcd-defrag
|
||||
controllers:
|
||||
defrag-1:
|
||||
type: cronjob
|
||||
pod:
|
||||
nodeSelector:
|
||||
node-role.kubernetes.io/control-plane: ""
|
||||
tolerations:
|
||||
- key: node-role.kubernetes.io/control-plane
|
||||
operator: Exists
|
||||
effect: NoSchedule
|
||||
cronjob:
|
||||
suspend: false
|
||||
concurrencyPolicy: Forbid
|
||||
timeZone: US/Central
|
||||
schedule: "0 0 * * 0"
|
||||
startingDeadlineSeconds: 90
|
||||
successfulJobsHistory: 3
|
||||
failedJobsHistory: 3
|
||||
backoffLimit: 3
|
||||
parallelism: 1
|
||||
containers:
|
||||
main:
|
||||
image:
|
||||
repository: ghcr.io/siderolabs/talosctl
|
||||
tag: v1.11.5
|
||||
pullPolicy: IfNotPresent
|
||||
args:
|
||||
- etcd
|
||||
- defrag
|
||||
- -n
|
||||
- "10.232.1.11"
|
||||
env:
|
||||
- name: TALOSCONFIG
|
||||
value: /tmp/.talos/config
|
||||
resources:
|
||||
requests:
|
||||
cpu: 100m
|
||||
memory: 128Mi
|
||||
defrag-2:
|
||||
type: cronjob
|
||||
pod:
|
||||
nodeSelector:
|
||||
node-role.kubernetes.io/control-plane: ""
|
||||
tolerations:
|
||||
- key: node-role.kubernetes.io/control-plane
|
||||
operator: Exists
|
||||
effect: NoSchedule
|
||||
cronjob:
|
||||
suspend: false
|
||||
concurrencyPolicy: Forbid
|
||||
timeZone: US/Central
|
||||
schedule: "10 0 * * 0"
|
||||
startingDeadlineSeconds: 90
|
||||
successfulJobsHistory: 3
|
||||
failedJobsHistory: 3
|
||||
backoffLimit: 3
|
||||
parallelism: 1
|
||||
containers:
|
||||
main:
|
||||
image:
|
||||
repository: ghcr.io/siderolabs/talosctl
|
||||
tag: v1.11.5
|
||||
pullPolicy: IfNotPresent
|
||||
args:
|
||||
- etcd
|
||||
- defrag
|
||||
- -n
|
||||
- "10.232.1.12"
|
||||
env:
|
||||
- name: TALOSCONFIG
|
||||
value: /tmp/.talos/config
|
||||
resources:
|
||||
requests:
|
||||
cpu: 100m
|
||||
memory: 128Mi
|
||||
defrag-3:
|
||||
type: cronjob
|
||||
pod:
|
||||
nodeSelector:
|
||||
node-role.kubernetes.io/control-plane: ""
|
||||
tolerations:
|
||||
- key: node-role.kubernetes.io/control-plane
|
||||
operator: Exists
|
||||
effect: NoSchedule
|
||||
cronjob:
|
||||
suspend: false
|
||||
concurrencyPolicy: Forbid
|
||||
timeZone: US/Central
|
||||
schedule: "20 0 * * 0"
|
||||
startingDeadlineSeconds: 90
|
||||
successfulJobsHistory: 3
|
||||
failedJobsHistory: 3
|
||||
backoffLimit: 3
|
||||
parallelism: 1
|
||||
containers:
|
||||
main:
|
||||
image:
|
||||
repository: ghcr.io/siderolabs/talosctl
|
||||
tag: v1.11.5
|
||||
pullPolicy: IfNotPresent
|
||||
args:
|
||||
- etcd
|
||||
- defrag
|
||||
- -n
|
||||
- "10.232.1.13"
|
||||
env:
|
||||
- name: TALOSCONFIG
|
||||
value: /tmp/.talos/config
|
||||
resources:
|
||||
requests:
|
||||
cpu: 100m
|
||||
memory: 128Mi
|
||||
persistence:
|
||||
talos-config-1:
|
||||
enabled: true
|
||||
type: secret
|
||||
name: talos-etcd-defrag-secret
|
||||
advancedMounts:
|
||||
defrag-1:
|
||||
main:
|
||||
- path: /tmp/.talos/config
|
||||
readOnly: true
|
||||
mountPropagation: None
|
||||
subPath: config
|
||||
talos-config-2:
|
||||
enabled: true
|
||||
type: secret
|
||||
name: talos-etcd-defrag-secret
|
||||
advancedMounts:
|
||||
defrag-2:
|
||||
main:
|
||||
- path: /tmp/.talos/config
|
||||
readOnly: true
|
||||
mountPropagation: None
|
||||
subPath: config
|
||||
talos-config-3:
|
||||
enabled: true
|
||||
type: secret
|
||||
name: talos-etcd-defrag-secret
|
||||
advancedMounts:
|
||||
defrag-3:
|
||||
main:
|
||||
- path: /tmp/.talos/config
|
||||
readOnly: true
|
||||
mountPropagation: None
|
||||
subPath: config
|
||||
Reference in New Issue
Block a user