digitalocean / Kubernetes-Starter-Kit-Developers

Hands-on tutorial and Automation stack for an operations-ready DigitalOcean Kubernetes (DOKS) cluster.
745 stars 258 forks source link

Nginx ingress chapter host rules point to the wrong service port #151

Closed v-ctiutiu closed 2 years ago

v-ctiutiu commented 2 years ago

Description

As per discussion #149 seems that a mistake slipped, and nginx rules used in the ingress chapter point to the container port (8080). Nginx ingress controller rules should point to service port, not container port.

The echo deployment spec looks like below:

...
spec:
    containers:
      - name: echo
        image: jmalloc/echo-server
        ports:
          - name: http
            containerPort: 8080
...

The echo service spec looks like below:

...
spec:
  ports:
    - name: http
      port: 80
      targetPort: 8080
...

The ingress host rule spec for the echo service should look like:

...
spec:
  rules:
    - host: echo.starter-kit.online
      http:
        paths:
          - path: /
            pathType: Prefix
            backend:
              service:
                name: echo
                port:
                  number: 80
...