Created
June 10, 2022 17:33
-
-
Save haproxytechblog/301baef264bed186e09b724b2919ece1 to your computer and use it in GitHub Desktop.
Custom Resources with HAProxy Kubernetes Ingress Controller
This file contains 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 api-resources | |
NAME SHORTNAMES APIVERSION NAMESPACED KIND | |
bindings v1 true Binding | |
componentstatuses cs v1 false ComponentStatus | |
configmaps cm v1 true ConfigMap | |
endpoints ep v1 true Endpoints | |
events ev v1 true Event | |
limitranges limits v1 true LimitRange | |
namespaces ns v1 false Namespace | |
nodes no v1 false Node | |
persistentvolumeclaims pvc v1 true PersistentVolumeClaim |
This file contains 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 apply -f https://cdn.haproxy.com/documentation/kubernetes/1.8/crd/backend.yaml | |
$ kubectl apply -f https://cdn.haproxy.com/documentation/kubernetes/1.8/crd/defaults.yaml | |
$ kubectl apply -f https://cdn.haproxy.com/documentation/kubernetes/1.8/crd/global.yaml |
This file contains 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 api-resources | |
NAME SHORTNAMES APIVERSION NAMESPACED KIND | |
... | |
backends core.haproxy.org/v1alpha1 true Backend | |
defaults core.haproxy.org/v1alpha1 true Defaults | |
globals core.haproxy.org/v1alpha1 true Global |
This file contains 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 get crd | |
NAME CREATED AT | |
backends.core.haproxy.org 2022-06-01T16:09:57Z | |
defaults.core.haproxy.org 2022-06-01T16:56:57Z | |
globals.core.haproxy.org 2022-06-01T16:56:57Z |
This file contains 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: "core.haproxy.org/v1alpha1" | |
kind: Global | |
metadata: | |
name: example-global | |
namespace: default | |
spec: | |
config: | |
maxconn: 60000 |
This file contains 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 apply -f example-global.yaml |
This file contains 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 get globals | |
NAME AGE | |
example-global 6d17h | |
$ kubectl describe global example-global | |
Name: example-global | |
Namespace: default | |
Labels: <none> | |
Annotations: <none> | |
API Version: core.haproxy.org/v1alpha1 | |
Kind: Global | |
... |
This file contains 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: kubernetes-ingress | |
namespace: haproxy-controller | |
data: | |
cr-global: default/example-global |
This file contains 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 apply -f myconfigmap.yaml |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment