Docker, kubenets pre-use configuration

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.