Created
May 3, 2021 17:20
-
-
Save haproxytechblog/343ab8f71290fcc5dc64a276b3411610 to your computer and use it in GitHub Desktop.
Announcing HAProxy Kubernetes Ingress Controller 1.6
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
| backend-config-snippet: | | |
| http-request deny if !{ src 127.0.0.1 10.0.0.0/8 1.2.3.4/24 } |
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
| backend-config-snippet: | | |
| http-request set-header Exp-Date 1619481600 if !{ hdr(Key) Katotosh6Rae } | |
| http-request set-header Exp-Date 1619568000 if !{ hdr(Key) laeP2oweu0ri } | |
| http-request set-header Exp-Date 1619654400 if !{ hdr(Key) Xaib0ovao3ae } |
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
| $ cat /tmp/ips.acl | |
| 127.0.0.1 | |
| 10.0.0.0/8 | |
| 1.2.3.4/24 | |
| $ cat /tmp/keys.map | |
| Katotosh6Rae 1619481600 | |
| laeP2oweu0ri 1619568000 | |
| Xaib0ovao3ae 1619654400 | |
| $ kubectl create -n default configmap staging-patterns \ | |
| --from-file=/tmp/ips.acl \ | |
| --from-file=/tmp/keys.map | |
| configmap/staging-patterns created |
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: v1 | |
| kind: ConfigMap | |
| metadata: | |
| name: staging-patterns | |
| namespace: default | |
| data: | |
| ips.acl: | | |
| 127.0.0.1 | |
| 10.0.0.0/8 | |
| 1.2.3.4/24 | |
| keys.map: | | |
| Katotosh6Rae 1619481600 | |
| laeP2oweu0ri 1619568000 | |
| Xaib0ovao3ae 1619654400 |
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
| $ helm install kubernetes-ingress haproxytech/kubernetes-ingress \ | |
| --set-string "controller.extraArgs={--configmap-patternfiles=default/staging-patterns}" |
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
| backend-config-snippet: | | |
| http-request deny if !{ src -f patterns/ips.acl } | |
| backend-config-snippet: | | |
| http-request set-header Exp-Date hdr(key),map(patterns/keys.map) | |
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
| resolvers mydns | |
| nameserver local 127.0.0.1:53 | |
| nameserver google 8.8.8.8:53 |
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
| $ kubectl create configmap haproxy-aux-cfg \ | |
| --from-file ./haproxy-aux.cfg | |
| configmap/haproxy-aux-cfg created |
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
| containers: | |
| - name: haproxy-ingress | |
| image: haproxytech/kubernetes-ingress:latest | |
| volumeMounts: | |
| - name: haproxy-cfg-vol | |
| mountPath: /etc/haproxy/haproxy-aux.cfg | |
| volumes: | |
| - name: haproxy-cfg-vol | |
| configMap: | |
| name: haproxy-aux-cfg |
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
| backend-config-snippet: default-server init-addr none resolvers mydns |
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
| request-set-header: client-cn %[ssl_c_s_dn(CN)] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment