debian12基础环境配置

    0

查看ip地址

shell
ip addr
shell
ssh [email protected]
shell
su root echo "pub key" >> ~/.ssh/authorized_keys

update依赖

shell
//更新软件包列表 apt update //安装实际的软件包更新 apt upgrade
shell
apt install curl -y

安装k3s

shell
curl -sfL https://get.k3s.io | K3S_KUBECONFIG_MODE="644" K3S_NODE_NAME="k8s-master-01" sh -s - [INFO] Finding release for channel stable [INFO] Using v1.28.7+k3s1 as release [INFO] Downloading hash https://github.com/k3s-io/k3s/releases/download/v1.28.7+k3s1/sha256sum-amd64.txt [INFO] Downloading binary https://github.com/k3s-io/k3s/releases/download/v1.28.7+k3s1/k3s [INFO] Verifying binary download [INFO] Installing k3s to /usr/local/bin/k3s [INFO] Skipping installation of SELinux RPM [INFO] Creating /usr/local/bin/kubectl symlink to k3s [INFO] Creating /usr/local/bin/crictl symlink to k3s [INFO] Creating /usr/local/bin/ctr symlink to k3s [INFO] Creating killall script /usr/local/bin/k3s-killall.sh [INFO] Creating uninstall script /usr/local/bin/k3s-uninstall.sh [INFO] env: Creating environment file /etc/systemd/system/k3s.service.env [INFO] systemd: Creating service file /etc/systemd/system/k3s.service [INFO] systemd: Enabling k3s unit Created symlink /etc/systemd/system/multi-user.target.wants/k3s.service → /etc/systemd/system/k3s.service. [INFO] Host iptables-save/iptables-restore tools not found [INFO] Host ip6tables-save/ip6tables-restore tools not found [INFO] systemd: Starting k3s

安装helm

https://helm.sh/docs/intro/install/

shell
curl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash

安装dashbord

先让traefik可以代理https流量

/var/lib/rancher/k3s/server/manifests/traefik-config.yaml

yaml
apiVersion: helm.cattle.io/v1 kind: HelmChartConfig metadata: name: traefik namespace: kube-system spec: valuesContent: |- globalArguments: - "--serversTransport.insecureSkipVerify=true" ports: psql: port: 5432 expose: true exposedPort: 5432 protocol: TCP

https://github.com/kubernetes/dashboard

bash
export KUBECONFIG=/etc/rancher/k3s/k3s.yaml

Add kubernetes-dashboard repository

shell
helm repo add kubernetes-dashboard https://kubernetes.github.io/dashboard/

Deploy a Helm Release named "kubernetes-dashboard" using the kubernetes-dashboard chart

shell
helm upgrade --install kubernetes-dashboard kubernetes-dashboard/kubernetes-dashboard --create-namespace --namespace kubernetes-dashboard
bash
kubectl apply -f https://git.ooxo.cc/sonic/k8s/raw/branch/main/kubernetes-dashboard.yaml

获取token

shell
kubectl get secret admin-user -n kubernetes-dashboard -o jsonpath={".data.token"} | base64 -d

安装storage

shell
apt install open-iscsi -y
shell
kubectl apply -f https://raw.githubusercontent.com/longhorn/longhorn/v1.6.0/deploy/longhorn.yaml

观察启动成功

shell
https://longhorn.io/docs/1.6.0/deploy/install/install-with-kubectl/

配置 UI访问 https://git.ooxo.cc/sonic/yaml/raw/branch/main/longhorn.yaml

链接

评论区
共有评论 0
暂无评论