---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: kms-vlmcsd-ingress
  annotations:
    cert-manager.io/cluster-issuer: cm-cloudflare-7421
spec:
  ingressClassName: traefik
  rules:
    - host: kms.k3s.ig.107421.xyz
      http:
        paths:
          - path: /
            pathType: ImplementationSpecific
            backend:
              service:
                name: vlmcsd-svc
                port:
                  number: 1688
  tls:
    - hosts:
      - kms.k3s.ig.107421.xyz
      secretName: kms.k3s.ig.107421.xyz-tls
---
kind: Service
apiVersion: v1
metadata:
  name: vlmcsd-svc
  namespace: default
spec:
  selector:
    app: vlmcsd-2021-11-19
  type: NodePort
  ports:
    - port: 1688
      targetPort: 1688
      nodePort: 21000
      name: http

---
kind: Deployment
apiVersion: apps/v1
metadata:
  name: vlmcsd-2021-11-19
  namespace: default
spec:
  selector:
    matchLabels:
      app: vlmcsd-2021-11-19
  replicas: 1
  template:
    metadata:
      labels:
        app: vlmcsd-2021-11-19
    spec:
      affinity:
        nodeAffinity:
          requiredDuringSchedulingIgnoredDuringExecution:
            nodeSelectorTerms:
              - matchExpressions:
                  - key: kubernetes.io/hostname
                    operator: In
                    values:
                      - node-tokyo-2
      containers:
        - name: vlmcsd
          image: icederce/vmlcsd:2021-11-19
          imagePullPolicy: IfNotPresent
          ports:
            - containerPort: 1688
              name: http
