Skip to content

Commit

Permalink
fix: remove container's ports field (envoyproxy#4714)
Browse files Browse the repository at this point in the history
Signed-off-by: Kebe <mail@kebe7jun.com>
  • Loading branch information
kebe7jun authored Nov 20, 2024
1 parent a924cec commit 950dde6
Show file tree
Hide file tree
Showing 39 changed files with 1 addition and 246 deletions.
21 changes: 0 additions & 21 deletions internal/infrastructure/kubernetes/proxy/resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,27 +89,6 @@ func expectedProxyContainers(infra *ir.ProxyInfra,
// Define slice to hold container ports
var ports []corev1.ContainerPort

// Iterate over listeners and ports to get container ports
for _, listener := range infra.Listeners {
for _, p := range listener.Ports {
var protocol corev1.Protocol
switch p.Protocol {
case ir.HTTPProtocolType, ir.HTTPSProtocolType, ir.TLSProtocolType, ir.TCPProtocolType:
protocol = corev1.ProtocolTCP
case ir.UDPProtocolType:
protocol = corev1.ProtocolUDP
default:
return nil, fmt.Errorf("invalid protocol %q", p.Protocol)
}
port := corev1.ContainerPort{
Name: p.Name,
ContainerPort: p.ContainerPort,
Protocol: protocol,
}
ports = append(ports, port)
}
}

if enablePrometheus(infra) {
ports = append(ports, corev1.ContainerPort{
Name: "metrics",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,6 @@ spec:
scheme: HTTP
name: envoy
ports:
- containerPort: 8080
name: EnvoyHTTPPort
protocol: TCP
- containerPort: 8443
name: EnvoyHTTPSPort
protocol: TCP
- containerPort: 19001
name: metrics
protocol: TCP
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -249,12 +249,6 @@ spec:
scheme: HTTP
name: envoy
ports:
- containerPort: 8080
name: EnvoyHTTPPort
protocol: TCP
- containerPort: 8443
name: EnvoyHTTPSPort
protocol: TCP
- containerPort: 19001
name: metrics
protocol: TCP
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -248,12 +248,6 @@ spec:
scheme: HTTP
name: envoy
ports:
- containerPort: 8080
name: EnvoyHTTPPort
protocol: TCP
- containerPort: 8443
name: EnvoyHTTPSPort
protocol: TCP
- containerPort: 19001
name: metrics
protocol: TCP
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -233,12 +233,6 @@ spec:
scheme: HTTP
name: envoy
ports:
- containerPort: 8080
name: EnvoyHTTPPort
protocol: TCP
- containerPort: 8443
name: EnvoyHTTPSPort
protocol: TCP
- containerPort: 19001
name: metrics
protocol: TCP
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -206,13 +206,6 @@ spec:
port: 19002
scheme: HTTP
name: envoy
ports:
- containerPort: 8080
name: EnvoyHTTPPort
protocol: TCP
- containerPort: 8443
name: EnvoyHTTPSPort
protocol: TCP
readinessProbe:
failureThreshold: 1
httpGet:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -252,12 +252,6 @@ spec:
scheme: HTTP
name: envoy
ports:
- containerPort: 8080
name: EnvoyHTTPPort
protocol: TCP
- containerPort: 8443
name: EnvoyHTTPSPort
protocol: TCP
- containerPort: 19001
name: metrics
protocol: TCP
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -242,12 +242,6 @@ spec:
scheme: HTTP
name: envoy
ports:
- containerPort: 8080
name: EnvoyHTTPPort
protocol: TCP
- containerPort: 8443
name: EnvoyHTTPSPort
protocol: TCP
- containerPort: 19001
name: metrics
protocol: TCP
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -233,12 +233,6 @@ spec:
scheme: HTTP
name: envoy
ports:
- containerPort: 8080
name: EnvoyHTTPPort
protocol: TCP
- containerPort: 8443
name: EnvoyHTTPSPort
protocol: TCP
- containerPort: 19001
name: metrics
protocol: TCP
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -233,12 +233,6 @@ spec:
scheme: HTTP
name: envoy
ports:
- containerPort: 8080
name: EnvoyHTTPPort
protocol: TCP
- containerPort: 8443
name: EnvoyHTTPSPort
protocol: TCP
- containerPort: 19001
name: metrics
protocol: TCP
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -252,12 +252,6 @@ spec:
scheme: HTTP
name: envoy
ports:
- containerPort: 8080
name: EnvoyHTTPPort
protocol: TCP
- containerPort: 8443
name: EnvoyHTTPSPort
protocol: TCP
- containerPort: 19001
name: metrics
protocol: TCP
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -238,12 +238,6 @@ spec:
scheme: HTTP
name: envoy
ports:
- containerPort: 8080
name: EnvoyHTTPPort
protocol: TCP
- containerPort: 8443
name: EnvoyHTTPSPort
protocol: TCP
- containerPort: 19001
name: metrics
protocol: TCP
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,6 @@ spec:
scheme: HTTP
name: envoy
ports:
- containerPort: 8080
name: EnvoyHTTPPort
protocol: TCP
- containerPort: 8443
name: EnvoyHTTPSPort
protocol: TCP
- containerPort: 19001
name: metrics
protocol: TCP
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -235,12 +235,6 @@ spec:
scheme: HTTP
name: envoy
ports:
- containerPort: 8080
name: EnvoyHTTPPort
protocol: TCP
- containerPort: 8443
name: EnvoyHTTPSPort
protocol: TCP
- containerPort: 19001
name: metrics
protocol: TCP
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -233,12 +233,6 @@ spec:
scheme: HTTP
name: envoy
ports:
- containerPort: 8080
name: EnvoyHTTPPort
protocol: TCP
- containerPort: 8443
name: EnvoyHTTPSPort
protocol: TCP
- containerPort: 19001
name: metrics
protocol: TCP
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -233,12 +233,6 @@ spec:
scheme: HTTP
name: envoy
ports:
- containerPort: 8080
name: EnvoyHTTPPort
protocol: TCP
- containerPort: 8443
name: EnvoyHTTPSPort
protocol: TCP
- containerPort: 19001
name: metrics
protocol: TCP
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -233,12 +233,6 @@ spec:
scheme: HTTP
name: envoy
ports:
- containerPort: 8080
name: EnvoyHTTPPort
protocol: TCP
- containerPort: 8443
name: EnvoyHTTPSPort
protocol: TCP
- containerPort: 19001
name: metrics
protocol: TCP
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -233,12 +233,6 @@ spec:
scheme: HTTP
name: envoy
ports:
- containerPort: 8080
name: EnvoyHTTPPort
protocol: TCP
- containerPort: 8443
name: EnvoyHTTPSPort
protocol: TCP
- containerPort: 19001
name: metrics
protocol: TCP
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,6 @@ spec:
scheme: HTTP
name: envoy
ports:
- containerPort: 8080
name: EnvoyHTTPPort
protocol: TCP
- containerPort: 8443
name: EnvoyHTTPSPort
protocol: TCP
- containerPort: 19001
name: metrics
protocol: TCP
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,6 @@ spec:
scheme: HTTP
name: envoy
ports:
- containerPort: 8080
name: EnvoyHTTPPort
protocol: TCP
- containerPort: 8443
name: EnvoyHTTPSPort
protocol: TCP
- containerPort: 19001
name: metrics
protocol: TCP
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -254,12 +254,6 @@ spec:
scheme: HTTP
name: envoy
ports:
- containerPort: 8080
name: EnvoyHTTPPort
protocol: TCP
- containerPort: 8443
name: EnvoyHTTPSPort
protocol: TCP
- containerPort: 19001
name: metrics
protocol: TCP
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -254,12 +254,6 @@ spec:
scheme: HTTP
name: envoy
ports:
- containerPort: 8080
name: EnvoyHTTPPort
protocol: TCP
- containerPort: 8443
name: EnvoyHTTPSPort
protocol: TCP
- containerPort: 19001
name: metrics
protocol: TCP
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -253,12 +253,6 @@ spec:
scheme: HTTP
name: envoy
ports:
- containerPort: 8080
name: EnvoyHTTPPort
protocol: TCP
- containerPort: 8443
name: EnvoyHTTPSPort
protocol: TCP
- containerPort: 19001
name: metrics
protocol: TCP
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -237,12 +237,6 @@ spec:
scheme: HTTP
name: envoy
ports:
- containerPort: 8080
name: EnvoyHTTPPort
protocol: TCP
- containerPort: 8443
name: EnvoyHTTPSPort
protocol: TCP
- containerPort: 19001
name: metrics
protocol: TCP
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -210,13 +210,6 @@ spec:
port: 19002
scheme: HTTP
name: envoy
ports:
- containerPort: 8080
name: EnvoyHTTPPort
protocol: TCP
- containerPort: 8443
name: EnvoyHTTPSPort
protocol: TCP
readinessProbe:
failureThreshold: 1
httpGet:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -257,12 +257,6 @@ spec:
scheme: HTTP
name: envoy
ports:
- containerPort: 8080
name: EnvoyHTTPPort
protocol: TCP
- containerPort: 8443
name: EnvoyHTTPSPort
protocol: TCP
- containerPort: 19001
name: metrics
protocol: TCP
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -246,12 +246,6 @@ spec:
scheme: HTTP
name: envoy
ports:
- containerPort: 8080
name: EnvoyHTTPPort
protocol: TCP
- containerPort: 8443
name: EnvoyHTTPSPort
protocol: TCP
- containerPort: 19001
name: metrics
protocol: TCP
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -237,12 +237,6 @@ spec:
scheme: HTTP
name: envoy
ports:
- containerPort: 8080
name: EnvoyHTTPPort
protocol: TCP
- containerPort: 8443
name: EnvoyHTTPSPort
protocol: TCP
- containerPort: 19001
name: metrics
protocol: TCP
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -237,12 +237,6 @@ spec:
scheme: HTTP
name: envoy
ports:
- containerPort: 8080
name: EnvoyHTTPPort
protocol: TCP
- containerPort: 8443
name: EnvoyHTTPSPort
protocol: TCP
- containerPort: 19001
name: metrics
protocol: TCP
Expand Down
Loading

0 comments on commit 950dde6

Please sign in to comment.