deployment
apiVersion: apps/v1
kind: Deployment
metadata:
name: hello-deploy
spec:
replicas: 1
selector:
matchLabels:
app: hello-world
minReadySeconds: 10
template:
metadata:
labels:
app: hello-world
spec:
containers:
- name: hellopod
image: qqxdemo:v1.0
ports:
- containerPort: 8080
svc.yaml
apiVersion: v1
kind: Service
metadata:
name: hello-svc
labels:
app: hello-world
spec:
type: NodePort
ports:
- port: 8080
nodePort: 30001
protocol: TCP
selector:
app: hello-world
启动:
kubectl apply -f deployment.yml
kubectl apply -f svc.yml
minikube service hello-svc