1, the developer needs to ensure that the machine is equipped with Docker and accurately configured registry, can push the relevant image to the registry( OPS personnel without this requirement)
2, the ability to access Kubernetes Apiserver related APIs, with related client certificates, and accurate client configuration
3, downloaded the Kubectl tool, and Kubectl.exe (Windows)/kubectl (Linux) in the PATH environment variable
4. The script directory used in this article is in the environment variable path
Because the scripts used in this article are written in PowerShell, you need to make sure that the commands are executed in PowerShell commands, and that, without special instructions, the current folder is the project folder by default .
In general, OPS managers will issue the. CRT and. Key certificates to the relevant users. The user name and the namespace that can be accessed please set OPS according to the actual situation. The certificate is typically set up in the following steps (the yellow section is replaced with the actual configuration):
1. Install Docker on the development machine and set yourregistryserver:5000 to insecure registry
2, download the Kubectl.exe, and put the relevant path into the environment variable path
3, the relevant CRT and key files into the user root directory of the. Kube directory, such as C:\Users\User01\.kube
4. Open the command line and create a new cluster in the configuration file, as
Kubectl config set-cluster cccffice --server=https://yourk8sapiserver: 6443-- Insecure-skip-tls-verify
5. Bind the Customer information
Kubectl.exe config set-credentials username --client-certificate=username. CRT--client-key= Username. Key
6. Bind User Context
Kubectl config set-context username-context--cluster=cccffice --namespace=yourns --user= username
7. Switch user's current context
Kubectl config use-context username-context
Docker, kubenets pre-use configuration