Nginx Ingress Controller

Nginx Ingress Controller is a type of Ingress controller that uses ConfigMap to store the Nginx configuration.

The Nginx Ingress Controller is a type of Ingress Controller (think “Load Balancer”) that uses a ConfigMap to store the Nginx configuration.

Dependencies

None

Install

You can install the nginx-ingress controller in few different ways, but we recommend to use the Master Helmfile.

Install using Master Helmfile

Follow these instructions:

Install Ingress

chamber write kops NGINX_INGRESS_HOSTNAME ingress.us-west-2.staging.example.com
chamber exec kops -- helmfile -f /conf/kops/helmfile.yaml --selector namespace=kube-system,chart=nginx-ingress sync

These environment variables are supported by the Nginx Ingress in the Master Helmfile:

Environment variables can be specified in Geodesic Module Dockerfile or in Chamber storage.

Install with custom Helmfile

Add to your Kubernetes Backing Services Helmfile this code

helmfile.yaml

repositories:
- name: cloudposse-incubator
  url: https://charts.cloudposse.com/incubator/

releases:
- name: ingress
  namespace: kube-system
  labels:
    job: kube-system
  chart: cloudposse-incubator/nginx-ingress
  version: 0.1.7
  set:
  - name: replicaCount
    value: 4
  - name: resources.limits.cpu
    value: 20m
  - name: resources.limits.memory
    value: 256Mi
  - name: resources.requests.cpu
    value: 10m
  - name: resources.requests.memory
    value: 128Mi
  - name: nginx-default-backend.replicaCount
    value: 2
  - name: nginx-default-backend.resources.limits.cpu
    value: 2m
  - name: nginx-default-backend.resources.limits.memory
    value: 5Mi
  - name: nginx-default-backend.resources.requests.cpu
    value: 1m
  - name: nginx-default-backend.resources.requests.memory
    value: 3Mi

Then do Helmfile sync follow instructions

Usage

After the ingress controller is installed, you can create Ingress Resources with kubectl or specifying them in Helm Chart values directly or with Helmfile.

Here are some examples:

ingress.yaml

apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: chartmuseum
spec:
  rules:
  - host: example.com
    http:
      paths:
      - path: /
        backend:
          serviceName: chartmuseum-service
          servicePort: 80

values.yaml

ingress:
  enabled: true
  hosts:
    example.com:
        - /

helmfile.yaml

repositories:
- name: stable
  url: https://kubernetes-charts.storage.googleapis.com

releases:
- name: charts
  chart: stable/chartmuseum
  version: 1.3.1
  set:
  - name: ingress.enabled
    value: true
  - name: ingress.hosts.example\.com[0]
    value: /

Note

There is no unified specification for helm chart values structure. Different charts may have very different structures to values. The only way to know for sure what is supported is to refer to the chart manifests.

The examples provided here are based on the stable/chartmuseum chart https://github.com/kubernetes/charts/blob/master/stable/chartmuseum