I run the kube-apiserver with my self-signed certificate:
/opt/bin/kube-apiserver \
--etcd_servers=http://master:2379,http://slave1:2379,http://slave2:2379 \
--logtostderr=false \
--v=4 \
--client-ca-file=/home/kubernetes/ssl/ca.crt \
--service-cluster-ip-range=192.168.3.0/24 \
--tls-cert-file=/home/kubernetes/ssl/server.crt \
--tls-private-key-file=/home/kubernetes/ssl/server.key
Then I run the kubelet with the kubeconfig:
/opt/bin/kubelet \
--address=0.0.0.0 \
--port=10250 \
--api_servers=https://master:6443 \
--kubeconfig=/home/kubernetes/ssl/config.yaml \
--logtostderr=false \
--v=4
The content of the config.yaml is below:
apiVersion: v1
kind: Config
clusters:
- name: ubuntu
cluster:
insecure-skip-tls-verify: true
server: https://master:6443
contexts:
- context:
cluster: "ubuntu"
user: "ubuntu"
name: development
current-context: development
users:
- name: ubuntu
user:
client-certificate: /home/kubernetes/ssl/ca.crt
client-key: /home/kubernetes/ssl/ca.key
So, I thought the kubelet will not verify the self-signed certificate of apiserver, but the logs showed:
E1009 16:48:51.919749 100724 reflector.go:136] Failed to list *api.Pod: Get https://master:6443/api/v1/pods?fieldSelector=spec.nodeName%3Dslave1: x509: certificate signed by unknown authority
E1009 16:48:51.919876 100724 reflector.go:136] Failed to list *api.Node: Get https://master:6443/api/v1/nodes?fieldSelector=metadata.name%3Dslave1: x509: certificate signed by unknown authority
E1009 16:48:51.923153 100724 reflector.go:136] Failed to list *api.Service: Get https://master:6443/api/v1/services: x509: certificate signed by unknown authority
E1009 16:48:52.821556 100724 event.go:194] Unable to write event: 'Post https://master:6443/api/v1/namespaces/default/events: x509: certificate signed by unknown authority' (may retry after sleeping)
E1009 16:48:52.922414 100724 reflector.go:136] Failed to list *api.Node: Get https://master:6443/api/v1/nodes?fieldSelector=metadata.name%3Dslave1: x509: certificate signed by unknown authority
E1009 16:48:52.922433 100724 reflector.go:136] Failed to list *api.Pod: Get https://master:6443/api/v1/pods?fieldSelector=spec.nodeName%3Dslave1: x509: certificate signed by unknown authority
E1009 16:48:52.924432 100724 reflector.go:136] Failed to list *api.Service: Get https://master:6443/api/v1/services: x509: certificate signed by unknown authority
So I am confused with the meaning of the insecure-skip-tls-verify
...
There is an open issue (https://github.com/kubernetes/kubernetes/issues/13830) with the behavior of that flag when a client cert/key is provided. When a client certificate is provided, the insecure flag is ignored.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With