diff --git a/docs/troubleshooting.md b/docs/troubleshooting.md index 1707aa0e2..a8cf212b1 100644 --- a/docs/troubleshooting.md +++ b/docs/troubleshooting.md @@ -173,68 +173,47 @@ Verify with the following commands: ```console # start a container that contains curl -$ kubectl run test --image=tutum/curl -- sleep 10000 - -# check that container is running -$ kubectl get pods -NAME READY STATUS RESTARTS AGE -test-701078429-s5kca 1/1 Running 0 16s +$ kubectl run -it --rm test --image=curlimages/curl --restart=Never -- /bin/sh # check if secret exists -$ kubectl exec test-701078429-s5kca -- ls /var/run/secrets/kubernetes.io/serviceaccount/ -ca.crt -namespace -token - -# get service IP of master -$ kubectl get services -NAME CLUSTER-IP EXTERNAL-IP PORT(S) AGE -kubernetes 10.0.0.1 443/TCP 1d +/ $ ls /var/run/secrets/kubernetes.io/serviceaccount/ +ca.crt namespace token +/ $ # check base connectivity from cluster inside -$ kubectl exec test-701078429-s5kca -- curl -k https://10.0.0.1 -Unauthorized +/ $ curl -k https://kubernetes.default.svc.cluster.local +{ + "kind": "Status", + "apiVersion": "v1", + "metadata": { + + }, + "status": "Failure", + "message": "forbidden: User \"system:anonymous\" cannot get path \"/\"", + "reason": "Forbidden", + "details": { + + }, + "code": 403 +}/ $ # connect using tokens -$ TOKEN_VALUE=$(kubectl exec test-701078429-s5kca -- cat /var/run/secrets/kubernetes.io/serviceaccount/token) -$ echo $TOKEN_VALUE -eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3Mi....9A -$ kubectl exec test-701078429-s5kca -- curl --cacert /var/run/secrets/kubernetes.io/serviceaccount/ca.crt -H "Authorization: Bearer $TOKEN_VALUE" https://10.0.0.1 +}/ $ curl --cacert /var/run/secrets/kubernetes.io/serviceaccount/ca.crt -H "Authorization: Bearer $(cat /var/run/secrets/kubernetes.io/serviceaccount/token)" https://kubernetes.default.svc.cluster.local +&& echo { "paths": [ "/api", "/api/v1", "/apis", - "/apis/apps", - "/apis/apps/v1alpha1", - "/apis/authentication.k8s.io", - "/apis/authentication.k8s.io/v1beta1", - "/apis/authorization.k8s.io", - "/apis/authorization.k8s.io/v1beta1", - "/apis/autoscaling", - "/apis/autoscaling/v1", - "/apis/batch", - "/apis/batch/v1", - "/apis/batch/v2alpha1", - "/apis/certificates.k8s.io", - "/apis/certificates.k8s.io/v1alpha1", - "/apis/networking", - "/apis/networking/v1beta1", - "/apis/policy", - "/apis/policy/v1alpha1", - "/apis/rbac.authorization.k8s.io", - "/apis/rbac.authorization.k8s.io/v1alpha1", - "/apis/storage.k8s.io", - "/apis/storage.k8s.io/v1beta1", - "/healthz", - "/healthz/ping", - "/logs", - "/metrics", - "/swaggerapi/", - "/ui/", + "/apis/", + ... TRUNCATED + "/readyz/shutdown", "/version" ] } +/ $ + +# when you type `exit` or `^D` the test pod will be deleted. ``` If it is not working, there are two possible reasons: