apiVersion: v1
kind: Service
metadata:
  name: openspeedtest
  namespace: home-apps
spec:
  ports:
  - port: 80
    targetPort: 3000
  selector:
    app: openspeedtest
---

apiVersion: apps/v1
kind: Deployment
metadata:
  name: openspeedtest
spec:
  revisionHistoryLimit: 2
  selector:
    matchLabels:
      app: openspeedtest
  replicas: 1
  template:
    metadata:
      labels:
        app: openspeedtest
    spec:
      containers:
      - name: openspeedtest
        image: openspeedtest/latest
        resources:
            requests:
              cpu: 100m
              memory: 500Mi
            limits:
              cpu: 200m
              memory: 1Gi
        ports:
        - containerPort: 3000
---

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: openspeedtest-ingress
  annotations:
    kubernetes.io/ingress.class: "nginx"
    kubernetes.io/tls-acme: "true"
    cert-manager.io/cluster-issuer: "letsencrypt-prod"
    nginx.ingress.kubernetes.io/auth-url: "https://id.junv.me/oauth2/auth"
    nginx.ingress.kubernetes.io/auth-signin: "https://id.junv.me/oauth2/start?rd=https%3A%2F%2F$host$request_uri"
    nginx.ingress.kubernetes.io/whitelist-source-range: "192.168.1.0/24"
spec:
  tls:
  - hosts:
    - fast.junv.me
    secretName: openspeedtest-tls
  rules:
  - host: fast.junv.me
    http:
      paths:
      - backend:
          service:
            name: openspeedtest
            port:
              number: 80
        path: /
        pathType: Prefix
