From 3bd8b54ad5207b96e2a5049ec34a4d8f32ce9ec8 Mon Sep 17 00:00:00 2001 From: Till Adam Date: Thu, 4 Mar 2021 17:32:13 +0100 Subject: [PATCH] fix walkthrough example The service created by this command did not match the port name used later on in the walkthrough. Therefor it is defined explicitly here. --- docs/walkthrough.md | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/docs/walkthrough.md b/docs/walkthrough.md index 34ce94b4..6af6f9f0 100644 --- a/docs/walkthrough.md +++ b/docs/walkthrough.md @@ -94,9 +94,33 @@ spec: +
+ +sample-app.service.yaml + +```yaml +apiVersion: v1 +kind: Service +metadata: + labels: + app: sample-app + name: sample-app +spec: + ports: + - name: http + port: 80 + protocol: TCP + targetPort: 8080 + selector: + app: sample-app + type: ClusterIP +``` + +
+ ```shell $ kubectl create -f sample-app.deploy.yaml -$ kubectl create service clusterip sample-app --tcp=80:8080 +$ kubectl create -f sample-app.service.yaml ``` Now, check your app, which exposes metrics and counts the number of @@ -198,7 +222,7 @@ spec: selector: matchLabels: app: sample-app - endpoints: + endpoints: - port: http ``` @@ -335,7 +359,7 @@ You should see that it succesfully fetched the metric, but it hasn't tried to scale, since there's not traffic. Since your app is going to need to scale in response to traffic, generate -some via cURL like above: +some via cURL like above: ```shell $ curl http://$(kubectl get service sample-app -o jsonpath='{ .spec.clusterIP }')/metrics