I have a workload running on a kubernetes cluster with Istio. I can use TLS with the one shared certificate, but I can’t get credentialName
to work. Here are some relevant snippets from my Gateway
This works
tls:
mode: SIMPLE
privateKey: /etc/istio/ingressgateway-certs/tls.key
serverCertificate: /etc/istio/ingressgateway-certs/tls.crt
This fails
tls:
credentialName: api-termination-istio-tls-secret-autogen
mode: SIMPLE
My Istio Ingress gateway is running in the namespace istio-system
, and the secrets are in the same namespace (truncated output below).
[centos@k8s-master-0 ~]$ kubectl get pod -n istio-system
NAME READY STATUS RESTARTS AGE
...
istio-ingressgateway-7dd57888b8-68d4q 2/2 Running 0 16h
The above pod has the following description
[centos@k8s-master-0 ~]$ kubectl describe pod istio-ingressgateway-7dd57888b8-68d4q -n istio-system
Name: istio-ingressgateway-7dd57888b8-68d4q
Namespace: istio-system
Priority: 0
PriorityClassName: <none>
Node: high-memory-node-0/10.0.40.13
Start Time: Tue, 20 Aug 2019 20:28:40 +0000
Labels: app=istio-ingressgateway
chart=gateways
heritage=Tiller
istio=ingressgateway
pod-template-hash=7dd57888b8
release=istio
Annotations: sidecar.istio.io/inject: false
Status: Running
IP: 10.233.72.210
Controlled By: ReplicaSet/istio-ingressgateway-7dd57888b8
Containers:
istio-proxy:
Container ID: docker://7d4f6a94f7c2b24f3cb9734497e9ecb46085ee0c04d0f34eb1e0ef7761417386
Image: docker.io/istio/proxyv2:1.2.3
Image ID: docker-pullable://istio/proxyv2@sha256:6db6c0ae3f65d02edc97e7900e816c1139b6269182ffb17fa3843f036d17b264
Ports: 15020/TCP, 80/TCP, 443/TCP, 31400/TCP, 15029/TCP, 15030/TCP, 15031/TCP, 15032/TCP, 15443/TCP, 15090/TCP
Host Ports: 0/TCP, 0/TCP, 0/TCP, 0/TCP, 0/TCP, 0/TCP, 0/TCP, 0/TCP, 0/TCP, 0/TCP
Args:
proxy
router
--domain
$(POD_NAMESPACE).svc.cluster.local
--log_output_level=default:info
--drainDuration
45s
--parentShutdownDuration
1m0s
--connectTimeout
10s
--serviceCluster
istio-ingressgateway
--zipkinAddress
zipkin:9411
--proxyAdminPort
15000
--statusPort
15020
--controlPlaneAuthPolicy
NONE
--discoveryAddress
istio-pilot:15010
State: Running
Started: Tue, 20 Aug 2019 20:28:42 +0000
Ready: True
Restart Count: 0
Limits:
cpu: 2
memory: 1Gi
Requests:
cpu: 10m
memory: 40Mi
Readiness: http-get http://:15020/healthz/ready delay=1s timeout=1s period=2s #success=1 #failure=30
Environment:
NODE_NAME: (v1:spec.nodeName)
POD_NAME: istio-ingressgateway-7dd57888b8-68d4q (v1:metadata.name)
POD_NAMESPACE: istio-system (v1:metadata.namespace)
INSTANCE_IP: (v1:status.podIP)
HOST_IP: (v1:status.hostIP)
ISTIO_META_POD_NAME: istio-ingressgateway-7dd57888b8-68d4q (v1:metadata.name)
ISTIO_META_CONFIG_NAMESPACE: istio-system (v1:metadata.namespace)
ISTIO_META_ROUTER_MODE: sni-dnat
Mounts:
/etc/certs from istio-certs (ro)
/etc/istio/ingressgateway-ca-certs from ingressgateway-ca-certs (ro)
/etc/istio/ingressgateway-certs from ingressgateway-certs (ro)
/var/run/secrets/kubernetes.io/serviceaccount from istio-ingressgateway-service-account-token-rxrms (ro)
ingress-sds:
Container ID: docker://95f1a55d3fb83f0cfaba44951e2ef00ed479888cf29b0283c7c95b297abd917c
Image: gcr.io/istio-release/node-agent-k8s:master-latest-daily
Image ID: docker-pullable://gcr.io/istio-release/node-agent-k8s@sha256:a290b89c16ee17f233405a64618d94af425bdce70d468960dcc10d1ea1f589dc
Port: <none>
Host Port: <none>
State: Running
Started: Tue, 20 Aug 2019 20:28:46 +0000
Ready: True
Restart Count: 0
Limits:
cpu: 2
memory: 1Gi
Requests:
cpu: 100m
memory: 128Mi
Environment:
ENABLE_WORKLOAD_SDS: false
ENABLE_INGRESS_GATEWAY_SDS: true
INGRESS_GATEWAY_NAMESPACE: istio-system (v1:metadata.namespace)
Mounts:
/var/run/ingress_gateway from ingressgatewaysdsudspath (rw)
/var/run/secrets/kubernetes.io/serviceaccount from istio-ingressgateway-service-account-token-rxrms (ro)
Conditions:
Type Status
Initialized True
Ready True
ContainersReady True
PodScheduled True
Volumes:
ingressgatewaysdsudspath:
Type: EmptyDir (a temporary directory that shares a pod's lifetime)
Medium:
istio-certs:
Type: Secret (a volume populated by a Secret)
SecretName: istio.istio-ingressgateway-service-account
Optional: true
ingressgateway-certs:
Type: Secret (a volume populated by a Secret)
SecretName: istio-ingressgateway-certs
Optional: true
ingressgateway-ca-certs:
Type: Secret (a volume populated by a Secret)
SecretName: istio-ingressgateway-ca-certs
Optional: true
istio-ingressgateway-service-account-token-rxrms:
Type: Secret (a volume populated by a Secret)
SecretName: istio-ingressgateway-service-account-token-rxrms
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: <none>
And finally, a look at the secrets (truncated output):
[centos@k8s-master-0 ~]$ kubectl get secret -n istio-system
NAME TYPE DATA AGE
api-termination-istio-tls-secret-autogen kubernetes.io/tls 2 22h
default-token-q4vwd kubernetes.io/service-account-token 3 13d
istio-ca-secret istio.io/ca-root 5 13d
istio-ingressgateway-certs kubernetes.io/tls 2 12d
istio-ingressgateway-service-account-token-rxrms kubernetes.io/service-account-token 3 13d
istio.default istio.io/key-and-cert 3 13d
istio.istio-ingressgateway-service-account istio.io/key-and-cert 3 13d
I created the secrets istio-ingressgateway-certs
and api-termination-istio-tls-secret-autogen
.
Log output from the SDS container is
[centos@k8s-master-0 ~]$ kubectl logs istio-ingressgateway-7dd57888b8-68d4q -n istio-system ingress-sds
2019-08-20T20:28:46.959055Z info ControlZ available at 127.0.0.1:9876
2019-08-20T20:28:47.035608Z warn secretFetcherLog failed load server cert/key pair from secret kiali: server cert or private key is empty
2019-08-20T20:28:47.064675Z info sdsServiceLog SDS gRPC server for ingress gateway controller starts, listening on "/var/run/ingress_gateway/sds"
2019-08-20T20:28:47.064763Z info sdsServiceLog Start SDS grpc server for ingress gateway proxy
2019-08-20T20:28:47.064893Z info citadel agent monitor has started.
2019-08-20T20:28:47.065525Z info monitor Monitor server started.
The failed response looks like this
[centos@k8s-master-0 ~]$ curl -v https://api-termination-istio.dc.k8s.com/loginproxy
* About to connect() to api-termination-istio.dc.k8s.com port 443 (#0)
* Trying 192.168.24.239...
* Connected to api-termination-istio.dc.k8s.com (192.168.24.239) port 443 (#0)
* Initializing NSS with certpath: sql:/etc/pki/nssdb
* CAfile: /etc/pki/tls/certs/ca-bundle.crt
CApath: none
* NSS error -5938 (PR_END_OF_FILE_ERROR)
* Encountered end of file
* Closing connection 0
curl: (35) Encountered end of file
I’m not sure what the next steps are to troubleshoot this.