Skip to content

Commit

Permalink
use statefulset naming convention for migration pvc
Browse files Browse the repository at this point in the history
  • Loading branch information
Craig O'Donnell committed Mar 6, 2024
1 parent 2e41fef commit f83dc67
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 20 deletions.
27 changes: 9 additions & 18 deletions templates/kotsadm-statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -203,22 +203,13 @@ spec:
name: backup
- emptyDir: {}
name: tmp
{{ $kotsminio := lookup "apps/v1" "StatefulSet" .Release.Namespace "kotsadm-minio" }}
{{ $existingpvc := lookup "v1" "PersistentVolumeClaim" .Release.Namespace "kotsadmdata" }}
{{ if and (not $kotsminio) (not $existingpvc) }}
# if the migration occurred, the pvc will already exist
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: kotsadmdata
labels:
{{- include "admin-console.immutableLabels" . | nindent 4 }}
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 4Gi
{{ end }}
volumeClaimTemplates:
- metadata:
name: kotsadmdata
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 4Gi

4 changes: 2 additions & 2 deletions templates/migrate-s3-hook.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,13 @@ spec:
serviceAccountName: kotsadm
volumes:
- persistentVolumeClaim:
claimName: kotsadmdata
claimName: kotsadmdata-kotsadm-0
name: kotsadmdata
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: kotsadmdata
name: kotsadmdata-kotsadm-0
annotations:
helm.sh/hook: pre-upgrade
helm.sh/hook-weight: "0"
Expand Down

0 comments on commit f83dc67

Please sign in to comment.