overview
- The k8s control panel is installed, which is convenient for daily problem handling, viewing resource status information, and adding sub-accounts for other personnel to use, reducing command operations and improving work efficiency
Preconditions
- There must be a k8s cluster in normal use
- Attached k8s v1.20 version build: https://blog.csdn.net/u010800804/article/details/124524688
Rancher [recommended]
- Enterprise-level Kubernetes management platform
- Rancher provides a complete software stack for teams adopting containers, solving the operational and security challenges of managing multiple Kubernetes clusters across any infrastructure, while providing DevOps teams with integrated tools for running containerized workloads.
resource information
- Rancher can create a cluster from a Kubernetes hosting provider, create nodes and install Kubernetes, or import an existing Kubernetes cluster running anywhere.
- China official website: https://www.rancher.cn/
- Open source address: https://github.com/rancher/rancher
- In addition, Rancher can provide more granular monitoring and alerting for clusters and resources, send logs to external providers, and integrate Helm directly through the application store (Application Catalog). If you have an external CI/CD system, you can interface it with Rancher. If not, you can also use Fleet provided by Rancher to automatically deploy and upgrade workloads.
- Version confirmation: https://www.suse.com/zh-cn/suse-rancher/support-matrix/all-supported-versions/rancher-v2-6-10/
Install online
- Docker installations of Rancher are only recommended for development and test environments
- Rancher can be installed by running a single Docker container.
- In this setup, you install Docker to a single Linux host, then deploy Rancher to the host using a single Docker container.
- Install via docker
docker run -d --restart=unless-stopped \
-p 11180:80 -p 11443:443 \
--privileged \
rancher/rancher:latest
browser access
- Open a browser, enter https://<host name or IP address of the installation container>, and you can access the UI of Rancher Server. Follow the guidance given by the user interface to set up your first Rancher cluster.
set password
- Here we use docker for installation
- First find the docker container name
- Execute the command to get the password
- Get password template
docker logs container-id 2>&1 | grep "Bootstrap Password:"
log in
- set a new password
Set to Chinese interface
- Choose Simplified Chinese
import cluster
rancher console operation
- Jump to the registration conditions page
- Run the following kubectl command on an existing Kubernetes cluster running a supported Kubernetes version to import it into Rancher:
kubectl apply -f https://192.168.1.13:11443/v3/import/lbv886k95bpxkm6gtl267z5g97dd4srsrhj8k4f9qtpmngc94pdhzj_c-m-v9xhm8hc.yaml
- If you get a "Certificate signed by unknown authority" error, your Rancher installation has a self-signed or untrusted SSL certificate. Run the following command to bypass certificate verification:
curl --insecure -sfL https://192.168.1.13:11443/v3/import/lbv886k95bpxkm6gtl267z5g97dd4srsrhj8k4f9qtpmngc94pdhzj_c-m-v9xhm8hc.yaml | kubectl apply -f -
- If you get permission errors when creating some resources, your user probably doesn't have the cluster-admin role. Use this command to apply it:
kubectl create clusterrolebinding cluster-admin-binding --clusterrole cluster-admin --user <your username from your kubeconfig>
k8s cluster execution command
Operation cluster