apiVersion: apps/v1
kind: Deployment
metadata:
  name: hamburger
spec:
  selector:
    matchLabels:
      app: hamburger
  replicas: 1
  template:
    metadata:
      labels:
        app: hamburger
    spec:
      containers:
        - name: hamburger
          image: registry.yaemiku.dev/yaemiku/hamburger
          ports:
            - name: app-port
              containerPort: 3000
          resources:
            requests:
              memory: "64Mi"
              cpu: "250m"
            limits:
              memory: "128Mi"
              cpu: "500m"
      imagePullSecrets:
        - name: regcred

---
apiVersion: v1
kind: Service
metadata:
  name: hamburger
spec:
  ports:
    - name: app-svc-port
      port: 80
      targetPort: app-port
  selector:
    app: hamburger

---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: hamburger
spec:
  ingressClassName: traefik
  rules:
    - host: yaemiku.dev
      http:
        paths:
          - path: /
            pathType: Prefix
            backend:
              service:
                name: hamburger
                port:
                  number: 80
    - host: www.yaemiku.dev
      http:
        paths:
          - path: /
            pathType: Prefix
            backend:
              service:
                name: hamburger
                port:
                  number: 80