Kubernates——Pod定义详解

Pod定义详解

yml格式的Pod定义文件的完整内容如下:

apiVersion: v1
kind: Pod
metadata:
	name: string
	namespace: string
	labels:
		- name: string
	annotations:
		- name: string
spec:
	containers:
	- name: string
	  image: string
	  imagePullPolicy: [Always | Never | IfNtPresent]
	  command: [string]
	  args: [string]
	  workingDir: string
	  volumeMounts:
	  - name: string
	    mountPath: string
	  	readOnly: boolean
	  ports:
	  - name: string
		containerPort: int
		hostPort: int
		protocol: string
	  env:
	  - name: string
	  	value: string
	  resources:
	  	limits:
	  		cpu: string
	  		memory: string
		requests:
			cpu: string
			memory: string
	  livenessProbe:
	  	exec:
	  		command: [string]
		httpGet:
			path: string
			port: number
			host: string
			scheme: string
			httpHeaders:
			- name: string
			  value: string
			tcpSocket:
				port: number
			initialDelaySeconds: 0
			timeoutSeconds: 0
			periodSeconds: 0
			successThreshold: 0
			failureThreshold: 0
		securityContext:
			privileged: false
	restartPolicy: [Always | Never | OnFailure]
	nodeSelector: object
	imagePullSecrets:
	- name: string
	hostNetwork: false
	volumes:
	- name: string
	  emptyDir: {
    
    }
	  hostPath:
	  	path: string
	  secret:
	  	secretName: string
	  	items:
	  	- key: string
	  	  path: string
	  configMap:
	  	name: string
	  	items:
	  	- key: string
		  path: string

属性详解如下表:

在这里插入图片描述

在这里插入图片描述

在这里插入图片描述

在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/cold___play/article/details/108289254
今日推荐