nodename vim nodename.yaml apiVersion: v1 Kind: Pod metadata: name: nginx labels: app: nginx spec: containers: – name: nginx image: nginx nodeName: k8s2 nodeName: k8s2 #If the node pod cannot be found, pending will appear, with the highest priority. kubectl apply -f nodename.yaml kubectl get pod -o wide Recycle kubectl delete -f nodename.yaml nodeselector vim nodeselector.yaml […]
Tag: orchestration
kubernetes cluster orchestration – k8s storage (volumes, persistent volumes, statefulset controller)
volumes emptyDir volume vim emptydir.yaml apiVersion: v1 Kind: Pod metadata: name: vol1 spec: containers: – image: busyboxplus name: vm1 command: [“sleep”, “300”] volumeMounts: – mountPath: /cache name: cache-volume – name: vm2 image: nginx volumeMounts: – mountPath: /usr/share/nginx/html name: cache-volume volumes: – name: cache-volume emptyDir: medium: Memory sizeLimit: 100Mi kubectl apply -f emptydir.yaml kubectl get pod […]
Docker-compose container cluster orchestration management tool
Table of Contents Docker-compose 1. Three major concepts of Docker-compose 2. YAML file format and writing considerations 1) When using YAML, you need to pay attention to the following matters 2) ymal file format 3) json format 3. Docker Compose configuration common fields 4. Four restart strategies of Docker-compose 5. Docker Compose common commands 6. […]
kubernetes cluster orchestration – k8s storage (configmap, secrets)
configmap Literal value creation kubectl create configmap my-config –from-literal=key1=config1 –from-literal=key2=config2 kubectl get cm kubectl describe cm my-config Create from file kubectl create configmap my-config-2 –from-file=/etc/resolv.conf kubectl describe cm my-config-2 Create from directory mkdir test cp /etc/passwd test/ cp /etc/fstab test/ ls test/ kubectl create configmap my-config-3 –from-file=test kubectl describe cm my-config-3 Created through yaml file […]
kubernetes cluster orchestration – controller
Controller Documentation: https://v1-25.docs.kubernetes.io/zh-cn/docs/concepts/workloads/controllers/ replicaset vim rs-example.yml apiVersion: apps/v1 kind: ReplicaSet metadata: name: replicaset-example spec: replicas: 3 selector: matchLabels: app: nginx template: metadata: labels: app: nginx spec: containers: – name: nginx image: nginx kubectl apply -f rs-example.yml kubectl get pod –show-labels replicaset matches pods through labels kubectl label pod replicaset-example-w9z28 app=myapp –overwrite kubectl get pod –show-labels […]
Doceker-compose – container cluster orchestration and management tool
Table of Contents Docker-compose 1. Three major concepts of Docker-compose 2. YAML file format and writing considerations 1) When using YAML, you need to pay attention to the following matters 2) ymal file format 3) json format 3. Docker Compose configuration common fields 4. Four restart strategies of Docker-compose 5. Docker Compose common commands 6. […]
kubernetes cluster orchestration
Table of Contents k8s cluster deployment Cluster environment initialization Install kubeadm on all nodes Pull the images required by the cluster Cluster initialization Install flannel network plug-in Set kubectl command completion k8s cluster deployment Experimental environment CPU name ip Role k8s1 (docker1 from the previous chapter) 192.168.81.10 reg.westos.org, harbor warehouse k8s2 192.168.81.11 master, k8s cluster […]
kubernetes cluster orchestration – k8s cluster deployment
k8s cluster deployment Official website: https://v1-23.docs.kubernetes.io/zh/docs/setup/production-environment/tools/kubeadm/install-kubeadm/ CPU name ip Role k8s1 192.168.52.130 reg.westos.org, harbor warehouse k8s2 192.168.52.131 master, k8s cluster control node k8s3 192.168.52.132 node, k8s cluster working node k8s4 192.168.52.133 node, k8s cluster working node Disable selinux and firewall on all nodes All nodes synchronize time and resolution Install docker-ce on all nodes Disable […]
Docker-compose container orchestration
Docker-compose Meaning: Docker-Compose is Docker’s official open source project, responsible for rapid orchestration of Docker container clusters. Docker-Compose can manage multiple Docker containers to form an application. You need to define a configuration file in yaml format docker-compose.yml to configure the calling relationships between multiple containers, and then you can start/stop these containers at the […]
Asynchronous orchestration: CompletableFuture usage
1. Foreword Nowadays, most CPUs are multi-core. We all know that if we want to improve the running efficiency of our applications, we must make full use of the computing power of multi-core CPUs; Java provides us with a large number of multi-threaded APIs, and using them can make our code To avoid synchronization blocking […]