apiVersion: v1
kind: Namespace
metadata:
  name: it-tools
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: it-tools
  namespace: it-tools
spec:
  replicas: 1
  selector:
    matchLabels:
      app: it-tools
  template:
    metadata:
      labels:
        app: it-tools
    spec:
      containers:
        - name: it-tools
          image: corentinth/it-tools:latest
          ports:
            - containerPort: 80
---
apiVersion: v1
kind: Service
metadata:
  name: it-tools
  namespace: it-tools
spec:
  selector:
    app: it-tools
  ports:
    - port: 80
      targetPort: 80
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: it-tools
  namespace: it-tools
  annotations:
    cert-manager.io/cluster-issuer: letsencrypt
spec:
  ingressClassName: traefik
  tls:
    - hosts:
        - tools.roysland.net
      secretName: it-tools-tls
  rules:
    - host: tools.roysland.net
      http:
        paths:
          - path: /
            pathType: Prefix
            backend:
              service:
                name: it-tools
                port:
                  number: 80
