# Deployment 1
apiVersion: apps/v1
kind: Deployment
metadata:
  name: hello-world
  labels:
    app: hello-world
spec:
  replicas: 1
  selector:
    matchLabels:
      app: hello-world
  template:
    metadata:
      labels:
        app: hello-world
    spec:
      containers:
      - name: hello-world
        image: k8s.gcr.io/echoserver:1.4
        ports:
        - containerPort: 8080
---
# Service 1
apiVersion: v1
kind: Service
metadata:
  name: hello-world
spec:
  ports:
  - port: 8080
  selector:
    app: hello-world
---
# Ingress 1
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: hello-world
  namespace: default
  annotations:
    cert-manager.io/cluster-issuer: "cert-manager"
spec:
  tls:
  - hosts:
    - demo.DOMAIN.com
    secretName: demo-key
  rules:
  - host: "demo.DOMAIN.com"
    http:
      paths:
      - pathType: Prefix
        path: "/"
        backend:
          service:
            name: hello-world
            port:
              number: 8080
---
# Deployment 2
apiVersion: apps/v1
kind: Deployment
metadata:
  name: hello-universe
  labels:
    app: hello-universe
spec:
  replicas: 1
  selector:
    matchLabels:
      app: hello-universe
  template:
    metadata:
      labels:
        app: hello-universe
    spec:
      containers:
      - name: hello-universe
        image: mpetason/hello-universe
        ports:
        - containerPort: 8080
---
# Service 2
apiVersion: v1
kind: Service
metadata:
  name: hello-universe
spec:
  ports:
  - port: 8080
  selector:
    app: hello-universe
---
# Ingress 2
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: hello-world
  namespace: default
  annotations:
    cert-manager.io/cluster-issuer: "cert-manager"
spec:
  tls:
  - hosts:
    - demo.DOMAIN.com
    secretName: demo-key
  rules:
  - host: "demo.DOMAIN.com"
    http:
      paths:
      - pathType: Prefix
        path: "/"
        backend:
          service:
            name: hello-world
            port:
              number: 8080
      - pathType: Prefix
        path: /hello-universe
        backend:
          service:
            name: hello-universe
            port:
              number: 8080
