File tree Expand file tree Collapse file tree 5 files changed +43
-26
lines changed
test/chart-no-desc/templates Expand file tree Collapse file tree 5 files changed +43
-26
lines changed Original file line number Diff line number Diff line change
1
+ changelog :
2
+ - type : FIX
3
+ issueLink : https://github.com/solo-io/gloo-mesh-enterprise/issues/11314
4
+ resolvesIssue : false
5
+ description : Use custom type for readiness probe to allow passing in templates for values.
Original file line number Diff line number Diff line change @@ -781,13 +781,9 @@ var _ = Describe("Cmd", func() {
781
781
Value : "BAR" ,
782
782
},
783
783
},
784
- ReadinessProbe : & v1.Probe {
785
- ProbeHandler : v1.ProbeHandler {
786
- HTTPGet : & v1.HTTPGetAction {
787
- Path : "/" ,
788
- Port : intstr .FromInt (8080 ),
789
- },
790
- },
784
+ ReadinessProbe : & ReadinessProbe {
785
+ Path : "/" ,
786
+ Port : "8080" ,
791
787
PeriodSeconds : 10 ,
792
788
InitialDelaySeconds : 5 ,
793
789
},
@@ -944,13 +940,9 @@ var _ = Describe("Cmd", func() {
944
940
Value : "BAR" ,
945
941
},
946
942
},
947
- ReadinessProbe : & v1.Probe {
948
- ProbeHandler : v1.ProbeHandler {
949
- HTTPGet : & v1.HTTPGetAction {
950
- Path : "/" ,
951
- Port : intstr .FromInt (8080 ),
952
- },
953
- },
943
+ ReadinessProbe : & ReadinessProbe {
944
+ Path : "/" ,
945
+ Port : "8080" ,
954
946
PeriodSeconds : 10 ,
955
947
InitialDelaySeconds : 5 ,
956
948
},
@@ -1532,13 +1524,8 @@ roleRef:
1532
1524
Value : "BAR" ,
1533
1525
},
1534
1526
},
1535
- ReadinessProbe : & v1.Probe {
1536
- ProbeHandler : v1.ProbeHandler {
1537
- HTTPGet : & v1.HTTPGetAction {
1538
- Path : "/" ,
1539
- Port : intstr .FromInt (8080 ),
1540
- },
1541
- },
1527
+ ReadinessProbe : & ReadinessProbe {
1528
+ Exec : []string {"redis-cli" , "ping" },
1542
1529
PeriodSeconds : 10 ,
1543
1530
InitialDelaySeconds : 5 ,
1544
1531
},
Original file line number Diff line number Diff line change @@ -124,7 +124,7 @@ type Container struct {
124
124
// not configurable via helm values
125
125
Args []string
126
126
VolumeMounts []corev1.VolumeMount
127
- ReadinessProbe * corev1. Probe
127
+ ReadinessProbe * ReadinessProbe
128
128
LivenessProbe * corev1.Probe
129
129
130
130
Image Image
@@ -133,6 +133,14 @@ type Container struct {
133
133
SecurityContext * corev1.SecurityContext
134
134
}
135
135
136
+ type ReadinessProbe struct {
137
+ Exec []string // optional: if specified, the readiness probe will be an exec probe with the specified commands
138
+ Path string // Path to access on the HTTP server. Either specify Path and Port for httpGet probes, or specify Exec
139
+ Port string
140
+ PeriodSeconds int
141
+ InitialDelaySeconds int
142
+ }
143
+
136
144
// sidecars require a container config and a unique name
137
145
type Sidecar struct {
138
146
Container
Original file line number Diff line number Diff line change @@ -151,7 +151,23 @@ spec:
151
151
{{- end }}
152
152
[[- if $container.ReadinessProbe ]]
153
153
readinessProbe:
154
- [[ toYaml $container.ReadinessProbe | indent 10 ]]
154
+ [[- if $container.ReadinessProbe.Exec ]]
155
+ exec:
156
+ command:
157
+ [[- range $command := $container.ReadinessProbe.Exec ]]
158
+ - [[ $command ]]
159
+ [[- end ]]
160
+ [[- else ]]
161
+ httpGet:
162
+ path: [[ $container.ReadinessProbe.Path ]]
163
+ port: [[ $container.ReadinessProbe.Port ]]
164
+ [[- end ]]
165
+ [[- if $container.ReadinessProbe.InitialDelaySeconds ]]
166
+ initialDelaySeconds: [[ $container.ReadinessProbe.InitialDelaySeconds ]]
167
+ [[- end ]]
168
+ [[- if $container.ReadinessProbe.PeriodSeconds ]]
169
+ periodSeconds: [[ $container.ReadinessProbe.PeriodSeconds ]]
170
+ [[- end ]]
155
171
[[- end ]]
156
172
[[- if $container.LivenessProbe ]]
157
173
livenessProbe:
Original file line number Diff line number Diff line change 90
90
- ALL
91
91
{{- end }}
92
92
readinessProbe :
93
- httpGet :
94
- path : /
95
- port : 8080
93
+ exec :
94
+ command :
95
+ - redis-cli
96
+ - ping
96
97
initialDelaySeconds : 5
97
98
periodSeconds : 10
98
99
{{- $palette := $.Values.painter.sidecars.palette }}
You can’t perform that action at this time.
0 commit comments