Dockerfile to add the Signal Sciences NGINX module into the stock Kubernetes NGINX ingress controller image (https://github.com/kubernetes/ingress-nginx)
Prebuilt images hosted here: https://hub.docker.com/repository/docker/signalsciences/sigsci-nginx-ingress-controller
Tags/Releases track image tags of the upstream docker repo. These images work as drop-in replacements for:
registry.k8s.io/ingress-nginx/controller
images with corresponding tags
NGINX, Inc.
Use Dockerfile.nginxinc
if you want to add the Signal Sciences NGINX module into the stock nginxinc/kubernetes-ingress image (https://github.com/nginxinc/kubernetes-ingress)
Prebuilt images are hosted here: https://hub.docker.com/repository/docker/signalsciences/sigsci-nginxinc-ingress-controller
The following are steps to install kubernetes/ingress-nginx via helm using the sigsci-values.yaml override file. This adds the custom sigsci-nginx-ingress-controller and sigsci-agent.
-
Add the kubernetes/ingress-nginx repo
helm repo add ingress-nginx https://kubernetes.github.io/ingress-nginx
-
Add
SIGSCI_ACCESSKEYID
andSIGSCI_SECRETACCESSKEY
to the sigsci-values.yaml file. -
Install with the release name
my-ingress
in thedefault
namespace
helm install -f sigsci-values.yaml my-ingress ingress-nginx/ingress-nginx
- You can specify a namespace with
-n
flag:
helm install -n NAMESPACE -f sigsci-values.yaml my-ingress ingress-nginx/ingress-nginx
- Create an Ingress resource. This step will vary depending on setup and supports a lot of configurations. Official documentation can be found regarding Basic usage - host based routing
Here is an example Ingress file:
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
annotations:
kubernetes.io/ingress.class: nginx
nginx.ingress.kubernetes.io/rewrite-target: /
name: hello-kubernetes-ingress
#namespace: SET THIS IF NOT IN DEFAULT NAMESPACE
spec:
rules:
- host: example.com
http:
paths:
- pathType: Prefix
path: /testpath
backend:
service:
name: NAME OF YOUR SERVICE
port:
number: 80
Follow these steps to install nginxinc/kubernetes-ingress with the sigsci-nginxinc-values.yaml override file. This will add the custom sigsci-nginx-ingress-controller and sigsci-agent.
-
Add the nginxinc/kubernetes-ingress repo
helm repo add nginx-stable https://helm.nginx.com/stable
-
Add
SIGSCI_ACCESSKEYID
andSIGSCI_SECRETACCESSKEY
to the sigsci-nginxinc-values.yaml file. -
Install with helm
helm install -f sigsci-nginxinc-values.yaml my-ingress nginx-stable/nginx-ingress
- You can specify a namespace with
-n
flag:
helm install -n NAMESPACE -f sigsci-nginxinc-values.yaml my-ingress nginx-stable/nginx-ingress
- Create an Ingress resource. This step will vary depending on setup and supports a lot of configurations. Official documentation can be found regarding Basic usage - host based routing
Here is an example Ingress file for the nginxinc/kubernetes-ingress controller:
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: cafe-ingress
spec:
tls:
- hosts:
- cafe.example.com
secretName: cafe-secret
rules:
- host: cafe.example.com
http:
paths:
- path: /tea
pathType: Prefix
backend:
service:
name: tea-svc
port:
number: 80
- path: /coffee
pathType: Prefix
backend:
service:
name: coffee-svc
port:
number: 80
- Now you are ready to setup rules, rate limits and more using Signal Sciences
To update the ingress-nginx charts or kubernetes-ingress charts
- Update the sigsci-nginx-ingress-controller to the latest version in the sigsci-values.yaml or sigsci-nginxinc-values.yaml file
controller:
# Replaces the default nginx-controller image with a custom image that contains the Signal Sciences nginx Module
image:
repository: signalsciences/sigsci-nginx-ingress-controller
tag: "1.10.0"
pullPolicy: IfNotPresent
- Then run helm upgrade with override file. This example is running helm upgrade against the
my-ingress
release created in step 3 of the previous section.
helm upgrade -f sigsci-values.yaml my-ingress ingress-nginx/ingress-nginx
orhelm upgrade -f sigsci-nginxinc-values.yaml my-ingress nginx-stable/nginx-ingress
depending on your upstream ingress controller
- If ingress is not in default namespace use
-n
to specify namespace:
helm upgrade -n NAMESPACE -f sigsci-values.yaml my-ingress ingress-nginx/ingress-nginx
orhelm upgrade -n NAMESPACE -f sigsci-nginxinc-values.yaml my-ingress nginx-stable/nginx-ingress
Uninstall release my-ingress
in default
namespace:
helm uninstall my-ingress
If not in default namespace use -n
to specify namesapce:
helm uninstall -n NAMESPACE my-ingress