While installing a Kubernetes local cluster, I happened to encounter the following problem:
E0514 07:30:58.627632 1 cacher.go:424] cacher (*core.Secret): unexpected ListAndWatch error: failed to list *core.Secret: unable to transform key “/registry/secrets/default/default-token-nk77g”: invalid padding on input; reinitializing…
W0514 07:30:59.631509 1 reflector.go:324] storage/cacher.go:/secrets: failed to list *core.Secret: unable to transform key “/registry/secrets/default/default-token-nk77g”: invalid padding on input
E0514 07:30:59.631563 1 cacher.go:424] cacher (*core.Secret): unexpected ListAndWatch error: failed to list *core.Secret: unable to transform key “/registry/secrets/default/default-token-nk77g”: invalid padding on input; reinitializing…
W0514 07:31:00.633540 1 reflector.go:324] storage/cacher.go:/secrets: failed to list *core.Secret: unable to transform key “/registry/secrets/default/default-token-nk77g”: invalid padding on input
E0514 07:31:00.633575 1 cacher.go:424] cacher (*core.Secret): unexpected ListAndWatch error: failed to list *core.Secret: unable to transform key “/registry/secrets/default/default-token-nk77g”: invalid padding on input; reinitializing…
Reason:
We know that after running the cluster master, we need to create the TLS Bootstrap Secret to provide an automatic visa using.
cat <<EOF | kubectl create -f -
apiVersion: v1
kind: Secret
metadata:
name: bootstrap-token-${TOKEN_ID}
namespace: kube-system
type: bootstrap.kubernetes.io/token
stringData:
token-id: "${TOKEN_ID}"
token-secret: "${TOKEN_SECRET}"
usage-bootstrap-authentication: "true"
usage-bootstrap-signing: "true"
auth-extra-groups: system:bootstrappers:default-node-token
EOF
secret "bootstrap-token-65a3a9" created
where BOOTSTRAP_TOKEN=T O K E N I D . {TOKEN_ID}.TOKEN
I
D.{TOKEN_SECRET} can be found in bootstrap-kubelet.conf.
One of the reasons for the problem shown in the title is that the command may have been run multiple times and multiple secrets exist, e.g. the node side was found to be not working properly and a bootstrap-kubelet.conf was regenerated for it, etc.
Then when installing the kubernetes cluster manually, we will find that the online information is backward after all, so we will use the kubeadm post-installation information for comparison and verification, and then I accidentally added the following codes:
spec:
hostNetwork: true
priorityClassName: system-cluster-critical
securityContext:
seccompProfile:
type: RuntimeDefault
spec.securityContext.seccompProfile.type=RuntimeDefault, this setting will automatically generate a self-signed secret when the cluster is running, which will lead to a contradiction with the manual generation and the problem in the title.
Solution:
1) First clear the cluster cache, delete all files under /var/lib/etcd/ and /var/lib/kubelet/, and keep the config.xml file in the latter.
2) Delete the spec.securityContext.type=”seccompProfile” in /etc/kubernetes/manifests under kube-apiserver.yml, kube-controller-manager.yml and kube-scheduler.yml. seccompProfile.type=RuntimeDefault.
3) Re-run the kubelet: systemctl start kubelet and you are done.
Read More:
- Kubernetes Error: Error in configuration: unable to read client-cert* unable to read client-key*
- Kubernetes create secret Error: Error from server (InternalError): Internal error occurred…
- [Solved] Kubernetes ingress-srv. error: failed calling webhook “validate.nginx.ingress.kubernetes.io”
- Failed to transform file ‘xxx‘ to match attributes [How to Solve]
- [Solved] Android x relies on AAR errors: Failed to transform…
- kubernetes Error from server (AlreadyExists): error when creating “kubernetes-dashboard.yaml”: serv
- [Solved] webpack.config.js configuration encountered Error: Cannot find module’@babel/core’&&Cannot find module’@babel/plugin-transform-react-jsx’
- [Solved] net core HTTP Error 500.31 – Failed to load ASP.NET Core runtime HTTP Error 500.30 – ASP.NET Core
- [Solved] Asp.Net Core IIS Error: HTTP Error 500.30 – ASP.NET Core app failed to start
- [Solved] Gitee generates public key error: Enter file in which to save the key…
- Error reporting and resolution of kubernetes installation
- [Solved] Error: Could not get apiVersions from Kubernetes
- Attributeerror encountered when using ceilometer and gnocchi to execute commands related to gnocchi metric list: _Environ instance has no attribute ‘
- org.springframework.core.NestedIOException: Failed to parse mapping resource: ‘file [XXX.xml]‘;
- [Solved] Internal error occurred: failed calling webhook “validate.nginx.ingress.kubernetes.io”:
- [Solved] SecureCRT Error: Key exchange failed. No compatible key exchange method.
- [Solved] Nacos Start Error: failed to req API:127.0.0.1:8848/nacos/v1/ns/service/list. code:503 msg: server is DOWN now
- [Solved] JRebel Error: ERROR Failed to obtain seat. Unable to connect to license server
- Kubernetes reported an error: matchexpressions: [] v1. Labelselector requirement (NIL)}: field is immutable
- Klee Error: Assertion `userMainFn && “unable to get user main“‘ failed