Error from server (BadRequest): error when creating "mysql_deploy.yaml": Deployment in version "v1beta1" cannot be handled as a Deployment: [pos 481]: json: expect char '"' but got char '1'
下面是一个完整的yaml格式定义的文件,注意格式,子集包含关系,必须使要用空格,不能有tab,string类型的变量需要用单引号或者双引号。所有的元素不用都包含,按照实际应用场景配置即可。
apiVersion: v1
kind: pod
metadata:
name: String
namespace: String
labels:
- name: String
annotations:
- name: String
spec:
containers:
- name: String
image: String
imagePullPolicy: [Always|Never|IfNotPresent]
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: Srting
memory: String
requeste:
cpu: String
memory: String
livenessProbe:
exec:
command: [String]
httpGet:
path: String
port: number
host: String
scheme: Srtring
httpHeaders:
- name: Stirng
value: String
tcpSocket:
port: number
initialDelaySeconds: 0
timeoutSeconds: 0
periodSeconds: 0
successThreshold: 0
failureThreshold: 0
securityContext:
privileged: falae
restartPolicy: [Always|Never|OnFailure]
nodeSelector: object
imagePullSecrets:
- name: String
hostNetwork: false
volumes:
- name: String
meptyDir: {}
hostPath:
path: string
secret:
secretName: String
item:
- key: String
path: String
configMap:
name: String
items:
- key: String
path: String