apiVersion: v1
kind: Namespace
metadata:
name: spot-pcd-dev-resize
---
apiVersion: v1
kind: ConfigMap
metadata:
name: resize-pcd-config
namespace: spot-pcd-dev-resize
data:
# Script configuration (consumed by /app/entrypoint.sh)
NAMESPACES: "spot-test-du-arpit-*"
MIN_CPU_M: "25"
MIN_MEM_MI: "64"
RESIZE_MODE: "backup_resize"
CLUSTER_NAME: "spot-dev-10"
ALL_DEPLOYMENTS: "true"
ALL_STATEFULSETS: "true"
LABEL_KEY: "resize-pcd-success"
LABEL_VALUE: "true"
SKIP_IF_LABELED: "true"
BASE_DIR_ROOT: "/data"
# Optional debugging
PRINT_KUBECTL_CONTEXT: "true"
# Optional S3 upload (set S3_BUCKET non-empty to enable)
S3_BUCKET: "opencloud-dev-charts"
S3_PREFIX: "spot-pcd-resize"
---
apiVersion: v1
kind: Secret
metadata:
name: resize-pcd-aws
namespace: spot-pcd-dev-resize
type: Opaque
stringData:
# If you use IRSA / kube2iam, you can omit these keys.
AWS_ACCESS_KEY_ID: ""
AWS_SECRET_ACCESS_KEY: ""
AWS_DEFAULT_REGION: "us-east-1"
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: resize-pcd
namespace: spot-pcd-dev-resize
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: resize-pcd
rules:
- apiGroups: [""]
resources: ["namespaces"]
verbs: ["get", "list", "patch", "update"]
- apiGroups: [""]
resources: ["pods"]
verbs: ["get", "list"]
- apiGroups: ["apps"]
resources: ["deployments", "statefulsets", "replicasets"]
verbs: ["get", "list", "patch", "update"]
- apiGroups: ["metrics.k8s.io"]
resources: ["pods"]
verbs: ["get", "list"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: resize-pcd
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: resize-pcd
subjects:
- kind: ServiceAccount
name: resize-pcd
namespace: spot-pcd-dev-resize
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: resize-pcd-data
namespace: spot-pcd-dev-resize
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 10Gi
---
apiVersion: batch/v1
kind: CronJob
metadata:
name: resize-pcd
namespace: spot-pcd-dev-resize
spec:
schedule: "0 */ * * *"
concurrencyPolicy: Forbid
successfulJobsHistoryLimit: 1
failedJobsHistoryLimit: 3
jobTemplate:
spec:
template:
spec:
restartPolicy: Never
serviceAccountName: resize-pcd
containers:
- name: resize-pcd
image: arpitguptadockerhub/spot-pcd-resize:v3
imagePullPolicy: IfNotPresent
command: ["/bin/sh", "-lc", "/entrypoint.sh"]
envFrom:
- configMapRef:
name: resize-pcd-config
- secretRef:
name: resize-pcd-aws
volumeMounts:
- name: data
mountPath: /data
volumes:
- name: data
persistentVolumeClaim:
claimName: resize-pcd-data
Content type
Image
Digest
sha256:3affef77a…
Size
80.6 MB
Last updated
8 months ago
docker pull arpitguptadockerhub/spot-pcd-resize:v5