Last active
October 3, 2019 15:50
-
-
Save danmaas/c432784885c29561be35be34fd67c88f to your computer and use it in GitHub Desktop.
Singleton ALB ingress controller fronting Nginx for Amazon EKS
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: extensions/v1beta1 | |
kind: Ingress | |
metadata: | |
name: "myALB" | |
labels: | |
app: "myALBApp" | |
annotations: | |
# trigger the alb-ingress-controller | |
kubernetes.io/ingress.class: "alb" | |
# set ALB parameters | |
alb.ingress.kubernetes.io/scheme: "internet-facing" | |
alb.ingress.kubernetes.io/target-type: "instance" | |
alb.ingress.kubernetes.io/security-groups: my-security-group-ids, ... | |
alb.ingress.kubernetes.io/subnets: my-vpc-subnets, ... | |
alb.ingress.kubernetes.io/certificate-arn: my-acm-certificate-arn | |
alb.ingress.kubernetes.io/listen-ports: '[{"HTTP":80,"HTTPS": 443}]' | |
# allow 404s on the health check | |
alb.ingress.kubernetes.io/healthcheck-path: "/" | |
alb.ingress.kubernetes.io/success-codes: "200,404" | |
spec: | |
# forward all requests to nginx-ingress-controller | |
rules: | |
- http: | |
paths: | |
- path: "/*" | |
backend: | |
serviceName: "nginx-ingress-controller" | |
servicePort: 80 | |
Sorry, I don't have a complete example. Regarding namespaces, nginx-controller's Ingress routing can "see through" namespace boundaries (in the default configuration), so as long as the ALB can see nginx, then the underlying services can be in other namespaces.
Following the example, I get failed to reconcile targetGroups due to failed to load serviceAnnotation due to no object matching key
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Is there a suitable full example for this? We tried this and found out nginx-controller was in its own namespace and thus neverfound...