Skip to content

Commit

Permalink
Fix statefulset to use the NodeSelector applied in spec (#313)
Browse files Browse the repository at this point in the history
Also cleanup example files to remove unused fields and
rearrange some fields based on actual spec.
  • Loading branch information
nitisht authored Sep 28, 2020
1 parent b5709d9 commit 3ed6df6
Show file tree
Hide file tree
Showing 3 changed files with 88 additions and 60 deletions.
73 changes: 44 additions & 29 deletions examples/tenant-encryption.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,12 @@ metadata:
prometheus.io/path: /minio/prometheus/metrics
prometheus.io/port: "9000"
prometheus.io/scrape: "true"

## If a scheduler is specified here, Tenant pods will be dispatched by specified scheduler.
## If not specified, the Tenant pods will be dispatched by default scheduler.
# scheduler:
# name: my-custom-scheduler

spec:
## Registry location and Tag to download MinIO Server image
image: minio/minio:RELEASE.2020-09-26T03-44-56Z
Expand All @@ -122,8 +124,10 @@ spec:
## For standalone mode, supply 1. For distributed mode, supply 4 or more.
## Note that the operator does not support upgrading from standalone to distributed mode.
- servers: 4
## volumesPerServer specifies the number of volumes attached per MinIO Tenant Pod / Server.

## volumesPerServer specifies the number of volumes attached per MinIO Tenant Pod / Server.
volumesPerServer: 4

## This VolumeClaimTemplate is used across all the volumes provisioned for MinIO Tenant in this
## Zone.
volumeClaimTemplate:
Expand All @@ -135,6 +139,43 @@ spec:
resources:
requests:
storage: 1Ti

## Used to specify a toleration for a pod
# tolerations:
# - effect: NoSchedule
# key: dedicated
# operator: Equal
# value: storage

## nodeSelector parameters for MinIO Pods. It specifies a map of key-value pairs. For the pod to be
## eligible to run on a node, the node must have each of the
## indicated key-value pairs as labels.
## Read more here: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/
# nodeSelector:
# disktype: ssd

## Affinity settings for MinIO pods. Read more about affinity
## here: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity.
# affinity:
# nodeAffinity:
# requiredDuringSchedulingIgnoredDuringExecution:
# nodeSelectorTerms:
# - matchExpressions:
# - key: kubernetes.io/hostname
# operator: In
# values:
# - hostname1
# - hostname2

## Configure resource requests and limits for MinIO containers
# resources:
# requests:
# cpu: 250m
# memory: 16Gi
# limits:
# cpu: 500m
# memory: 16Gi

## Mount path where PV will be mounted inside container(s).
mountPath: /export
## Sub path inside Mount path where MinIO stores data.
Expand Down Expand Up @@ -162,12 +203,6 @@ spec:
## Refer https://kubernetes.io/docs/tutorials/stateful-application/basic-stateful-set/#pod-management-policy
## for details.
podManagementPolicy: Parallel
## Used to specify a toleration for a pod
# tolerations:
# - effect: NoSchedule
# key: dedicated
# operator: Equal
# value: storage

## Add environment variables to be set in MinIO container (https://github.com/minio/minio/tree/master/docs/config)
# env:
Expand All @@ -176,15 +211,6 @@ spec:
# - name: MINIO_STORAGE_CLASS_STANDARD
# value: "EC:2"

## Configure resource requests and limits for MinIO containers
# resources:
# requests:
# cpu: 250m
# memory: 16Gi
# limits:
# cpu: 500m
# memory: 16Gi

## Liveness probe detects situations where MinIO tenant
## is not working properly and needs restart. Kubernetes automatically
## restarts the pods if liveness checks fail.
Expand All @@ -193,17 +219,6 @@ spec:
periodSeconds: 10
timeoutSeconds: 10

## nodeSelector parameters for MinIO Pods. It specifies a map of key-value pairs. For the pod to be
## eligible to run on a node, the node must have each of the
## indicated key-value pairs as labels.
## Read more here: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/
# nodeSelector:
# disktype: ssd

## Affinity settings for MinIO pods. Read more about affinity
## here: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity.
# affinity:

## PriorityClassName indicates the Pod priority and hence importance of a Pod relative to other Pods.
## This is applied to MinIO pods only.
## Refer Kubernetes documentation for details https://kubernetes.io/docs/concepts/configuration/pod-priority-preemption/#priorityclass/
Expand All @@ -212,15 +227,15 @@ spec:
## Define configuration for Console (Graphical user interface for MinIO)
## Refer https://github.com/minio/console
console:
image: minio/console:v0.3.17
image: minio/console:v0.3.26
replicas: 2
consoleSecret:
name: console-secret

## Define configuration for KES (stateless and distributed key-management system)
## Refer https://github.com/minio/kes
kes:
image: minio/kes:v0.11.0
image: minio/kes:v0.12.0
replicas: 2
kesSecret:
name: kes-config
Expand Down
74 changes: 43 additions & 31 deletions examples/tenant.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,12 @@ metadata:
prometheus.io/path: /minio/prometheus/metrics
prometheus.io/port: "9000"
prometheus.io/scrape: "true"

## If a scheduler is specified here, Tenant pods will be dispatched by specified scheduler.
## If not specified, the Tenant pods will be dispatched by default scheduler.
# scheduler:
# name: my-custom-scheduler

spec:
## Registry location and Tag to download MinIO Server image
image: minio/minio:RELEASE.2020-09-26T03-44-56Z
Expand All @@ -61,8 +63,10 @@ spec:
## For standalone mode, supply 1. For distributed mode, supply 4 or more.
## Note that the operator does not support upgrading from standalone to distributed mode.
- servers: 4
## volumesPerServer specifies the number of volumes attached per MinIO Tenant Pod / Server.

## volumesPerServer specifies the number of volumes attached per MinIO Tenant Pod / Server.
volumesPerServer: 4

## This VolumeClaimTemplate is used across all the volumes provisioned for MinIO Tenant in this
## Zone.
volumeClaimTemplate:
Expand All @@ -74,6 +78,43 @@ spec:
resources:
requests:
storage: 1Ti

## Used to specify a toleration for a pod
# tolerations:
# - effect: NoSchedule
# key: dedicated
# operator: Equal
# value: storage

## nodeSelector parameters for MinIO Pods. It specifies a map of key-value pairs. For the pod to be
## eligible to run on a node, the node must have each of the
## indicated key-value pairs as labels.
## Read more here: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/
# nodeSelector:
# disktype: ssd

## Affinity settings for MinIO pods. Read more about affinity
## here: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity.
# affinity:
# nodeAffinity:
# requiredDuringSchedulingIgnoredDuringExecution:
# nodeSelectorTerms:
# - matchExpressions:
# - key: kubernetes.io/hostname
# operator: In
# values:
# - hostname1
# - hostname2

## Configure resource requests and limits for MinIO containers
# resources:
# requests:
# cpu: 250m
# memory: 16Gi
# limits:
# cpu: 500m
# memory: 16Gi

## Mount path where PV will be mounted inside container(s).
mountPath: /export
## Sub path inside Mount path where MinIO stores data.
Expand Down Expand Up @@ -101,12 +142,6 @@ spec:
## Refer https://kubernetes.io/docs/tutorials/stateful-application/basic-stateful-set/#pod-management-policy
## for details.
podManagementPolicy: Parallel
## Used to specify a toleration for a pod
# tolerations:
# - effect: NoSchedule
# key: dedicated
# operator: Equal
# value: storage

## Add environment variables to be set in MinIO container (https://github.com/minio/minio/tree/master/docs/config)
# env:
Expand All @@ -115,15 +150,6 @@ spec:
# - name: MINIO_STORAGE_CLASS_STANDARD
# value: "EC:2"

## Configure resource requests and limits for MinIO containers
# resources:
# requests:
# cpu: 250m
# memory: 16Gi
# limits:
# cpu: 500m
# memory: 16Gi

## Liveness probe detects situations where MinIO tenant
## is not working properly and needs restart. Kubernetes automatically
## restarts the pods if liveness checks fail.
Expand All @@ -132,17 +158,6 @@ spec:
periodSeconds: 10
timeoutSeconds: 10

## nodeSelector parameters for MinIO Pods. It specifies a map of key-value pairs. For the pod to be
## eligible to run on a node, the node must have each of the
## indicated key-value pairs as labels.
## Read more here: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/
# nodeSelector:
# disktype: ssd

## Affinity settings for MinIO pods. Read more about affinity
## here: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity.
# affinity:

## PriorityClassName indicates the Pod priority and hence importance of a Pod relative to other Pods.
## This is applied to MinIO pods only.
## Refer Kubernetes documentation for details https://kubernetes.io/docs/concepts/configuration/pod-priority-preemption/#priorityclass/
Expand All @@ -151,10 +166,7 @@ spec:
## Define configuration for Console (Graphical user interface for MinIO)
## Refer https://github.com/minio/console
console:
image: minio/console:v0.3.17
image: minio/console:v0.3.26
replicas: 2
consoleSecret:
name: console-secret
metadata:
labels:
app: console
1 change: 1 addition & 0 deletions pkg/resources/statefulsets/minio-statefulset.go
Original file line number Diff line number Diff line change
Expand Up @@ -421,6 +421,7 @@ func NewForMinIOZone(t *miniov1.Tenant, wsSecret *v1.Secret, zone *miniov1.Zone,
Volumes: podVolumes,
RestartPolicy: corev1.RestartPolicyAlways,
Affinity: zone.Affinity,
NodeSelector: zone.NodeSelector,
SchedulerName: t.Scheduler.Name,
Tolerations: minioZoneTolerations(zone),
SecurityContext: minioSecurityContext(t),
Expand Down

0 comments on commit 3ed6df6

Please sign in to comment.