mysterious-whale-87222
01/13/2023, 10:13 PMmysterious-pizza-43684
01/14/2023, 6:27 PMauthentication.go:63] "Unable to authenticate the request" err="[invalid bearer token, Token has been invalidated]"
. … I’m basically unable to run kubectl or anything and my pods never come online .. eventually k3s-service just crashes and restarts. Not quite sure where to begin troubleshooting.mysterious-pizza-43684
01/14/2023, 7:04 PMbusy-manchester-37626
01/15/2023, 11:09 PMmicroscopic-king-50617
01/16/2023, 5:42 PM--node-taint <http://node-role.kubernetes.io/master=true:NoSchedule|node-role.kubernetes.io/master=true:NoSchedule>
but my master nodes still show Taints: <none>
when I check the node annotations <http://k3s.io/node-args|k3s.io/node-args>
contains [..., "--node-taint", "<http://node-role.kubernetes.io/master=true:NoSchedule|node-role.kubernetes.io/master=true:NoSchedule>"]
broad-laptop-19151
01/19/2023, 6:41 PMbroad-waiter-15728
01/20/2023, 9:36 AMclever-insurance-23287
01/20/2023, 8:36 PMFailed to upgrade hosts: 192.168.199.237 with error [host 192.168.199.237 not ready]
. On the nodes I’m seeing errors like this in `kubelet`:
E0120 20:34:36.159187 28876 kubelet.go:2349] "Container runtime network not ready" networkReady="NetworkReady=false reason:NetworkPluginNotReady message:docker: network plugin is not ready: cni config uninitialized"
E0120 20:34:41.170900 28876 kubelet.go:2349] "Container runtime network not ready" networkReady="NetworkReady=false reason:NetworkPluginNotReady message:docker: network plugin is not ready: cni config uninitialized"
E0120 20:34:46.183912 28876 kubelet.go:2349] "Container runtime network not ready" networkReady="NetworkReady=false reason:NetworkPluginNotReady message:docker: network plugin is not ready: cni config uninitialized"
E0120 20:34:51.195207 28876 kubelet.go:2349] "Container runtime network not ready" networkReady="NetworkReady=false reason:NetworkPluginNotReady message:docker: network plugin is not ready: cni config uninitialized"
E0120 20:34:56.207977 28876 kubelet.go:2349] "Container runtime network not ready" networkReady="NetworkReady=false reason:NetworkPluginNotReady message:docker: network plugin is not ready: cni config uninitialized"
Only the base containers are started:
ubuntu@worker-1:~$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
185b536f265f rancher/hyperkube:v1.24.8-rancher1 "/opt/rke-tools/entr…" 17 minutes ago Up 16 minutes kube-proxy
bc10253b52f5 rancher/hyperkube:v1.24.8-rancher1 "/opt/rke-tools/entr…" 17 minutes ago Up 17 minutes kubelet
9065c75bf9f4 rancher/rke-tools:v0.1.88 "nginx-proxy CP_HOST…" 17 minutes ago Up 17 minutes nginx-proxy
We have the following options set:
ignore_docker_version: false
enable_cri_dockerd: true
clever-insurance-23287
01/20/2023, 8:38 PMclever-insurance-23287
01/20/2023, 8:39 PMmagnificent-optician-13226
01/21/2023, 3:02 AMaverage-airplane-76298
01/23/2023, 3:57 PMINFO[0005] Tunnel server egress proxy waiting for runtime core to become available
INFO[0005] Waiting to retrieve kube-proxy configuration; server is not ready: <https://127.0.0.1:6443/v1-k3s/readyz>: 500 Internal Server Error
INFO[0010] Tunnel server egress proxy waiting for runtime core to become available
INFO[0010] Waiting to retrieve kube-proxy configuration; server is not ready: <https://127.0.0.1:6443/v1-k3s/readyz>: 500 Internal Server Error
{"level":"info","ts":"2023-01-23T15:28:45.167+0100","logger":"raft","caller":"etcdserver/zap_raft.go:77","msg":"ef75232eb2491d72 switched to configuration voters=(5985293894695459910 17254736230806527346)"}
{"level":"info","ts":"2023-01-23T15:28:45.167+0100","caller":"membership/cluster.go:535","msg":"promote member","cluster-id":"96831dd7fb68f941","local-member-id":"ef75232eb2491d72"}
INFO[0015] Tunnel server egress proxy waiting for runtime core to become available
INFO[0015] Waiting to retrieve kube-proxy configuration; server is not ready: <https://127.0.0.1:6443/v1-k3s/readyz>: 500 Internal Server Error
{"level":"warn","ts":"2023-01-23T15:28:50.015+0100","caller":"etcdserver/server.go:2065","msg":"failed to publish local member to cluster through raft","local-member-id":"ef75232eb2491d72","local-member-attributes":"{Name:server-002.e636bb1a ClientURLs:[<https://10.31.194.2:2379>]}","request-path":"/0/members/ef75232eb2491d72/attributes","publish-timeout":"15s","error":"etcdserver: request timed out, possibly due to connection lost"}
{"level":"info","ts":"2023-01-23T15:28:50.015+0100","caller":"etcdserver/server.go:2044","msg":"published local member to cluster through raft","local-member-id":"ef75232eb2491d72","local-member-attributes":"{Name:aserver-002.e636bb1a ClientURLs:[<https://10.31.194.2:2379>]}","request-path":"/0/members/ef75232eb2491d72/attributes","cluster-id":"96831dd7fb68f941","publish-timeout":"15s"}
creamy-pencil-82913
01/23/2023, 8:01 PMcreamy-pencil-82913
01/23/2023, 8:01 PMwonderful-pizza-30919
01/24/2023, 7:47 PMorange-airplane-98016
01/24/2023, 10:35 PMacceptable-king-56965
01/25/2023, 12:58 AMk3s server
to start the server. According to the documentation, the default datastore should be sqlite. I did see one log about sqlite:
time="2023-01-25T003034Z" level=info msg="Configuring sqlite3 database connection pooling: maxIdleConns=2, maxOpenConns=0, connMaxLifetime=0s"But I also saw logs about etcd:
time="2023-01-25T003037Z" level=info msg="ETCD server is now running"So, is
sqlite
or etcd
running in my case?
2. In any case, I did not see the db
directory in my data-dir
. Where can I find the DB files then?astonishing-park-79642
01/26/2023, 11:31 AMlate-needle-80860
01/27/2023, 1:04 PMdazzling-twilight-41550
01/27/2023, 5:50 PMconfig.yaml
file in the /etc/rancher/k3s
directory to configure the k3s kube-apiserver service,
• copies the RSA public/private key files to the /etc/rancher/k3s/pki
directory,
• change the mode of the RSA key files to 644.
When I start Rancher Desktop and review the k3s.log file, the kube-apiserver service tries to start with the updated service-account-* command line arguments. However, the kube-apiserver service writes this error to the log, "`Error: failed to parse service-account-issuer-key-file: open "/etc/rancher/k3s/pki/sa.key": no such file or directory`". I have opened the rancher-desktop WSL distro and verified that I can read both key files at their specified locations. I have also tried placing the keys files in a /var/lib/rancher/k3s/server/pki
directory and updated the config.yaml to point to the new directory. However, the kube-apiserver service throws the same error. Unfortunately, I have not found much on the internet for a go-forward path. Should I write the RSA keys to a different directory in order for k3s to find the RSA key files? Is there another setting that I need to configure for k3s to have?
Rancher Desktop 1.7.0
Kubernetes 1.25.6
provisioning script:
#!/bin/sh
mkdir -p /etc/rancher/k3s
cat > /etc/rancher/k3s/config.yaml <<EOF
kube-apiserver-arg:
- service-account-signing-key-file="/etc/rancher/k3s/pki/sa.key"
- service-account-key-file="/etc/rancher/k3s/pki/sa.pub"
- service-account-issuer="<https://www.example.net/oidc-test/>"
EOF
mkdir -p /etc/rancher/k3s/pki
cat > /etc/rancher/k3s/pki/sa.key <<EOF2
-----BEGIN PRIVATE KEY-----
MII...
-----END PRIVATE KEY-----
EOF2
chmod 644 /etc/rancher/k3s/pki/sa.key
cat > /etc/rancher/k3s/pki/sa.pub <<EOF3
-----BEGIN PUBLIC KEY-----
MII...
-----END PUBLIC KEY-----
EOF3
chmod 644 /etc/rancher/k3s/pki/sa.pub
k3s.log
time="2023-01-27T16:40:54Z" level=info msg="Starting k3s v1.25.6+k3s1 (9176e03c)"
time="2023-01-27T16:40:54Z" level=info msg="Configuring sqlite3 database connection pooling: maxIdleConns=2, maxOpenConns=0, connMaxLifetime=0s"
time="2023-01-27T16:40:54Z" level=info msg="Configuring database table schema and indexes, this may take a moment..."
time="2023-01-27T16:40:55Z" level=info msg="Database tables and indexes are up to date"
time="2023-01-27T16:40:55Z" level=info msg="Kine available at <unix://kine.sock>"
time="2023-01-27T16:40:55Z" level=info msg="Reconciling bootstrap data between datastore and disk"
time="2023-01-27T16:40:55Z" level=info msg="Tunnel server egress proxy mode: agent"
time="2023-01-27T16:40:55Z" level=info msg="Tunnel server egress proxy waiting for runtime core to become available"
time="2023-01-27T16:40:55Z" level=info msg="Running kube-apiserver --advertise-port=6443 --allow-privileged=true --anonymous-auth=false --api-audiences=<https://kubernetes.default.svc.cluster.local>,k3s --authorization-mode=Node,RBAC --bind-address=127.0.0.1 --cert-dir=/var/lib/rancher/k3s/server/tls/temporary-certs --client-ca-file=/var/lib/rancher/k3s/server/tls/client-ca.crt --egress-selector-config-file=/var/lib/rancher/k3s/server/etc/egress-selector-config.yaml --enable-admission-plugins=NodeRestriction --enable-aggregator-routing=true --etcd-servers=<unix://kine.sock> --feature-gates=JobTrackingWithFinalizers=true --kubelet-certificate-authority=/var/lib/rancher/k3s/server/tls/server-ca.crt --kubelet-client-certificate=/var/lib/rancher/k3s/server/tls/client-kube-apiserver.crt --kubelet-client-key=/var/lib/rancher/k3s/server/tls/client-kube-apiserver.key --kubelet-preferred-address-types=InternalIP,ExternalIP,Hostname --profiling=false --proxy-client-cert-file=/var/lib/rancher/k3s/server/tls/client-auth-proxy.crt --proxy-client-key-file=/var/lib/rancher/k3s/server/tls/client-auth-proxy.key --requestheader-allowed-names=system:auth-proxy --requestheader-client-ca-file=/var/lib/rancher/k3s/server/tls/request-header-ca.crt --requestheader-extra-headers-prefix=X-Remote-Extra- --requestheader-group-headers=X-Remote-Group --requestheader-username-headers=X-Remote-User --secure-port=6444 --service-account-issuer=\"<https://csgcorpitaaioidcissuer01.blob.core.windows.net/oidc-test/>\" --service-account-key-file=\"/etc/rancher/k3s/pki/sa.pub\" --service-account-signing-key-file=\"/etc/rancher/k3s/pki/sa.key\" --service-cluster-ip-range=10.43.0.0/16 --service-node-port-range=30000-32767 --storage-backend=etcd3 --tls-cert-file=/var/lib/rancher/k3s/server/tls/serving-kube-apiserver.crt --tls-cipher-suites=TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305,TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305 --tls-private-key-file=/var/lib/rancher/k3s/server/tls/serving-kube-apiserver.key"
time="2023-01-27T16:40:55Z" level=info msg="Running kube-scheduler --authentication-kubeconfig=/var/lib/rancher/k3s/server/cred/scheduler.kubeconfig --authorization-kubeconfig=/var/lib/rancher/k3s/server/cred/scheduler.kubeconfig --bind-address=127.0.0.1 --kubeconfig=/var/lib/rancher/k3s/server/cred/scheduler.kubeconfig --leader-elect=false --profiling=false --secure-port=10259"
time="2023-01-27T16:40:55Z" level=info msg="Waiting for API server to become available"
time="2023-01-27T16:40:55Z" level=info msg="Running kube-controller-manager --allocate-node-cidrs=true --authentication-kubeconfig=/var/lib/rancher/k3s/server/cred/controller.kubeconfig --authorization-kubeconfig=/var/lib/rancher/k3s/server/cred/controller.kubeconfig --bind-address=127.0.0.1 --cluster-cidr=10.42.0.0/16 --cluster-signing-kube-apiserver-client-cert-file=/var/lib/rancher/k3s/server/tls/client-ca.crt --cluster-signing-kube-apiserver-client-key-file=/var/lib/rancher/k3s/server/tls/client-ca.key --cluster-signing-kubelet-client-cert-file=/var/lib/rancher/k3s/server/tls/client-ca.crt --cluster-signing-kubelet-client-key-file=/var/lib/rancher/k3s/server/tls/client-ca.key --cluster-signing-kubelet-serving-cert-file=/var/lib/rancher/k3s/server/tls/server-ca.crt --cluster-signing-kubelet-serving-key-file=/var/lib/rancher/k3s/server/tls/server-ca.key --cluster-signing-legacy-unknown-cert-file=/var/lib/rancher/k3s/server/tls/server-ca.crt --cluster-signing-legacy-unknown-key-file=/var/lib/rancher/k3s/server/tls/server-ca.key --configure-cloud-routes=false --controllers=*,-service,-route,-cloud-node-lifecycle --feature-gates=JobTrackingWithFinalizers=true --kubeconfig=/var/lib/rancher/k3s/server/cred/controller.kubeconfig --leader-elect=false --profiling=false --root-ca-file=/var/lib/rancher/k3s/server/tls/server-ca.crt --secure-port=10257 --service-account-private-key-file=/var/lib/rancher/k3s/server/tls/service.key --service-cluster-ip-range=10.43.0.0/16 --use-service-account-credentials=true"
I0127 16:40:55.053432 436 server.go:581] external host was not specified, using 192.168.67.3
Error: failed to parse service-account-issuer-key-file: open "/etc/rancher/k3s/pki/sa.key": no such file or directory
time="2023-01-27T16:40:55Z" level=fatal msg="apiserver exited: failed to parse service-account-issuer-key-file: open \"/etc/rancher/k3s/pki/sa.key\": no such file or directory"
time="2023-01-27T16:40:55Z" level=info msg="Running cloud-controller-manager --allocate-node-cidrs=true --authentication-kubeconfig=/var/lib/rancher/k3s/server/cred/cloud-controller.kubeconfig --authorization-kubeconfig=/var/lib/rancher/k3s/server/cred/cloud-controller.kubeconfig --bind-address=127.0.0.1 --cloud-config=/var/lib/rancher/k3s/server/etc/cloud-config.yaml --cloud-provider=k3s --cluster-cidr=10.42.0.0/16 --configure-cloud-routes=false --controllers=*,-route --kubeconfig=/var/lib/rancher/k3s/server/cred/cloud-controller.kubeconfig --leader-elect=false --leader-elect-resource-name=k3s-cloud-controller-manager --node-status-update-frequency=1m0s --profiling=false"
silly-army-29849
01/28/2023, 11:19 AMsilly-army-29849
01/28/2023, 11:19 AMsilly-army-29849
01/28/2023, 11:19 AMbroad-waiter-15728
01/28/2023, 4:16 PMdelightful-address-49392
01/31/2023, 6:28 AMI0131 14:25:43.970982 9050 shared_informer.go:262] Caches are synced for certificate-csrsigning-kubelet-client
I0131 14:25:43.970965 9050 shared_informer.go:262] Caches are synced for certificate-csrsigning-kubelet-serving
I0131 14:25:44.022011 9050 shared_informer.go:262] Caches are synced for certificate-csrapproving
time="2023-01-31T14:25:44+08:00" level=info msg="Stop pulling image rancher/mirrored-metrics-server:v0.6.2: Status: Downloaded newer image for rancher/mirrored-metrics-server:v0.6.2"
I0131 14:25:44.350653 9050 shared_informer.go:262] Caches are synced for garbage collector
I0131 14:25:44.350669 9050 garbagecollector.go:163] Garbage collector: all resource monitors have synced. Proceeding to collect garbage
I0131 14:25:44.386944 9050 shared_informer.go:262] Caches are synced for garbage collector
W0131 14:25:44.864126 9050 handler_proxy.go:105] no RequestInfo found in the context
W0131 14:25:44.864125 9050 handler_proxy.go:105] no RequestInfo found in the context
E0131 14:25:44.864185 9050 controller.go:116] loading OpenAPI spec for "<http://v1beta1.metrics.k8s.io|v1beta1.metrics.k8s.io>" failed with: failed to retrieve openAPI spec, http error: ResponseCode: 503, Body: service unavailable
, Header: map[Content-Type:[text/plain; charset=utf-8] X-Content-Type-Options:[nosniff]]
E0131 14:25:44.864191 9050 controller.go:113] loading OpenAPI spec for "<http://v1beta1.metrics.k8s.io|v1beta1.metrics.k8s.io>" failed with: Error, could not get list of group versions for APIService
I0131 14:25:44.864196 9050 controller.go:129] OpenAPI AggregationController: action for item <http://v1beta1.metrics.k8s.io|v1beta1.metrics.k8s.io>: Rate Limited Requeue.
I0131 14:25:44.865275 9050 controller.go:126] OpenAPI AggregationController: action for item <http://v1beta1.metrics.k8s.io|v1beta1.metrics.k8s.io>: Rate Limited Requeue.
time="2023-01-31T14:25:45+08:00" level=info msg="Using CNI configuration file /var/lib/rancher/k3s/agent/etc/cni/net.d/10-flannel.conflist"
delightful-address-49392
02/01/2023, 7:13 AMmsg="error in remotedialer server [400]: websocket: close 1006 (abnormal closure): unexpected EOF"
time="2023-02-01T15:11:34+08:00" level=info msg="Using CNI configuration file /xj-data/k3s/data/agent/etc/cni/net.d/10-flannel.conflist"
time="2023-02-01T15:11:37+08:00" level=info msg="certificate CN=id-test-it-kubernetes-10.7.4.4-master02 signed by CN=k3s-server-ca@1675144488: notBefore=2023-01-31 05:54:48 +0000 UTC notAfter=2024-02-01 07:11:37 +0000 UTC"
time="2023-02-01T15:11:37+08:00" level=info msg="certificate CN=system:node:id-test-it-kubernetes-10.7.4.4-master02,O=system:nodes signed by CN=k3s-client-ca@1675144488: notBefore=2023-01-31 05:54:48 +0000 UTC notAfter=2024-02-01 07:11:37 +0000 UTC"
red-army-65647
02/02/2023, 1:19 AMchilly-airport-96481
02/02/2023, 11:09 AMclever-processor-78736
02/03/2023, 10:03 AMk3s
nodes, k3s
is been started using a couple of flags via curl -sfL <https://get.k3s.io> | sh -s -
. I would like to create a config.yaml
and add everything there and restart k3s
with only the --config
flag. AFAICT i can change the systemd unit-file and ExecStart
to add --config
and do a restart. Any caveats making a change like this?straight-businessperson-27680
02/04/2023, 6:39 PM