Skip to content

Commit

Permalink
Setup contour to use ADS with DELTA_GRPC
Browse files Browse the repository at this point in the history
Signed-off-by: David Sale <[email protected]>
  • Loading branch information
saley89 committed Dec 12, 2024
1 parent 1f51d71 commit fab3db3
Show file tree
Hide file tree
Showing 22 changed files with 280 additions and 776 deletions.
7 changes: 4 additions & 3 deletions examples/contour/02-job-certgen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,18 +36,19 @@ rules:
apiVersion: batch/v1
kind: Job
metadata:
name: contour-certgen-v1-30-1
name: contour-certgen-main
namespace: projectcontour
spec:
ttlSecondsAfterFinished: 0
template:
metadata:
labels:
app: "contour-certgen"
spec:
containers:
- name: contour
image: ghcr.io/projectcontour/contour:v1.30.1
imagePullPolicy: IfNotPresent
image: ghcr.io/projectcontour/contour:main
imagePullPolicy: Always
command:
- contour
- certgen
Expand Down
4 changes: 2 additions & 2 deletions examples/contour/03-contour.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ spec:
- --contour-key-file=/certs/tls.key
- --config-path=/config/contour.yaml
command: ["contour"]
image: ghcr.io/projectcontour/contour:v1.30.1
imagePullPolicy: IfNotPresent
image: ghcr.io/projectcontour/contour:main
imagePullPolicy: Always
name: contour
ports:
- containerPort: 8001
Expand Down
8 changes: 4 additions & 4 deletions examples/contour/03-envoy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ spec:
args:
- envoy
- shutdown-manager
image: ghcr.io/projectcontour/contour:v1.30.1
imagePullPolicy: IfNotPresent
image: ghcr.io/projectcontour/contour:main
imagePullPolicy: Always
lifecycle:
preStop:
exec:
Expand Down Expand Up @@ -107,8 +107,8 @@ spec:
- --envoy-key-file=/certs/tls.key
command:
- contour
image: ghcr.io/projectcontour/contour:v1.30.1
imagePullPolicy: IfNotPresent
image: ghcr.io/projectcontour/contour:main
imagePullPolicy: Always
name: envoy-initconfig
volumeMounts:
- name: envoy-config
Expand Down
4 changes: 2 additions & 2 deletions examples/deployment/03-envoy-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ spec:
args:
- envoy
- shutdown-manager
image: ghcr.io/projectcontour/contour:v1.30.1
imagePullPolicy: IfNotPresent
image: ghcr.io/projectcontour/contour:main
imagePullPolicy: Always
lifecycle:
preStop:
exec:
Expand Down
4 changes: 2 additions & 2 deletions examples/gateway-provisioner/03-gateway-provisioner.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ spec:
- --metrics-addr=127.0.0.1:8080
- --enable-leader-election
command: ["contour"]
image: ghcr.io/projectcontour/contour:v1.30.1
imagePullPolicy: IfNotPresent
image: ghcr.io/projectcontour/contour:main
imagePullPolicy: Always
name: contour-gateway-provisioner
resources:
requests:
Expand Down
19 changes: 10 additions & 9 deletions examples/render/contour-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8958,18 +8958,19 @@ rules:
apiVersion: batch/v1
kind: Job
metadata:
name: contour-certgen-v1-30-1
name: contour-certgen-main
namespace: projectcontour
spec:
ttlSecondsAfterFinished: 0
template:
metadata:
labels:
app: "contour-certgen"
spec:
containers:
- name: contour
image: ghcr.io/projectcontour/contour:v1.30.1
imagePullPolicy: IfNotPresent
image: ghcr.io/projectcontour/contour:main
imagePullPolicy: Always
command:
- contour
- certgen
Expand Down Expand Up @@ -9227,8 +9228,8 @@ spec:
- --contour-key-file=/certs/tls.key
- --config-path=/config/contour.yaml
command: ["contour"]
image: ghcr.io/projectcontour/contour:v1.30.1
imagePullPolicy: IfNotPresent
image: ghcr.io/projectcontour/contour:main
imagePullPolicy: Always
name: contour
ports:
- containerPort: 8001
Expand Down Expand Up @@ -9323,8 +9324,8 @@ spec:
args:
- envoy
- shutdown-manager
image: ghcr.io/projectcontour/contour:v1.30.1
imagePullPolicy: IfNotPresent
image: ghcr.io/projectcontour/contour:main
imagePullPolicy: Always
lifecycle:
preStop:
exec:
Expand Down Expand Up @@ -9405,8 +9406,8 @@ spec:
- --envoy-key-file=/certs/tls.key
command:
- contour
image: ghcr.io/projectcontour/contour:v1.30.1
imagePullPolicy: IfNotPresent
image: ghcr.io/projectcontour/contour:main
imagePullPolicy: Always
name: envoy-initconfig
volumeMounts:
- name: envoy-config
Expand Down
4 changes: 2 additions & 2 deletions examples/render/contour-gateway-provisioner.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25522,8 +25522,8 @@ spec:
- --metrics-addr=127.0.0.1:8080
- --enable-leader-election
command: ["contour"]
image: ghcr.io/projectcontour/contour:v1.30.1
imagePullPolicy: IfNotPresent
image: ghcr.io/projectcontour/contour:main
imagePullPolicy: Always
name: contour-gateway-provisioner
resources:
requests:
Expand Down
19 changes: 10 additions & 9 deletions examples/render/contour-gateway.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8774,18 +8774,19 @@ rules:
apiVersion: batch/v1
kind: Job
metadata:
name: contour-certgen-v1-30-1
name: contour-certgen-main
namespace: projectcontour
spec:
ttlSecondsAfterFinished: 0
template:
metadata:
labels:
app: "contour-certgen"
spec:
containers:
- name: contour
image: ghcr.io/projectcontour/contour:v1.30.1
imagePullPolicy: IfNotPresent
image: ghcr.io/projectcontour/contour:main
imagePullPolicy: Always
command:
- contour
- certgen
Expand Down Expand Up @@ -9043,8 +9044,8 @@ spec:
- --contour-key-file=/certs/tls.key
- --config-path=/config/contour.yaml
command: ["contour"]
image: ghcr.io/projectcontour/contour:v1.30.1
imagePullPolicy: IfNotPresent
image: ghcr.io/projectcontour/contour:main
imagePullPolicy: Always
name: contour
ports:
- containerPort: 8001
Expand Down Expand Up @@ -9127,8 +9128,8 @@ spec:
args:
- envoy
- shutdown-manager
image: ghcr.io/projectcontour/contour:v1.30.1
imagePullPolicy: IfNotPresent
image: ghcr.io/projectcontour/contour:main
imagePullPolicy: Always
lifecycle:
preStop:
exec:
Expand Down Expand Up @@ -9209,8 +9210,8 @@ spec:
- --envoy-key-file=/certs/tls.key
command:
- contour
image: ghcr.io/projectcontour/contour:v1.30.1
imagePullPolicy: IfNotPresent
image: ghcr.io/projectcontour/contour:main
imagePullPolicy: Always
name: envoy-initconfig
volumeMounts:
- name: envoy-config
Expand Down
19 changes: 10 additions & 9 deletions examples/render/contour.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8958,18 +8958,19 @@ rules:
apiVersion: batch/v1
kind: Job
metadata:
name: contour-certgen-v1-30-1
name: contour-certgen-main
namespace: projectcontour
spec:
ttlSecondsAfterFinished: 0
template:
metadata:
labels:
app: "contour-certgen"
spec:
containers:
- name: contour
image: ghcr.io/projectcontour/contour:v1.30.1
imagePullPolicy: IfNotPresent
image: ghcr.io/projectcontour/contour:main
imagePullPolicy: Always
command:
- contour
- certgen
Expand Down Expand Up @@ -9227,8 +9228,8 @@ spec:
- --contour-key-file=/certs/tls.key
- --config-path=/config/contour.yaml
command: ["contour"]
image: ghcr.io/projectcontour/contour:v1.30.1
imagePullPolicy: IfNotPresent
image: ghcr.io/projectcontour/contour:main
imagePullPolicy: Always
name: contour
ports:
- containerPort: 8001
Expand Down Expand Up @@ -9311,8 +9312,8 @@ spec:
args:
- envoy
- shutdown-manager
image: ghcr.io/projectcontour/contour:v1.30.1
imagePullPolicy: IfNotPresent
image: ghcr.io/projectcontour/contour:main
imagePullPolicy: Always
lifecycle:
preStop:
exec:
Expand Down Expand Up @@ -9393,8 +9394,8 @@ spec:
- --envoy-key-file=/certs/tls.key
command:
- contour
image: ghcr.io/projectcontour/contour:v1.30.1
imagePullPolicy: IfNotPresent
image: ghcr.io/projectcontour/contour:main
imagePullPolicy: Always
name: envoy-initconfig
volumeMounts:
- name: envoy-config
Expand Down
4 changes: 2 additions & 2 deletions internal/envoy/v3/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func UpstreamTLSContext(peerValidationContext *dag.PeerValidationContext, sni st
if clientSecret != nil {
clientSecretConfigs = []*envoy_transport_socket_tls_v3.SdsSecretConfig{{
Name: envoy.Secretname(clientSecret),
SdsConfig: ConfigSource("contour"),
SdsConfig: ConfigSource(),
}}
}

Expand Down Expand Up @@ -125,7 +125,7 @@ func DownstreamTLSContext(serverSecret *dag.Secret, tlsMinProtoVersion, tlsMaxPr
},
TlsCertificateSdsSecretConfigs: []*envoy_transport_socket_tls_v3.SdsSecretConfig{{
Name: envoy.Secretname(serverSecret),
SdsConfig: ConfigSource("contour"),
SdsConfig: ConfigSource(),
}},
AlpnProtocols: alpnProtos,
},
Expand Down
13 changes: 10 additions & 3 deletions internal/envoy/v3/bootstrap.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ func bootstrapConfig(c *envoy.BootstrapConfig) *envoy_config_bootstrap_v3.Bootst
LayerSpecifier: &envoy_config_bootstrap_v3.RuntimeLayer_RtdsLayer_{
RtdsLayer: &envoy_config_bootstrap_v3.RuntimeLayer_RtdsLayer{
Name: DynamicRuntimeLayerName,
RtdsConfig: ConfigSource("contour"),
RtdsConfig: ConfigSource(),
},
},
},
Expand All @@ -187,8 +187,15 @@ func bootstrapConfig(c *envoy.BootstrapConfig) *envoy_config_bootstrap_v3.Bootst
},
},
DynamicResources: &envoy_config_bootstrap_v3.Bootstrap_DynamicResources{
LdsConfig: ConfigSource("contour"),
CdsConfig: ConfigSource("contour"),
AdsConfig: &envoy_config_core_v3.ApiConfigSource{
ApiType: envoy_config_core_v3.ApiConfigSource_DELTA_GRPC,
TransportApiVersion: envoy_config_core_v3.ApiVersion_V3,
GrpcServices: []*envoy_config_core_v3.GrpcService{
GrpcService("contour", "", timeout.DefaultSetting()),
},
},
LdsConfig: ConfigSource(),
CdsConfig: ConfigSource(),
},
StaticResources: &envoy_config_bootstrap_v3.Bootstrap_StaticResources{
Clusters: []*envoy_config_cluster_v3.Cluster{{
Expand Down
Loading

0 comments on commit fab3db3

Please sign in to comment.