k3s高可用安装
安装版本: k3s(v1.21.7+k3s1) 参考站内k3s实践高可用架构图 官方文档参考顺序(官方文档记录的顺序有点乱)1234560. 查看对应版本: https://www.suse.com/suse-rancher/support-matrix/all-supported-versions/rancher-v2-6-3/1. 基础架构: https://rancher.com/docs/rancher/v2.6/en/installation/resources/k8s-tutorials/infrastructure-tutorials/infra-for-ha-with-external-db/2. 负载均衡: https://rancher.com/docs/rancher/v2.6/en/installation/resources/k8s-tutorials/infrastructure-tutorials/nginx/3. 部署k3s:...
关于k3s的证书轮换策略
前言官方文档 K3s 启动时会自动生成 CA 证书,CA 证书的有效期为 10 年。其他证书有效期为 1 年,如果证书已经过期或剩余的时间不足 90 天,则在 K3s 重启时轮换证书。K3s 服务只是一个进程,K3s 服务重启不会影响正在运行的 pod,也不会影响你的业务。 证书轮换方式(3种任选其一)使用crontab + shell脚本方式实现证书轮换编写脚本 - upgradeCert.sh,并放在主节点服务器上 查看主节点位置:kubectl get nodes -l 'node-role.kubernetes.io/control-plane'|awk '{if (NR>1){print $1}}' server node脚本 1234567891011121314151617181920#!/bin/bash# 目标目录DIR="/var/lib/rancher/k3s/server/tls"now=$(date +%s)# 递归查找.crt文件for...
helm命令
查看所有repo1helm repo list 删除repo1helm repo remove stable 添加repo1helm repo add stable https://kubernetes.oss-cn-hangzhou.aliyuncs.com/charts 更新1helm repo update 下载指定版本Rancher 版本 tgz 压缩包到本地1helm fetch rancher-stable/rancher --version=v2.5.8 部署升级,把读取的部署参数使用 --set <key>=<value> 的方式添加到命令中1234helm upgrade rancher rancher-stable/rancher \--namespace cattle-system \--set ingress.tls.source=secret \--set hostname=<domain_name> helm命令大全 - 链接
helm的安装
下载helm3.81wget https://get.helm.sh/helm-v3.8.0-linux-amd64.tar.gz 解压1tar -zxvf helm-v3.8.0-linux-amd64.tar.gz 赋权1mv linux-amd64/helm /usr/local/bin/helm && chmod +x /usr/local/bin/helm