Open bartsmykla opened 3 years ago
Ok, so I started dividing this task into smaller ones:
/ready
endpoint when kuma-dp starts
localhost:{{ adminPort }}/ready
)ready
plugin, which will expose this endpoint
ready
plugin to this fileCorefile
template to include configuration for ready
plugin/ready
endpointready
pluginready
plugin to this file, which is being used when compiling our CoreDNS binary. This file could look like:prometheus:metrics
ready:ready
errors:errors
log:log
template:template
alternate:github.com/coredns/alternate
forward:forward
Corefile
template to include configuration for ready
plugin:const DefaultCoreFileTemplate = `.:{{ .CoreDNSPort }} {
forward . 127.0.0.1:{{ .EnvoyDNSPort }}
alternate NXDOMAIN,SERVFAIL,REFUSED . /etc/resolv.conf
prometheus localhost:{{ .PrometheusPort }}
errors
ready localhost:15399
}
.:{{ .CoreDNSEmptyPort }} {
template ANY ANY . {
rcode NXDOMAIN
}
}`
/ready
endpoint when kuma-dp starts/ready
endpoint, always responding with status 200
localhost:5699/ready
I came up with the port number when combining
56
which most of our ports are using as two initial numbers with99
which are two initial numbers of default envoy admin port (9901
) which currently exposes/ready
endpoint we are using in k8s as a readiness probe for wholekuma-sidecar
container, and we of course can pick different port instead
/ready
endpoint end return it's response as ours
http://localhost:{{ adminPort }}/ready
http://localhost:15399/ready
we hard-coded port and host in
Corefile
above, and path is hard-coded in the plugin itself, and cannot be changed
200
, our endpoint should return status code 503
kuma-dp run
flags:
--readiness-disabled
- when set the /ready
endpoint won't be exposed (default: false
)--readiness-host
- the host on which /ready
endpoint will be exposed (default: localhost
)--readiness-port
- the port on which /ready
endpoint will be listening on (default: 5699
)/ready
endpoint, we could also add /health
one
health
plugintbc.
This issue was inactive for 30 days it will be reviewed in the next triage meeting and might be closed. If you think this issue is still relevant please comment on it promptly or attend the next triage meeting.
This issue was inactive for 30 days it will be reviewed in the next triage meeting and might be closed. If you think this issue is still relevant please comment on it promptly or attend the next triage meeting.
This issue was inactive for 30 days it will be reviewed in the next triage meeting and might be closed. If you think this issue is still relevant please comment on it promptly or attend the next triage meeting.
This issue was inactive for 90 days. It will be reviewed in the next triage meeting and might be closed. If you think this issue is still relevant, please comment on it or attend the next triage meeting.
This issue was inactive for 90 days. It will be reviewed in the next triage meeting and might be closed. If you think this issue is still relevant, please comment on it or attend the next triage meeting.
This issue was inactive for 90 days. It will be reviewed in the next triage meeting and might be closed. If you think this issue is still relevant, please comment on it or attend the next triage meeting.
This issue was inactive for 90 days. It will be reviewed in the next triage meeting and might be closed. If you think this issue is still relevant, please comment on it or attend the next triage meeting.
This issue was inactive for 90 days. It will be reviewed in the next triage meeting and might be closed. If you think this issue is still relevant, please comment on it or attend the next triage meeting.
This issue was inactive for 90 days. It will be reviewed in the next triage meeting and might be closed. If you think this issue is still relevant, please comment on it or attend the next triage meeting.
This issue was inactive for 90 days. It will be reviewed in the next triage meeting and might be closed. If you think this issue is still relevant, please comment on it or attend the next triage meeting.
By adding this kuma.io/wait-for-dataplane-ready
annotation onto the pod, we'll make the app is only started after the kuma-sidecar
is ready. So the issue will be mitigated.
More on doc https://kuma.io/docs/2.8.x/reference/kubernetes-annotations/#kumaiowait-for-dataplane-ready
Summary
When working on confirmation that kuma works with websockets I faced an issue when my simple websocket client tried to connect to the server using our dns names (
server.default.svc.80.mesh
) and it was failing till I added some retries. I then realized that kuma-dp's dns server (coredns
) needs some time to start, so it should be taken into account.For kubernetes it looks like we are injecting
kuma-sidecar
and pointing to envoy's/ready
endpoint, so I assume we should introduce our own/ready
endpoint as a part of kuma-dp which would askenvoy
andcoredns
for readiness.For
coredns
we could use this plugin: https://coredns.io/plugins/ready/Steps To Reproduce
Deploy
kuma
Wait for
kuma
to be deployedAnnotate
default
namespace to automatically injectkuma-dp
sDeploy my simple websocket server
Deploy my simple websocket client
That's it, you can look into logs of the clent now
Additional Details & Logs
any version with kuma-dp dns server