You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: documentation/custom-resource-tcp.md
+30Lines changed: 30 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -35,6 +35,8 @@ kind: TCP
35
35
metadata:
36
36
name: tcp-1
37
37
namespace: test
38
+
annotations:
39
+
ingress.class: haproxy
38
40
spec:
39
41
- name: tcp-http-echo-8443
40
42
frontend:
@@ -103,6 +105,30 @@ Note that in the TCP CR :
103
105
104
106
Except the frontend keyword `default_backend`, all other lines are not automatically generated but are in a flexible way handled by the `frontend` section in the TCP CR.
105
107
108
+
## ingress.class
109
+
110
+
Starting `3.1`, the TCP Custom Resource managed by the Ingress Controller can be filtered using the `ingress.class` annotation.
| '' (not set) | * (any value) | TCP CR managed by IC |
116
+
| \<igclass\> | Same value as controller | TCP CR managed by IC |
117
+
| \<igclass\> | Value different from controller | TCP CR not managed by IC, frontend and backend deleted if existing |
118
+
| \<igclass\> | '' (empty, not set)| if controller `empty-ingress-class` flag is set, TCP CR managed by IC, otherwise ignored (and frontend and backend are deleted)|
119
+
120
+
121
+
### Migration 3.0 to 3.1: action required regarding ingress.class annotation
122
+
123
+
If some TCP CRs were deployed with Ingress Controller version <= v3.0, and the Ingress Controller has a `ingress.class` flag for the controller, the TCP CRs need to have the same value for the `ingress.class` annotation in the TCP CR.
124
+
125
+
If the annotation is not set, the corresponding backends and frontends in the haproxy configuration would be deleted:
126
+
- except if the controller `empty-ingress-class` flag is set (same behavior as for `Ingress`).
127
+
128
+
The setting of the `ingress.class` to the TCP CRs should be done **prior to the upgrade to** `v3.1`. It will not be used in v3.0 but needs to be there starting v3.1.
129
+
130
+
131
+
106
132
## Pod and Service definitions
107
133
108
134
with the following Kubernetes Service and Pod manifests:
// Starting from 3.1, if ingress.class is set for controller, you will need to set the ingress.class annotation in the TCP CRD
70
+
// - Setting the ingress.class annotation in the TCP CRD in 3.0 is highly recommended before migration to 3.1
71
+
// - empty-ingress-class controller option will also impact TCP CRD starting 3.1
72
+
logger.Warning("Using TCP CRD without ingress.class annotation will work only in 3.0")
73
+
logger.Warning("If you are using TCP CRDS without ingress.class annotation and ingress.class is set for the controller,an action is required before migrating to 3.1")
74
+
logger.Warning("Please read https://github.com/haproxytech/kubernetes-ingress/blob/master/documentation/custom-resource-tcp.md for more information")
75
+
}
76
+
53
77
func (handlerTCPCustomResource) Update(k store.K8s, h haproxy.HAProxy, a annotations.Annotations) (errerror) {
// default: // mismatch osArgs.Ingress and TCP IngressClass annotation
359
+
// if tcpIgClassAnn == "" {
360
+
// supported = handler.allowEmptyIngressClass
361
+
// if !supported {
362
+
// utils.GetLogger().Warningf("[SKIP] TCP %s/%s ingress.class annotation='%s' does not match with controller ingress.class flag '%s' and controller flag 'empty-ingress-class' is false",
0 commit comments