CyCoreSystems / etcd-petset

Kubernetes PetSet for etcdv3
0 stars 1 forks source link

PetSet: pod scheduling failures #2

Open xilanflower opened 7 years ago

xilanflower commented 7 years ago

i'm testing StatefulSet, after create manifast by kubectl:

root@SZX1000262423:/opt/pass# kubectl create -f etcd.yaml service "etcd" created secret "etcd" created statefulset "etcd" created

root@SZX1000262423:/opt/pass# kubectl get pods NAME READY STATUS RESTARTS AGE etcd-0 0/1 Pending 0 16s

pod scheduling keeps Pending, and i check pod describe:

`root@SZX1000262423:/opt/pass# kubectl describe pod Name: etcd-0 Namespace: default Node: / Labels: app=etcd Status: Pending IP:
Controllers: StatefulSet/etcd Containers: etcd: Image: 10.162.197.95:5000/cse/etcd:v3.1.0 Ports: 2380/TCP, 2379/TCP Volume Mounts: /data from data (rw) /var/run/secrets/kubernetes.io/serviceaccount from default-token-lt793 (ro) Environment Variables: POD_IP: (v1:status.podIP) POD_NS: default (v1:metadata.namespace) ETCD_NAME: etcd-0 (v1:metadata.name) ETCD_INITIAL_CLUSTER_TOKEN: <set to the key 'token' in secret 'etcd'> ETCD_DATA_DIR: /data/etcd ETCD_INITIAL_CLUSTER: etcd-0=http://etcd-0.etcd.$(POD_NS).svc.cluster.local:2380,etcd-1=http://etcd-1.etcd.$(POD_NS).svc.cluster.local:2380,etcd-2=http://etcd-2.etcd.$(POD_NS).svc.cluster.local:2380 ETCD_INITIAL_ADVERTISE_PEER_URLS: http://$(ETCD_NAME).etcd.$(POD_NS).svc.cluster.local:2380 ETCD_LISTEN_PEER_URLS: http://$(POD_IP):2380 ETCD_LISTEN_CLIENT_URLS: http://$(POD_IP):2379 ETCD_ADVERTISE_CLIENT_URLS: http://$(ETCD_NAME).etcd.$(POD_NS).svc.cluster.local:2379 Conditions: Type Status PodScheduled False Volumes: data: Type: PersistentVolumeClaim (a reference to a PersistentVolumeClaim in the same namespace) ClaimName: data-etcd-0 ReadOnly: false config: Type: EmptyDir (a temporary directory that shares a pod's lifetime) Medium: Memory default-token-lt793: Type: Secret (a volume populated by a Secret) SecretName: default-token-lt793 QoS Class: BestEffort Tolerations: Events: FirstSeen LastSeen Count From SubObjectPath Type Reason Message


55s 7s 4 {default-scheduler } Warning FailedScheduling [SchedulerPredicates failed due to PersistentVolumeClaim is not bound: "data-etcd-0", which is unexpected., SchedulerPredicates failed due to PersistentVolumeClaim is not bound: "data-etcd-0", which is unexpected., SchedulerPredicates failed due to PersistentVolumeClaim is not bound: "data-etcd-0", which is unexpected.] `

I don't know where i m doing wrong,here is my manifast:

`apiVersion: v1 kind: Service metadata: name: etcd labels: app: etcd spec: ports:


apiVersion: apps/v1beta1 kind: StatefulSet metadata: name: etcd spec: serviceName: etcd replicas: 3 template: metadata: labels: app: etcd spec: volumes:

Ulexus commented 7 years ago

Most likely, you do not have the storage class defined. When I wrote this example, StorageClasses were implicit; now they are required.

You'll need to create the appropriate StorageClass and then reference it in the annotaions