From f442a9b919bd2173e839bc8639d9c24b77ba8ea9 Mon Sep 17 00:00:00 2001 From: Steve Sloka Date: Fri, 26 Jul 2019 14:13:14 -0400 Subject: [PATCH] switch to downstream API and env var for Envoy's --service-cluster and --service-node flags Signed-off-by: Steve Sloka --- examples/deployment-grpc-v2/02-contour.yaml | 15 +++++++++++++-- examples/ds-grpc-v2/02-contour.yaml | 15 +++++++++++++-- examples/ds-hostnet-split/03-envoy.yaml | 18 ++++++++++++++---- examples/ds-hostnet/02-contour.yaml | 15 +++++++++++++-- examples/render/daemonset-rbac.yaml | 15 +++++++++++++-- examples/render/deployment-rbac.yaml | 15 +++++++++++++-- 6 files changed, 79 insertions(+), 14 deletions(-) diff --git a/examples/deployment-grpc-v2/02-contour.yaml b/examples/deployment-grpc-v2/02-contour.yaml index 63e7c654834..cfd0996494d 100644 --- a/examples/deployment-grpc-v2/02-contour.yaml +++ b/examples/deployment-grpc-v2/02-contour.yaml @@ -43,9 +43,20 @@ spec: command: ["envoy"] args: - --config-path /config/contour.json - - --service-cluster cluster0 - - --service-node node0 + - --service-cluster $(CONTOUR_NAMESPACE) + - --service-node $(ENVOY_POD_NAME) - --log-level info + env: + - name: CONTOUR_NAMESPACE + valueFrom: + fieldRef: + apiVersion: v1 + fieldPath: metadata.namespace + - name: ENVOY_POD_NAME + valueFrom: + fieldRef: + apiVersion: v1 + fieldPath: metadata.name readinessProbe: httpGet: path: /healthz diff --git a/examples/ds-grpc-v2/02-contour.yaml b/examples/ds-grpc-v2/02-contour.yaml index 1cf415051e8..847c318fb8b 100644 --- a/examples/ds-grpc-v2/02-contour.yaml +++ b/examples/ds-grpc-v2/02-contour.yaml @@ -44,9 +44,20 @@ spec: command: ["envoy"] args: - --config-path /config/contour.json - - --service-cluster cluster0 - - --service-node node0 + - --service-cluster $(CONTOUR_NAMESPACE) + - --service-node $(ENVOY_POD_NAME) - --log-level info + env: + - name: CONTOUR_NAMESPACE + valueFrom: + fieldRef: + apiVersion: v1 + fieldPath: metadata.namespace + - name: ENVOY_POD_NAME + valueFrom: + fieldRef: + apiVersion: v1 + fieldPath: metadata.name readinessProbe: httpGet: path: /healthz diff --git a/examples/ds-hostnet-split/03-envoy.yaml b/examples/ds-hostnet-split/03-envoy.yaml index cce4707837a..ccf4615da8d 100644 --- a/examples/ds-hostnet-split/03-envoy.yaml +++ b/examples/ds-hostnet-split/03-envoy.yaml @@ -26,15 +26,25 @@ spec: - args: - -c - /config/contour.json - - --service-cluster - - cluster0 - - --service-node - - node0 + - --service-cluster $(CONTOUR_NAMESPACE) + - --service-node $(ENVOY_POD_NAME) + - --log-level info command: - envoy image: docker.io/envoyproxy/envoy:v1.10.0 imagePullPolicy: IfNotPresent name: envoy + env: + - name: CONTOUR_NAMESPACE + valueFrom: + fieldRef: + apiVersion: v1 + fieldPath: metadata.namespace + - name: ENVOY_POD_NAME + valueFrom: + fieldRef: + apiVersion: v1 + fieldPath: metadata.name ports: - containerPort: 80 hostPort: 80 diff --git a/examples/ds-hostnet/02-contour.yaml b/examples/ds-hostnet/02-contour.yaml index 76a59189b2d..d921e52a862 100644 --- a/examples/ds-hostnet/02-contour.yaml +++ b/examples/ds-hostnet/02-contour.yaml @@ -48,9 +48,20 @@ spec: command: ["envoy"] args: - --config-path /config/contour.json - - --service-cluster cluster0 - - --service-node node0 + - --service-cluster $(CONTOUR_NAMESPACE) + - --service-node $(ENVOY_POD_NAME) - --log-level info + env: + - name: CONTOUR_NAMESPACE + valueFrom: + fieldRef: + apiVersion: v1 + fieldPath: metadata.namespace + - name: ENVOY_POD_NAME + valueFrom: + fieldRef: + apiVersion: v1 + fieldPath: metadata.name readinessProbe: httpGet: path: /healthz diff --git a/examples/render/daemonset-rbac.yaml b/examples/render/daemonset-rbac.yaml index fceded1af2b..7cf6b57e2e6 100644 --- a/examples/render/daemonset-rbac.yaml +++ b/examples/render/daemonset-rbac.yaml @@ -234,9 +234,20 @@ spec: command: ["envoy"] args: - --config-path /config/contour.json - - --service-cluster cluster0 - - --service-node node0 + - --service-cluster $(CONTOUR_NAMESPACE) + - --service-node $(ENVOY_POD_NAME) - --log-level info + env: + - name: CONTOUR_NAMESPACE + valueFrom: + fieldRef: + apiVersion: v1 + fieldPath: metadata.namespace + - name: ENVOY_POD_NAME + valueFrom: + fieldRef: + apiVersion: v1 + fieldPath: metadata.name readinessProbe: httpGet: path: /healthz diff --git a/examples/render/deployment-rbac.yaml b/examples/render/deployment-rbac.yaml index 1dd39e1a93f..ff75e98834e 100644 --- a/examples/render/deployment-rbac.yaml +++ b/examples/render/deployment-rbac.yaml @@ -233,9 +233,20 @@ spec: command: ["envoy"] args: - --config-path /config/contour.json - - --service-cluster cluster0 - - --service-node node0 + - --service-cluster $(CONTOUR_NAMESPACE) + - --service-node $(ENVOY_POD_NAME) - --log-level info + env: + - name: CONTOUR_NAMESPACE + valueFrom: + fieldRef: + apiVersion: v1 + fieldPath: metadata.namespace + - name: ENVOY_POD_NAME + valueFrom: + fieldRef: + apiVersion: v1 + fieldPath: metadata.name readinessProbe: httpGet: path: /healthz