apiVersion: apps/v1 kind: Deployment # This describes the actual deployment: metadata: name: next-semver-deployment labels: app: next-semver spec: replicas: 1 template: # This describes what pods to create: metadata: labels: app: next-semver spec: containers: - name: next-semver-pod image: "mverleg/next_semver:latest" imagePullPolicy: Always # This describes which pods are part of the deployment, # so this should match 'metadata' in almost all cases: selector: matchLabels: app: next-semver --- apiVersion: v1 kind: Service metadata: name: next-semver-service labels: app: next-semver spec: type: ClusterIP ports: # port of pod to contact - targetPort: 8080 # within the cluster (ClusterIP is inside-only) port: 8080 selector: app: next-semver --- apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: next-semver-service annotations: kubernetes.io/ingress.class: "nginx" nginx.ingress.kubernetes.io/ssl-redirect: "true" nginx.ingress.kubernetes.io/hsts: "true" cert-manager.io/cluster-issuer: "letsencrypt-prod" nginx.ingress.kubernetes.io/server-alias: "*.next.tryin.top" nginx.ingress.kubernetes.io/configuration-snippet: | if ($host = 'www.next.tryin.top' ) { rewrite ^ https://next.tryin.top$request_uri permanent; } rewrite ^(.*)/index\.html?$ $1/ permanent; rewrite ^((?:.*/)?[^./]*[^/])$ $1/ permanent; spec: tls: - hosts: - next.tryin.top - www.next.tryin.top secretName: next-tryin-top-tls rules: - host: next.tryin.top http: paths: - path: / pathType: Prefix backend: service: name: next-semver-service port: number: 8080