Hi,
I’m new to Consul and trying to deploy in EKS. I followed the steps in the Deploy Consul on Amazon Elastic Kubernetes Service (EKS) | Consul | HashiCorp Developer
I encountered the errors below.
INFO] consul-server-connection-manager: trying to connect to a Consul server
2023-06-27T08:44:02.978Z [ERROR] consul-server-connection-manager: connection error: error=“failed to discover Consul server addresses: failed to resolve DNS name: consul-consul-server.consul.svc: lookup consul-consul-server.consul.svc on 172.20.0.10:53: no such host”
Please advise.
swbs90
June 28, 2023, 3:25am
2
hello !
As far as I know, the consul-server pod needs to be started first.
Can you share the describe result of the consul-server pod?
Hello,
The describe output of consul-server pod as below
NAME READY STATUS RESTARTS AGE
consul-consul-connect-injector-5b5fff949-zcfqx 0/1 Running 3 (34s ago) 3m42s
consul-consul-server-0 0/1 Pending 0 3m42s
consul-consul-webhook-cert-manager-6b656b46b8-9fk8v 1/1 Running 0 3m42s
thomas@Thomass-MacBook-Pro .aws % kubectl logs consul-consul-server-0 -n consul
thomas@Thomass-MacBook-Pro .aws % kubectl describe pod consul-consul-server-0 -n consul
Name: consul-consul-server-0
Namespace: consul
Priority: 0
Service Account: consul-consul-server
Node:
Labels: app=consul
chart=consul-helm
component=server
controller-revision-hash=consul-consul-server-7b66554f6d
hasDNS=true
release=consul
statefulset.kubernetes.io/pod-name=consul-consul-server-0
Annotations: consul.hashicorp.com/config-checksum: bffd1c49b39663cb715861e8ad09d3e20cf87074265b7dfc6267dfefe2d0ba7d
consul.hashicorp.com/connect-inject: false
Status: Pending
IP:
IPs:
Controlled By: StatefulSet/consul-consul-server
Containers:
consul:
Image: hashicorp/consul:1.14.0
Ports: 8500/TCP, 8502/TCP, 8301/TCP, 8301/UDP, 8302/TCP, 8302/UDP, 8300/TCP, 8600/TCP, 8600/UDP
Host Ports: 0/TCP, 0/TCP, 0/TCP, 0/UDP, 0/TCP, 0/UDP, 0/TCP, 0/TCP, 0/UDP
Command:
/bin/sh
-ec
cp /consul/config/extra-from-values.json /consul/extra-config/extra-from-values.json
[ -n "${HOST_IP}" ] && sed -Ei "s|HOST_IP|${HOST_IP?}|g" /consul/extra-config/extra-from-values.json
[ -n "${POD_IP}" ] && sed -Ei "s|POD_IP|${POD_IP?}|g" /consul/extra-config/extra-from-values.json
[ -n "${HOSTNAME}" ] && sed -Ei "s|HOSTNAME|${HOSTNAME?}|g" /consul/extra-config/extra-from-values.json
exec /usr/local/bin/docker-entrypoint.sh consul agent \
-advertise="${ADVERTISE_IP}" \
-config-dir=/consul/config \
-config-file=/consul/extra-config/extra-from-values.json
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:
ADVERTISE_IP: (v1:status.podIP)
HOST_IP: (v1:status.hostIP)
POD_IP: (v1:status.podIP)
CONSUL_DISABLE_PERM_MGMT: true
Mounts:
/consul/config from config (rw)
/consul/data from data-consul (rw)
/consul/extra-config from extra-config (rw)
/var/run/secrets/kubernetes.io/serviceaccount from kube-api-access-4q2r7 (ro)
Volumes:
data-consul:
Type: PersistentVolumeClaim (a reference to a PersistentVolumeClaim in the same namespace)
ClaimName: data-consul-consul-consul-server-0
ReadOnly: false
config:
Type: ConfigMap (a volume populated by a ConfigMap)
Name: consul-consul-server-config
Optional: false
extra-config:
Type: EmptyDir (a temporary directory that shares a pod’s lifetime)
Medium:
SizeLimit:
kube-api-access-4q2r7:
Type: Projected (a volume that contains injected data from multiple sources)
TokenExpirationSeconds: 3607
ConfigMapName: kube-root-ca.crt
ConfigMapOptional:
DownwardAPI: true
QoS Class: Guaranteed
Node-Selectors:
Tolerations: node.kubernetes.io/not-ready:NoExecute op=Exists for 300s
node.kubernetes.io/unreachable:NoExecute op=Exists for 300s
Events:
Hi,
I have attached the described pods for consul-server and consul connect in the attachments. Kindly review.
describe-consul-connect.txt (5.6 KB)
describe-consul-server.txt (4.3 KB)
Install Consul on Kubernetes with Helm | Consul | HashiCorp Developer