Skip to content

Commit b6672e7

Browse files
authored
fix: update blog configuration issues to support global mtls (#20304)
* fix: update blog configuration issues to support global mtls * fix: simplify annotation step * docs: expand on service-upstream annotation * docs: amend old blog post * fix: expand on load balancing * fix: doc typo * fix: minor nit
1 parent 8f3212c commit b6672e7

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

content/en/blog/_posts/2020-03-18-Kong-Ingress-Controller-and-Service-Mesh.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,16 @@ reviews-v2-ccffdd984-9jnsj 2/2 Running 0 101s
9797
reviews-v3-98dc67b68-nzw97 2/2 Running 0 101s
9898
```
9999

100-
This command outputs useful data, so let’s take a second to understand it. If you examine the READY column, each pod has two containers running: the service and an Envoy sidecar injected alongside it. Another thing to highlight is that there are three review pods but only 1 review service. The Envoy sidecar will load balance the traffic to three different review pods that contain different versions, giving us the ability to A/B test our changes. With that said, you should now be able to access your product page!
100+
This command outputs useful data, so let’s take a second to understand it. If you examine the READY column, each pod has two containers running: the service and an Envoy sidecar injected alongside it. Another thing to highlight is that there are three review pods but only 1 review service. The Envoy sidecar will load balance the traffic to three different review pods that contain different versions, giving us the ability to A/B test our changes. We have one step before we can access the deployed application. We need to add an additional annotation to the `productpage` service. To do so, run:
101+
102+
```
103+
$ kubectl annotate service productpage ingress.kubernetes.io/service-upstream=true
104+
service/productpage annotated
105+
```
106+
107+
Both the API gateway (Kong) and the service mesh (Istio) can handle the load-balancing. Without the additional `ingress.kubernetes.io/service-upstream: "true"` annotation, Kong will try to load-balance by selecting its own endpoint/target from the productpage service. This causes Envoy to receive that pod’s IP as the upstream local address, instead of the service’s cluster IP. But we want the service's cluster IP so that Envoy can properly load balance.
108+
109+
With that added, you should now be able to access your product page!
101110

102111
```
103112
$ kubectl exec -it $(kubectl get pod -l app=ratings -o jsonpath='{.items[0].metadata.name}') -c ratings -- curl productpage:9080/productpage | grep -o "<title>.*</title>"
@@ -150,6 +159,8 @@ metadata:
150159
name: do-not-preserve-host
151160
route:
152161
preserve_host: false
162+
upstream:
163+
host_header: productpage.default.svc
153164
" | kubectl apply -f -
154165
kongingress.configuration.konghq.com/do-not-preserve-host created
155166
```

0 commit comments

Comments
 (0)