树莓派集群安装K9S

在树莓派上安装完成k3s后看到K9S可以快速解决K3S下的日常问题,而且可以UI展示,很有意思.查找资料后进行安装.

一.在树莓派上安装K9S

  1. 配置当前用户k3s的config文件
    首先确保当前用户下已经配置了.kube/config,如果没有创建采用下面的方法创建
$ sudo cat /etc/rancher/k3s/k3s.yaml 
apiVersion: v1
clusters:
- cluster:
    certificate-authority-data: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUJkekNDQVIyZ0F3SUJBZ0lCQURBS0JnZ3Foa2pPUFFRREFqQWpNU0V3SHdZRFZRUUREQmhyTTNNdGMyVnkKZG1WeUxXTmhRREUyTVRJM09UYzRNREV3SGhjTk1qRXdNakE0TVRVeU16SXhXaGNOTXpFd01qQTJNVFV5TXpJeApXakFqTVNFd0h3WURWUVFEREJock0zTXRjMlZ5ZG1WeUxXTmhRREUyTVRJM09UYzRNREV3V1RBVEJnY3Foa2pPClBRSUJCZ2dxaGtqT1BRTUJCd05DQUFSejVPZFZySDBTeXB1YjhGcnB5RkY5QVBPRWgyY2NEblhxS1pZeW9EY2sKYndPTERvUU56bGp0djROTG9ta240bncyYlRwV1gyc3RMVVNNcWxHcU9GRVRvMEl3UURBT0JnTlZIUThCQWY4RQpCQU1DQXFRd0R3WURWUjBUQVFIL0JBVXdBd0VCL3pBZEJnTlZIUTRFRmdRVVY4d3g2ckY2M28rckQ4UHV3RldqCjFBb1k1aW93Q2dZSUtvWkl6ajBFQXdJRFNBQXdSUUloQUpJZU9WZU5qdzUxcTlnVlF4czNvdE5UZVNXb3lRSmQKL3lJN1g0QUxDRXRlQWlCaE1CbHJQOTlSbGVQMVlkcGhrb3R5RkJpekZVazhLNEQ2NXl0WmlPbG1ndz09Ci0tLS0tRU5EIENFUlRJRklDQVRFLS0tLS0K
    server: https://127.0.0.1:6443
  name: default
contexts:
- context:
    cluster: default
    user: default
  name: default
current-context: default
kind: Config
preferences: {}
users:
- name: default
  user:
    client-certificate-data: LS0tLS1CRUdJT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YzRNREV3V1RBVEJnY3Foa2pPClBRSUJCZ2dxaGtqT1BRTUJCd05DQUFUYUdyL3M0TjNScEFFaXpaLzQvT2MwVDJiMmVCdEwydlNLSC9mVU1GeVEKSk5nekRqV0VxaWUvNWVzNTdFeEFHVTFRUExabjlHbFR5ZnY4aFR4Rk1XNlhvMEl3UURBT0JnTlZIUThCQWY4RQpCQU1DQXFRd0R3WURWUjBUQVFIL0JBVXdBd0VCL3pBZEJnTlZIUTRFRmdRVUpSa0UwOFlabG5teE1NRm03d1ZzCnFaYjNmbzB3Q2dZSUtvWkl6ajBFQXdJRFNBQXdSUUloQU1HbmI3S1pEaG12clJwNGFFWEdpUTJKbkpZTlF4S04KL3VHWTd1Qi9iTG8xQWlCOUM3bkNVZ05XWGQwQmRQYkdOalprQysvK0ovNnRjS1gxT0VTNmpaUFBUZz09Ci0tLS0tRU5EIENFUlRJRklDQVRFLS0tLS0K
    client-key-data: LS0tLS1CRUdJTiBFQyBQUklWQVRFIEtFWS0tLS0tCk1IY0NBUUVFSU8weSszSW44REVScHd4c2lKTjJCYVdrbkEvR3UzU3V6WlVnVmhVTjczZTVvQW9HQ0NxR1NNNDkKQXdFSG9VUURRZ0FFd2hqTmdHankxa0RsVUVQa2FHN1pWYW5tQ0ZselVUeE5rR3ZiQ2tqNC9aaDEwci80KzM4bwo3Q0dzemg3RXNVeFVoWElyU29tUStNSWFaVFhqbWJUbUpRPT0KLS0tLS1FTkQgRUMgUFJJVkFURSBLRVktLS0tLQo=

在当前用户根目录下新建立.kube文件夹,并创建config文件,复制上面的k3s.yaml内容至config文件内

  1. 下载k9s
    我这里用的是axel进行多线程下载,这样速度会快些
axel -n 10 https://github.com/derailed/k9s/releases/download/v0.24.2/k9s_Linux_arm.tar.gz
tar zxvf k9s_Linux_arm.tar.gz
mv k9s /usr/local/bin
  1. 直接运行K9S


二.在PC上安装K9S

1.ubuntu下安装K9S同树莓派安装
2.windows下安装K9S

三. 参考资料

  1. 轻量级Kubernetes k3s初探
    2.k9s:你没看错,这是一个加速 k8s 集群管理的工具

你可能感兴趣的:(树莓派集群安装K9S)