Untitled

mail@pastecode.io avatar
unknown
plain_text
7 months ago
633 B
2
Indexable
Never
apiVersion: v1
kind: Namespace
metadata:
  name: hw01
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: hw01-deployment
  namespace: hw01
  labels:
    app: hw01
spec:
  replicas: 2
  selector:
    matchLabels:
      app: hw01
  template:
    metadata:
      name: hw01-pod
      labels:
        app: hw01
    spec:
      containers:
      - name: nginx
        image: nginx:1.14.2
        ports:
          - containerPort: 80
---
apiVersion: v1
kind: Service
metadata:
  name: hw01-service
  namespace: hw01
spec:
  type: NodePort
  ports:
    - targetPort: 80
      port: 80
      nodePort: 30080
  selector:
    app: hw01
Leave a Comment