apiVersion: apps/v1
kind: Deployment
metadata:
  name: myapp
  namespace: test
spec:
  replicas: 1
  selector:
    matchLabels:
      app: myapp
  template:
    metadata:
      labels:
        app: myapp
    spec:
      containers:
        - name: myapp
          image: rrr.**.com/eee/myapp:21
          ports:
            - containerPort: 13090
              name: https
            - containerPort: 5005
              name: http
      nodeName: worker4

---
apiVersion: v1
kind: Service
metadata:
  name: myapp
  namespace: test
spec:
  type: NodePort
  ports:
    - port: 13090
      targetPort: 13090
      nodePort: 31189
      name: https
    - port: 5005
      targetPort: 5005
      nodePort: 31188
      name: http
  selector:
    app: myapp
Logo

K8S/Kubernetes社区为您提供最前沿的新闻资讯和知识内容

更多推荐