apiVersion: apps/v1
kind: Deployment
metadata:
  name: signaler-deployment
  labels:
    app: signaler
spec:
  replicas: 1
  selector:
    matchLabels:
      app: signaler
  template:
    metadata:
      labels:
        app: signaler
        app.kubernetes.io/name: signaler-pods
    spec:
      containers:
      - name: signaler
        image: us-central1-docker.pkg.dev/home-sensors-400805/signaler/image:$VERSION
        command:
        - /signaler
        ports:
        - containerPort: 8080
        livenessProbe:
          httpGet:
            path: /metrics
            port: 8080
            scheme: HTTPS
          initialDelaySeconds: 3
          periodSeconds: 3
        readinessProbe:
          httpGet:
            path: /metrics
            port: 8080
            scheme: HTTPS
          initialDelaySeconds: 3
          periodSeconds: 3
---
apiVersion: v1
kind: Service
metadata:
  name: signaler-service
  annotations:
    cloud.google.com/app-protocols: '{"my-port":"HTTP2"}'
spec:
  selector:
    app.kubernetes.io/name: signaler-pods
  ports:
    - name: my-port
      protocol: TCP
      port: 8080
      targetPort: 8080
      appProtocol: HTTP2
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: signaler-ingress
  annotations:
    kubernetes.io/ingress.global-static-ip-name: signaler
    networking.gke.io/managed-certificates: managed-cert
    kubernetes.io/ingress.class: "gce"
spec:
  rules:
  - http:
      paths:
      - path: /signaler.SignalerService
        pathType: Prefix
        backend:
          service:
            name: signaler-service
            port:
              number: 8080
---
apiVersion: networking.gke.io/v1
kind: ManagedCertificate
metadata:
  name: managed-cert
spec:
  domains:
    - home.chathaway.codes
    - www.home.chathaway.codes
---
apiVersion: cloud.google.com/v1
kind: BackendConfig
metadata:
  name: my-bsc-backendconfig
spec:
  timeoutSec: 40