apiVersion: apps/v1
kind: Deployment
metadata:
  name: nats
spec:
  replicas: 1
  selector:
    matchLabels:
      app: nats
  template:
    metadata:
      name: nats
      labels:
        app: nats
    spec:
      containers:
        - name: nats
          image: nats:2.9.15
          ports:
            - name: nats
              containerPort: 4222
              protocol: TCP
          resources:
            requests:
              cpu: 1
              memory: 1Gi
            limits:
              cpu: 2
              memory: 2Gi
---
apiVersion: v1
kind: Service
metadata:
  name: nats
  labels:
    app.kubernetes.io/name: nats
spec:
  selector:
    app: nats
  type: ClusterIP
  ports:
    - name: nats
      protocol: TCP
      port: 4222
      targetPort: 4222
---
apiVersion: route.openshift.io/v1
kind: Route
metadata:
  name: nats
  labels:
    app.kubernetes.io/name: tawonnats
spec:
  port:
    targetPort: ws
  tls:
    termination: passthrough
  to:
    kind: Service
    name: nats
    weight: 100
  wildcardPolicy: None
