k8s 通过 yaml 文件创建 deployment
cat k8s-test-deploy.yamlapiVersion: apps/v1kind: Deploymentmetadata: name: auth-server namespace: k8s-testspec: replicas: 1 selector: matchLabels: erp: k8s-test app: auth-s...
cat k8s-test-deploy.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: auth-server
namespace: k8s-test
spec:
replicas: 1
selector:
matchLabels:
erp: k8s-test
app: auth-server
template:
metadata:
labels:
erp: k8s-test
app: auth-server
spec:
containers:
- name: auth-server
image: xxxx/auth-server:latest
imagePullPolicy: Always
envFrom:
- secretRef:
name: k8s-test-secret
optional: true
ports:
- name: auth-server
containerPort: 8100
imagePullSecrets:
- name: k8s-test-registry
部署
kubectl apply -f k8s-test-deploy.yaml
更多推荐
所有评论(0)