apiVersion: apps/v1
kind: Deployment
metadata:
  name: app-reader-deployment
  labels:
    app: app-reader
spec:
  replicas: 3
  selector:
    matchLabels:
      app: app-reader
  template:
    metadata:
      labels:
        app: app-reader
    spec:
      containers:
        - name: app-reader
          imagePullPolicy: Never
          image: jre-app-reader-image:1.0.0
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: app-writer-deployment
  labels:
    app: app-writer
spec:
  replicas: 3
  selector:
    matchLabels:
      app: app-writer
  template:
    metadata:
      labels:
        app: app-writer
    spec:
      containers:
        - name: app-writer
          imagePullPolicy: Never
          image: jre-app-writer-image:1.0.0
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: app-rest-api-deployment
  labels:
    app: app-rest-api
spec:
  replicas: 1
  selector:
    matchLabels:
      app: app-rest-api
  template:
    metadata:
      labels:
        app: app-rest-api
    spec:
      containers:
        - name: app-rest-api
          imagePullPolicy: Never
          image: jre-app-rest-api-image:1.0.0
          ports:
            - containerPort: 80
---
apiVersion: v1
kind: Service
metadata:
  name: app-rest-api-service
spec:
  selector:
    app: app-rest-api
  type: LoadBalancer
  ports:
    - protocol: TCP
      port: 9092
      targetPort: 80
      nodePort: 30001
