K8s k8s is a cluster. There are multiple Namespaces in the cluster. There are multiple pods under a namespace, and there are multiple containers under a pod. Docker Download Docker installation: https://docs.docker.com/docker-for-mac/install/ k8s related commands In this section, we will briefly introduce the relevant shell commands for controlling k8s through the command line.
Get the relevant pod information under default. If there is no –namespace parameter, get all namespace information
Get the pod shell
Display via web APIHow to intuitively display the information of the k8s cluster on a web page. Preferred Configuration Agent
Open the web page at this time When prompted to enter a token, enter the command and paste the obtained token into the token.
At this point, enter the k8s web page, Click on the corresponding pods and select the namespace. Click the three dots after pod and click Execute to enter the shell of the current pod. YAML file formatThis section gives the file format of YAML. apiVersion: v1 kind: Pod metadata: name: pod1 labels: app: web namespace: yournamespace spec: containers: - name: front-end image: ngnix ports: - containerPort: 80 - name: flaskapp-demo image: jcdemo/flaskapp ports: - containerPort: 5000 This means creating two containers under pod1 of yournamespace, one named front-end with the image of ngnix, and the other named flaskapp-demo with the image of jcdemo/flaskapp. apiVersion: v1 kind: Pod metadata: name: pod3 labels: app: web namespace: yournamespace spec: containers: - name: pod-redis image: docker.io/redis ports: - containerPort: 5000 This means creating a container named pod-redis under pod3 in yournamespace, with the image docker.io/redis. This is the end of this article about how to deploy k8s in docker. For more information about docker deploying k8s, please search for previous articles on 123WORDPRESS.COM or continue to browse the following related articles. I hope you will support 123WORDPRESS.COM in the future! You may also be interested in:
|
<<: Detailed explanation of Vue form event data binding
>>: Detailed tutorial on MySQL installation and configuration
Table of contents 1. Effect diagram (multiple col...
This article records the process of upgrading MyS...
This article example shares the specific code of ...
First: <abbr> or <acronym> These two s...
Preface In a recent project, we need to save a la...
Big data continues to heat up, and if you are not...
This blog is a work note environment: nginx versi...
MySQL Users and Privileges In MySQL, there is a d...
I chose node.js to build the server. Friends who ...
MySQL 5.7.17, now seems to be the latest version,...
This article example shares the specific code of ...
1. Common connections for mysql INNER JOIN (inner...
Table of contents 1.1Tinyint Type Description 1.2...
This article compares and summarizes four ways of...
1. Overview of SQLException When an error occurs ...