Je veux mettre en place un stockage persistant simple sur Kubernetes pour SQL 2019 Big Data on prem. Mais il y a toujours un événement 'pod has unbound immediate PersistentVolumeClaims'.
Lorsque je déploie l'image, le pod mssql-controller affiche un événement :
Name: mssql-controller-6vd8b
Namespace: sql2019
Priority: 0
PriorityClassName: <none>
Node: <none>
Labels: MSSQL_CLUSTER=sql2019
app=mssql-controller
Annotations: <none>
Status: Pending
IP:
Controlled By: ReplicaSet/mssql-controller
Containers:
mssql-controller:
Image: private-repo.microsoft.com/mssql-private-preview/mssql-controller:latest
Port: 8081/TCP
Host Port: 0/TCP
Environment:
ACCEPT_EULA: Y
CONTROLLER_ENABLE_TDS_PROXY: false
KUBERNETES_NAMESPACE: sql2019 (v1:metadata.namespace)
Mounts:
/root/secrets/controller-db from controller-db-secret (ro)
/root/secrets/controller-login from controller-login-secret (ro)
/root/secrets/knox from controller-knox-secret (ro)
/root/secrets/node-admin-login from node-admin-login-secret (ro)
/var/opt from controller-storage (rw)
/var/opt/controller/config from controller-config-volume (rw)
/var/run/secrets/kubernetes.io/serviceaccount from sa-mssql-controller-token-4fsbc (ro)
mssql-portal:
Image: private-repo.microsoft.com/mssql-private-preview/mssql-portal:latest
Port: 6001/TCP
Host Port: 0/TCP
Environment: <none>
Mounts:
/var/opt from controller-storage (rw)
/var/run/secrets/kubernetes.io/serviceaccount from sa-mssql-controller-token-4fsbc (ro)
mssql-server-controller:
Image: private-repo.microsoft.com/mssql-private-preview/mssql-server-controller:latest
Port: 1433/TCP
Host Port: 0/TCP
Environment:
ACCEPT_EULA: Y
SA_PASSWORD: <password removed>
Mounts:
/var/opt from controller-storage (rw)
/var/run/secrets/kubernetes.io/serviceaccount from sa-mssql-controller-token-4fsbc (ro)
mssql-monitor-fluentbit:
Image: private-repo.microsoft.com/mssql-private-preview/mssql-monitor-fluentbit:latest
Port: 2020/TCP
Host Port: 0/TCP
Limits:
memory: 100Mi
Requests:
cpu: 100m
memory: 100Mi
Environment:
FLUENT_ELASTICSEARCH_HOST: service-monitor-elasticsearch
FLUENT_ELASTICSEARCH_PORT: 9200
FLUENTBIT_CONFIG: fluentbit-controller.conf
KUBERNETES_NAMESPACE: sql2019 (v1:metadata.namespace)
KUBERNETES_NODE_NAME: (v1:spec.nodeName)
KUBERNETES_POD_NAME: mssql-controller-6vd8b (v1:metadata.name)
Mounts:
/var/opt from controller-storage (rw)
/var/run/secrets/kubernetes.io/serviceaccount from sa-mssql-controller-token-4fsbc (ro)
Conditions:
Type Status
PodScheduled False
Volumes:
controller-storage:
Type: PersistentVolumeClaim (a reference to a PersistentVolumeClaim in the same namespace)
ClaimName: mssql-controller-pvc
ReadOnly: false
controller-login-secret:
Type: Secret (a volume populated by a Secret)
SecretName: controller-login-secret
Optional: false
controller-db-secret:
Type: Secret (a volume populated by a Secret)
SecretName: controller-db-secret
Optional: false
controller-knox-secret:
Type: Secret (a volume populated by a Secret)
SecretName: controller-knox-secret
Optional: false
node-admin-login-secret:
Type: Secret (a volume populated by a Secret)
SecretName: node-admin-login-secret
Optional: false
controller-config-volume:
Type: ConfigMap (a volume populated by a ConfigMap)
Name: mssql-controller-config
Optional: false
sa-mssql-controller-token-4fsbc:
Type: Secret (a volume populated by a Secret)
SecretName: sa-mssql-controller-token-4fsbc
Optional: false
QoS Class: Burstable
Node-Selectors: <none>
Tolerations: node.kubernetes.io/not-ready:NoExecute for 300s
node.kubernetes.io/unreachable:NoExecute for 300s
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Warning FailedScheduling 1s (x6 over 4s) default-scheduler pod has unbound immediate PersistentVolumeClaims
Configuration de la grappe :
export USE_PERSISTENT_VOLUME=true
export STORAGE_CLASS_NAME=slow
StorageClass.yaml
kind: StorageClass
apiVersion: storage.k8s.io/v1
metadata:
name: slow
annotations:
storageclass.kubernetes.io/is-default-class: "true"
provisioner: kubernetes.io/gce-pd
parameters:
type: pd-standard
replication-type: none
Je suis assez novice en matière de Kubernetes, mais ce sont les choses que je connais :
- J'ai besoin du Dynamic Volume Provisioning
- Je dois créer une classe de stockage (SQL 2019 crée un volume persistant et une réclamation de volume persistant).