StatefulSet doesn't play as nicely with hostPath so use deployment since it supports it without issue.
51 lines
1.3 KiB
YAML
51 lines
1.3 KiB
YAML
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: app
|
|
spec:
|
|
template:
|
|
spec:
|
|
affinity:
|
|
nodeAffinity:
|
|
preferredDuringSchedulingIgnoredDuringExecution:
|
|
- weight: 100
|
|
preference:
|
|
matchExpressions:
|
|
- key: kubernetes.io/hostname
|
|
operator: In
|
|
values:
|
|
- blackstaff
|
|
restartPolicy: Always
|
|
containers:
|
|
- name: minio
|
|
image: quay.io/minio/minio:latest
|
|
command:
|
|
- /bin/bash
|
|
- -c
|
|
args:
|
|
- minio server /data --console-address ":80"
|
|
env:
|
|
- name: MINIO_ROOT_PASSWORD
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: minio-secrets
|
|
key: ROOT_PASSWORD
|
|
optional: false
|
|
- name: MINIO_ROOT_USER
|
|
value: minio
|
|
volumeMounts:
|
|
- mountPath: /data
|
|
name: minio-data
|
|
subPath: "data"
|
|
ports:
|
|
- containerPort: 80
|
|
protocol: TCP
|
|
name: console
|
|
- containerPort: 9000
|
|
protocol: TCP
|
|
name: minio
|
|
volumes:
|
|
- name: minio-data
|
|
hostPath:
|
|
path: /data/minio
|
|
type: DirectoryOrCreate
|