Closed tsgan closed 2 years ago
I faced the same issue for worker-2, getting permissions issue for worker-1 though.
I faced the same issue for worker-2, getting permissions issue for worker-1 though.
able to work worker-1 with correct user name for kube-apiserver instead of system:kube-apiserver
the Author has changed the document on 13-kube-apiserver-to-kubelet.md . changed part from "name: system:kube-apiserver" to "name: kube-apiserver" . It can fixed this issue
cat <<EOF | kubectl apply --kubeconfig admin.kubeconfig -f - apiVersion: rbac.authorization.k8s.io/v1beta1 kind: ClusterRoleBinding metadata: name: system:kube-apiserver namespace: "" roleRef: apiGroup: rbac.authorization.k8s.io kind: ClusterRole name: system:kube-apiserver-to-kubelet subjects:
Faced the same issue. Indeed, not received server CSR, only client which was auto-approved. Resolved by adding --rotate-server-certificates=true \ to /etc/systemd/system/kubelet.service file and restarting service.
`cat <<EOF | sudo tee /etc/systemd/system/kubelet.service [Unit] Description=Kubernetes Kubelet Documentation=https://github.com/kubernetes/kubernetes After=docker.service Requires=docker.service
[Service] ExecStart=/usr/local/bin/kubelet \ --bootstrap-kubeconfig="/var/lib/kubelet/bootstrap-kubeconfig" \ --config=/var/lib/kubelet/kubelet-config.yaml \ --image-pull-progress-deadline=2m \ --kubeconfig=/var/lib/kubelet/kubeconfig \ --cert-dir=/var/lib/kubelet/pki/ \ --rotate-certificates=true \ --rotate-server-certificates=true \ --network-plugin=cni \ --register-node=true \ --v=2 Restart=on-failure RestartSec=5
[Install] WantedBy=multi-user.target EOF`
and then approve CSR on the master node. Tutorial should be updated with this
It worked after change the service configuration from @marioerceg Thanks
@tsgan did you solve the problem?
the Author has changed the document on 13-kube-apiserver-to-kubelet.md . changed part from "name: system:kube-apiserver" to "name: kube-apiserver" . It can fixed this issue .
Hi @tsgan @vCillusion @fitszhang @iyuvorobyov @JasonYLong
We have now merged a major change to bring this to v1.24. This has been addressed as part of the upgrade. Please try it now and feel free to raise further issues.
Thanks.
When trying to run command in one pod on worker-2 gives:
Error from server: error dialing backend: x509: certificate signed by unknown authority
it works for worker-1.