k3s/pkg/server
Vladimir Kochnev 13af0b1d88 Save agent token to /var/lib/rancher/k3s/server/agent-token
Having separate tokens for server and agent nodes is a nice feature.

However, passing server's plain `K3S_AGENT_TOKEN` value
to `k3s agent --token` without CA hash is insecure when CA is
self-signed, and k3s warns about it in the logs:

```
Cluster CA certificate is not trusted by the host CA bundle, but the token does not include a CA hash.
Use the full token from the server's node-token file to enable Cluster CA validation.
```

Okay so I need CA hash but where should I get it?

This commit attempts to fix this issue by saving agent token value to
`agent-token` file with CA hash appended.

Signed-off-by: Vladimir Kochnev <hashtable@yandex.ru>
2022-08-01 14:11:50 -07:00
..
auth.go Make supervisor errors parsable by Kubernetes client libs 2022-04-29 09:23:37 -07:00
context.go [master] changing package to k3s-io (#4846) 2022-03-02 15:47:27 -08:00
etcd.go [master] changing package to k3s-io (#4846) 2022-03-02 15:47:27 -08:00
router.go Replace DefaultProxyDialerFn dialer injection with EgressSelector support 2022-04-29 17:54:36 -07:00
secrets-encrypt.go Delay service readiness until after startuphooks have finished (#5649) 2022-06-15 09:00:52 -07:00
server.go Save agent token to /var/lib/rancher/k3s/server/agent-token 2022-08-01 14:11:50 -07:00
types.go Introduce servicelb-namespace parameter 2022-06-14 15:48:58 -07:00