• Vladimir Kochnev's avatar
    Save agent token to /var/lib/rancher/k3s/server/agent-token · 4e72947f
    Vladimir Kochnev authored
    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: 's avatarVladimir Kochnev <hashtable@yandex.ru>
    (cherry picked from commit 13af0b1d)
    Signed-off-by: 's avatarBrad Davidson <brad.davidson@rancher.com>
    4e72947f
Name
Last commit
Last update
..
auth.go Loading commit data...
context.go Loading commit data...
etcd.go Loading commit data...
router.go Loading commit data...
secrets-encrypt.go Loading commit data...
server.go Loading commit data...
types.go Loading commit data...