hi jsosulskaďź
I have same issues from helm installed consulďźhelm install consul hashicorp/consul --set global.name=iocc-x-consul --set server.storageClass=consul-storage -n consul
Before install consul, I created SC and PV, PVC in k8s cluster(1 masterďź3 nodes)ďź
[root@master ~]# kubectl get pvc -n consul
NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS AGE
data-consul-iocc-x-consul-server-0 Bound data-consul-iocc-x-consul-server-2 10Gi RWO consul-storage 5h37m
data-consul-iocc-x-consul-server-1 Bound data-consul-iocc-x-consul-server-0 10Gi RWO consul-storage 5h37m
data-consul-iocc-x-consul-server-2 Bound data-consul-iocc-x-consul-server-1 10Gi RWO consul-storage 5h37m
[root@master ~]# kubectl get pv
NAME CAPACITY ACCESS MODES RECLAIM POLICY STATUS CLAIM STORAGECLASS REASON AGE
data-consul-iocc-x-consul-server-0 10Gi RWO Retain Bound consul/data-consul-iocc-x-consul-server-1 consul-storage 5h38m
data-consul-iocc-x-consul-server-1 10Gi RWO Retain Bound consul/data-consul-iocc-x-consul-server-2 consul-storage 5h38m
data-consul-iocc-x-consul-server-2 10Gi RWO Retain Bound consul/data-consul-iocc-x-consul-server-0 consul-storage
[root@master ~]# kubectl get pod -n consul
NAME READY STATUS RESTARTS AGE
iocc-x-consul-h5pz6 0/1 Running 0 5h37m
iocc-x-consul-server-0 0/1 Running 0 5h37m
iocc-x-consul-server-1 0/1 Running 0 5h37m
iocc-x-consul-server-2 0/1 Running 0 5h37m
iocc-x-consul-tjxmb 0/1 Running 0 5h37m
iocc-x-consul-w4g8n 0/1 Running 0 5h37m
iocc-x-consul-xc9gb 0/1 Running 0 5h37m
[root@master ~]# kubectl describe pod iocc-x-consul-server-0 -n consul
Name: iocc-x-consul-server-0
Namespace: consul
Priority: 0
Node: node3.iocc-test.com/9.112.160.52
Start Time: Thu, 02 Jul 2020 18:19:18 +0800
Labels: app=consul
chart=consul-helm
component=server
controller-revision-hash=iocc-x-consul-server-855cfb8db9
hasDNS=true
release=consul
statefulset.kubernetes.io/pod-name=iocc-x-consul-server-0
Annotations: consul.hashicorp.com/connect-inject: false
Status: Running
IP: 10.244.3.13
IPs:
IP: 10.244.3.13
Controlled By: StatefulSet/iocc-x-consul-server
Containers:
consul:
Container ID: docker://9a63e82d43bd8c15caa00f86c7457ac353e54f367abbd2bb5f49230f56f7d1d2
Image: consul:1.8.0
Image ID: docker-pullable://consul@sha256:0e660ca8ae28d864e3eaaed0e273b2f8cd348af207e2b715237e869d7a8b5dcc
Ports: 8500/TCP, 8301/TCP, 8302/TCP, 8300/TCP, 8600/TCP, 8600/UDP
Host Ports: 0/TCP, 0/TCP, 0/TCP, 0/TCP, 0/TCP, 0/UDP
Command:
/bin/sh
-ec
CONSUL_FULLNAME=âiocc-x-consulâ
exec /bin/consul agent \
-advertise="${POD_IP}" \
-bind=0.0.0.0 \
-bootstrap-expect=3 \
-client=0.0.0.0 \
-config-dir=/consul/config \
-datacenter=dc1 \
-data-dir=/consul/data \
-domain=consul \
-hcl="connect { enabled = true }" \
-ui \
-retry-join=${CONSUL_FULLNAME}-server-0.${CONSUL_FULLNAME}-server.${NAMESPACE}.svc \
-retry-join=${CONSUL_FULLNAME}-server-1.${CONSUL_FULLNAME}-server.${NAMESPACE}.svc \
-retry-join=${CONSUL_FULLNAME}-server-2.${CONSUL_FULLNAME}-server.${NAMESPACE}.svc \
-server
State: Running
Started: Thu, 02 Jul 2020 18:19:23 +0800
Ready: False
Restart Count: 0
Limits:
cpu: 100m
memory: 100Mi
Requests:
cpu: 100m
memory: 100Mi
Readiness: exec [/bin/sh -ec curl http://127.0.0.1:8500/v1/status/leader \
2>/dev/null | grep -E â".+"â
] delay=5s timeout=5s period=3s #success=1 #failure=2
Environment:
POD_IP: (v1:status.podIP)
NAMESPACE: consul (v1:metadata.namespace)
Mounts:
/consul/config from config (rw)
/consul/data from data-consul (rw)
/var/run/secrets/kubernetes.io/serviceaccount from iocc-x-consul-server-token-g9g2x (ro)
Conditions:
Type Status
Initialized True
Ready False
ContainersReady False
PodScheduled True
Volumes:
data-consul:
Type: PersistentVolumeClaim (a reference to a PersistentVolumeClaim in the same namespace)
ClaimName: data-consul-iocc-x-consul-server-0
ReadOnly: false
config:
Type: ConfigMap (a volume populated by a ConfigMap)
Name: iocc-x-consul-server-config
Optional: false
iocc-x-consul-server-token-g9g2x:
Type: Secret (a volume populated by a Secret)
SecretName: iocc-x-consul-server-token-g9g2x
Optional: false
QoS Class: Guaranteed
Node-Selectors:
Tolerations: node.kubernetes.io/not-ready:NoExecute for 300s
node.kubernetes.io/unreachable:NoExecute for 300s
Events:
Type Reason Age From Message
Warning Unhealthy 3m (x6699 over 5h37m) kubelet, node3.iocc-test.com Readiness probe failed:
[root@master ~]# kubectl logs iocc-x-consul-server-0 -n consul
bootstrap_expect > 0: expecting 3 servers
==> Starting Consul agentâŚ
Version: âv1.8.0â
Node ID: â3ac79701-c715-3b15-4b8e-b63bbd59b746â
Node name: âiocc-x-consul-server-0â
Datacenter: âdc1â (Segment: ââ)
Server: true (Bootstrap: false)
Client Addr: [0.0.0.0] (HTTP: 8500, HTTPS: -1, gRPC: -1, DNS: 8600)
Cluster Addr: 10.244.3.13 (LAN: 8301, WAN: 8302)
Encrypt: Gossip: false, TLS-Outgoing: false, TLS-Incoming: false, Auto-Encrypt-TLS: false
==> Log data will now stream in as it occurs:
2020-07-02T10:19:26.515Z [INFO] agent.server.raft: initial configuration: index=0 servers=[]
2020-07-02T10:19:26.516Z [INFO] agent.server.raft: entering follower state: follower="Node at 10.244.3.13:8300 [Follower]" leader=
2020-07-02T10:19:26.574Z [INFO] agent.server.serf.wan: serf: EventMemberJoin: iocc-x-consul-server-0.dc1 10.244.3.13
2020-07-02T10:19:26.576Z [INFO] agent.server.serf.lan: serf: EventMemberJoin: iocc-x-consul-server-0 10.244.3.13
2020-07-02T10:19:26.576Z [INFO] agent.server: Handled event for server in area: event=member-join server=iocc-x-consul-server-0.dc1 area=wan
2020-07-02T10:19:26.576Z [INFO] agent.server: Adding LAN server: server="iocc-x-consul-server-0 (Addr: tcp/10.244.3.13:8300) (DC: dc1)"
2020-07-02T10:19:26.577Z [INFO] agent: Started DNS server: address=0.0.0.0:8600 network=tcp
2020-07-02T10:19:26.577Z [INFO] agent: Started DNS server: address=0.0.0.0:8600 network=udp
2020-07-02T10:19:26.663Z [INFO] agent: Started HTTP server: address=[::]:8500 network=tcp
2020-07-02T10:19:26.669Z [INFO] agent: Retry join is supported for the following discovery methods: cluster=LAN discovery_methods="aliyun aws azure digitalocean gce k8s linode mdns os packet scaleway softlayer tencentcloud triton vsphere"
2020-07-02T10:19:26.669Z [INFO] agent: Joining cluster...: cluster=LAN
2020-07-02T10:19:26.669Z [INFO] agent: (LAN) joining: lan_addresses=[iocc-x-consul-server-0.iocc-x-consul-server.consul.svc, iocc-x-consul-server-1.iocc-x-consul-server.consul.svc, iocc-x-consul-server-2.iocc-x-consul-server.consul.svc]
2020-07-02T10:19:26.669Z [INFO] agent: started state syncer
==> Consul agent running!
2020-07-02T10:19:26.767Z [WARN] agent.server.memberlist.lan: memberlist: Failed to resolve iocc-x-consul-server-0.iocc-x-consul-server.consul.svc: lookup iocc-x-consul-server-0.iocc-x-consul-server.consul.svc on 10.96.0.10:53: no such host
2020-07-02T10:19:26.772Z [WARN] agent.server.memberlist.lan: memberlist: Failed to resolve iocc-x-consul-server-1.iocc-x-consul-server.consul.svc: lookup iocc-x-consul-server-1.iocc-x-consul-server.consul.svc on 10.96.0.10:53: no such host
2020-07-02T10:19:27.047Z [WARN] agent: (LAN) couldnât join: number_of_nodes=0 error="3 errors occurred:
* Failed to resolve iocc-x-consul-server-0.iocc-x-consul-server.consul.svc: lookup iocc-x-consul-server-0.iocc-x-consul-server.consul.svc on 10.96.0.10:53: no such host
* Failed to resolve iocc-x-consul-server-1.iocc-x-consul-server.consul.svc: lookup iocc-x-consul-server-1.iocc-x-consul-server.consul.svc on 10.96.0.10:53: no such host
* Failed to join 10.244.2.141: dial tcp 10.244.2.141:8301: connect: connection refused
"
2020-07-02T10:19:27.047Z [WARN] agent: Join cluster failed, will retry: cluster=LAN retry_interval=30s error=
2020-07-02T10:19:33.751Z [ERROR] agent.anti_entropy: failed to sync remote state: error=âNo cluster leaderâ
2020-07-02T10:19:34.446Z [WARN] agent.server.raft: no known peers, aborting election
2020-07-02T10:19:53.881Z [INFO] agent.server.serf.lan: serf: EventMemberJoin: node3.iocc-test.com 10.244.3.12
2020-07-02T10:19:54.063Z [INFO] agent.server.serf.wan: serf: EventMemberJoin: iocc-x-consul-server-1.dc1 10.244.1.131
2020-07-02T10:19:54.064Z [INFO] agent.server: Handled event for server in area: event=member-join server=iocc-x-consul-server-1.dc1 area=wan
2020-07-02T10:19:54.163Z [INFO] agent.server.serf.lan: serf: EventMemberJoin: node2.iocc-test.com 10.244.2.140
2020-07-02T10:19:54.263Z [INFO] agent.server.serf.lan: serf: EventMemberJoin: master.iocc-test.com 10.244.0.38
2020-07-02T10:19:54.263Z [INFO] agent.server.serf.lan: serf: EventMemberJoin: iocc-x-consul-server-1 10.244.1.131
2020-07-02T10:19:54.264Z [INFO] agent.server: Adding LAN server: server=âiocc-x-consul-server-1 (Addr: tcp/10.244.1.131:8300) (DC: dc1)â
2020-07-02T10:19:54.564Z [INFO] agent.server.serf.wan: serf: EventMemberJoin: iocc-x-consul-server-2.dc1 10.244.2.141
2020-07-02T10:19:54.564Z [INFO] agent.server.serf.lan: serf: EventMemberJoin: iocc-x-consul-server-2 10.244.2.141
2020-07-02T10:19:54.564Z [INFO] agent.server: Handled event for server in area: event=member-join server=iocc-x-consul-server-2.dc1 area=wan
2020-07-02T10:19:54.564Z [INFO] agent.server: Adding LAN server: server=âiocc-x-consul-server-2 (Addr: tcp/10.244.2.141:8300) (DC: dc1)â
2020-07-02T10:19:54.763Z [INFO] agent.server: Existing Raft peers reported by server, disabling bootstrap mode: server=iocc-x-consul-server-2
2020-07-02T10:19:54.896Z [INFO] agent.server.serf.lan: serf: EventMemberJoin: node1.iocc-test.com 10.244.1.130
2020-07-02T10:19:57.048Z [INFO] agent: (LAN) joining: lan_addresses=[iocc-x-consul-server-0.iocc-x-consul-server.consul.svc, iocc-x-consul-server-1.iocc-x-consul-server.consul.svc, iocc-x-consul-server-2.iocc-x-consul-server.consul.svc]
2020-07-02T10:19:57.532Z [INFO] agent: (LAN) joined: number_of_nodes=3
2020-07-02T10:19:57.532Z [INFO] agent: Join cluster completed. Synced with initial agents: cluster=LAN num_agents=3
2020-07-02T10:20:00.368Z [ERROR] agent: Coordinate update error: error=âNo cluster leaderâ
2020-07-02T10:20:06.163Z [ERROR] agent.anti_entropy: failed to sync remote state: error=âNo cluster leaderâ
2020-07-02T10:20:28.153Z [ERROR] agent: Coordinate update error: error=âNo cluster leaderâ
2020-07-02T10:20:36.214Z [ERROR] agent.anti_entropy: failed to sync remote state: error=âNo cluster leaderâ
2020-07-02T10:20:52.291Z [ERROR] agent: Coordinate update error: error=âNo cluster leaderâ
2020-07-02T10:21:04.196Z [ERROR] agent.anti_entropy: failed to sync remote state: error=âNo cluster leaderâ
2020-07-02T10:21:18.507Z [ERROR] agent: Coordinate update error: error=âNo cluster leaderâ
2020-07-02T10:21:39.368Z [ERROR] agent.anti_entropy: failed to sync remote state: error=âNo cluster leaderâ
2020-07-02T10:21:45.468Z [ERROR] agent: Coordinate update error: error=âNo cluster leaderâ
2020-07-02T10:22:10.447Z [ERROR] agent: Coordinate update error: error=âNo cluster leaderâ