apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app: comp4000
  name: comp4000server
spec:
  replicas: 5
  selector:
    matchLabels:
      app: comp4000
      component: server
  template:
    metadata:
      labels:
        app: comp4000
        component: server
    spec:
      containers:
      - name: comp4000server
        image: wpfindlay/comp4000-ex1:server-latest
        imagePullPolicy: Always
        ports:
        - containerPort: 4000

---

apiVersion: v1
kind: Pod
metadata:
  labels:
    app: comp4000
    component: client
  name: comp4000client
spec:
  containers:
  - name: comp4000client
    image: wpfindlay/comp4000-ex1:client-latest
    imagePullPolicy: Always
    command:
    - sleep
    - infinity
  restartPolicy: Never

---

apiVersion: v1
kind: Service
metadata:
  labels:
    app: comp4000
  name: comp4000port
spec:
  type: NodePort
  selector:
    app: comp4000
    component: server
  ports:
  - protocol: TCP
    port: 80
    targetPort: 4000
