Add watch on volumes for TLSContext
See original GitHub issueBackground/Summary
The TLSContext
allows for specifying the cert-chain, the ca-cert-chain, and the key for TLS. It only does this, however, when it is first initialized and does not update when the volumes change. This is most evident with Istio’s worker certificate rotation, where the /etc/istio-certs
volume is updated, but the TLSContext
is not.
Issue/Request
TLSContext
needs to update whenever the volumes it’s pointing at are changed.
Replicator
Kubernetes Cluster: Kubeception 1.17 Ambassador Version: 1.6.2 via Helm
- Follow the Istio how-to (excluding Prometheus and Distributed Tracing), but in the environment variables of the
istio-proxy
container, add
- name: SECRET_TTL
value: "0h5m0s"
-
wait 5 mins to see
2020-08-24T16:13:24.532920Z info sds resource:default pushed key/cert pair to proxy
inkubectl logs -n ambassador {{AMBASSADOR_POD}} -c istio-proxy
. -
try to get to a backend service in the mesh:
curl -v https://{{AMBASSADOR_HOST}}/backend/
< HTTP/1.1 503 Service Unavailable
< content-length: 91
< content-type: text/plain
< date: Mon, 24 Aug 2020 16:14:35 GMT
< server: envoy
<
* Connection #0 to host {{AMBASSADOR_HOST}} left intact
upstream connect error or disconnect/reset before headers. reset reason: connection failure* Closing connection 0
-
Restart the pod
kubectl rollout restart deploy -n ambassador ambassador
-
Try again
curl -v https://{{AMBASSADOR_HOST}}/backend/
< HTTP/1.1 200 OK
< content-type: application/json
< date: Mon, 24 Aug 2020 17:05:58 GMT
< content-length: 168
< x-envoy-upstream-service-time: 4
< server: envoy
< x-envoy-decorator-operation: quote.default.svc.cluster.local:80/*
<
{
"server": "quintessential-passionfruit-t11jxcdt",
"quote": "A principal idea is omnipresent, much like candy.",
"time": "2020-08-24T17:05:58.616336259Z"
* Connection #0 to host {{AMBASSADOR_HOST}} left intact
}* Closing connection 0
Issue Analytics
- State:
- Created 3 years ago
- Reactions:16
- Comments:9 (3 by maintainers)
Top GitHub Comments
I am facing the same issue. The certificate is renewed by Istio, but is not picked up by Ambassador.
I have tried setting
SECRET_TTL
to 5m and 24h (default), both fail until ambassador is restarted.By default Istio rotates certificates at half-time, but at most once every 5 minutes (all configurable).
This is interesting, that the secret does not get created. Is it just the internal cached k8s client value that Ambassador is able to use in the end? Seems like a weird undocumented behaviour if this is the case. My problem was, that I was looking for the actual secret in the namespace.