Skip to content

Commit 83a893e

Browse files
authored
Fix: remove ingress trait parameter ingressClassName, use k8s default class (#110)
Signed-off-by: xingcan-ltc <xingcan.hu@hotmail.com>
1 parent c64da64 commit 83a893e

File tree

4 files changed

+16
-19
lines changed

4 files changed

+16
-19
lines changed

catalog/flink/x-definitions/app-streampark.cue

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,6 @@ template: {
236236
},
237237
{
238238
properties: {
239-
ingressClassName: parameter.ingressClassName
240239
stickySession: true
241240
service: {
242241
ports: [
@@ -370,10 +369,6 @@ template: {
370369
}
371370
}
372371

373-
// +ui:description=配置访问 Ingress 地址的 IngressClass, 如果您不清楚IngressClass,请勿随意更改
374-
// +ui:order=4
375-
ingressClassName: *"kong" | string
376-
377372
// +ui:description=镜像版本
378373
// +ui:options={"disabled": true}
379374
// +ui:order=5

catalog/hue/x-definitions/app-hue.cue

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,6 @@ template: {
275275

276276
{
277277
properties: {
278-
ingressClassName: parameter.ingressClassName
279278
stickySession: true
280279
service: {
281280
ports: [
@@ -444,10 +443,6 @@ template: {
444443
}
445444
}
446445

447-
// +ui:description=配置访问 Ingress 地址的 IngressClass, 如果您不清楚IngressClass,请勿随意更改
448-
// +ui:order=4
449-
ingressClassName: *"kong" | string
450-
451446
// +ui:description=容器镜像
452447
// +ui:options={"disabled": true}
453448
// +ui:order=5

infra/kdp-core/definitions/trait-bdos-ingress.cue

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ import "strings"
1313
template: {
1414
import ("strings")
1515

16+
// could be "kong" or "nginx" ...
17+
_ingressClassName: ""
1618
// declare _ingressName
1719
_ingressName: string
1820
if parameter.ingressName != _|_ {
@@ -77,7 +79,9 @@ template: {
7779
}
7880

7981
spec: {
80-
ingressClassName: parameter.ingressClassName
82+
if _ingressClassName != _|_ && _ingressClassName != "" {
83+
ingressClassName: _ingressClassName
84+
}
8185
rules: [
8286
for v in parameter.rules {
8387
_rule_domain: *v.host | string
@@ -138,11 +142,13 @@ template: {
138142
"\(k)": v
139143
}
140144
}
145+
141146
// KongIngress CR
142-
if parameter.stickySession && parameter.ingressClassName == "kong"{
147+
if parameter.stickySession && _ingressClassName == "kong"
148+
// nginxIngress CR
149+
{
143150
"konghq.com/override": context.name + "-sticky-session"
144151
}
145-
// nginxIngress CR
146152
}
147153
metalabels: {
148154
"app": context.name
@@ -169,10 +175,11 @@ template: {
169175

170176
}
171177

172-
173178
outputs: {
174179
// KongIngress CR
175-
if parameter.stickySession && parameter.ingressClassName == "kong"{
180+
if parameter.stickySession && _ingressClassName == "kong"
181+
// nginxIngress CR
182+
{
176183
"kongIngress": {
177184
apiVersion: "configuration.konghq.com/v1"
178185
kind: "KongIngress"
@@ -189,16 +196,14 @@ template: {
189196
}
190197
}
191198
}
192-
// nginxIngress CR
193199
}
194200

195201
parameter: {
196202
namespace?: *"default" | string
197203
ingressName?: string
198204
gateway?: [string]: string
199205
annotations?: [string]: string
200-
ingressClassName: *"kong" | string
201-
stickySession: *false | bool
206+
stickySession: *false | bool
202207
service?: {
203208
serviceName?: string
204209
annotations?: [string]: string

infra/kong/template.cue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,9 @@ _kong: {
5959
repository: "\(parameter.registry)/kong/kubernetes-ingress-controller"
6060
tag: "2.12"
6161
ingressClass: "kong"
62-
ingressClassAnnotations: {}
62+
ingressClassAnnotations: {
63+
"ingressclass.kubernetes.io/is-default-class": "true"
64+
}
6365
}
6466
waitImage: {
6567
enabled: true

0 commit comments

Comments
 (0)