@@ -2,9 +2,7 @@ Hello World as-a-Service
22-------------------------
33
44This example shows a basic Hello World Service creation. The provider creates HelloWorldService from the Hello World Helm chart.
5- While creating the HelloWorldService, provider defines the resource requests and limits for cpu and memory resources for the Pods
6- that will be created as part of this service's instances. The node on which the Pod(s) should be deployed is also
7- defined as part of instance creation. The consumer creates instances of HelloWorldService to run a Pod that displays Hello World.
5+ The consumer creates an instance of HelloWorldService to run a Pod that displays Hello World.
86
97Setup:
108------
@@ -58,7 +56,7 @@ You can use either the provider.conf or consumer.conf in below commands.
5856
59571. Check HelloWorldService man page
6058 - kubectl man HelloWorldService -k consumer.conf
61- You will see that this is a Kubernetes CRD with a spec property "greeting".
59+ You will see that this is a Kubernetes CRD with a spec property "greeting" and "replicas" .
6260
63612. Create a hello world instance
6462 - more hs1-no-replicas.yaml
@@ -70,15 +68,9 @@ You can use either the provider.conf or consumer.conf in below commands.
7068 - kubectl get pods -A --kubeconfig=consumer.conf
7169 - you should see the hello world Pod in hs1 namespace
7270
73- 4. Verify that resource requests and limits for cpu and memory have been set
74- on the hello world Pod as defined in the ResourceComposition definition in hello-world-service-composition.yaml
75- - HELLOWORLD_POD=`kubectl get pods -A --kubeconfig=consumer.conf | grep hello | awk '{print $2}'`
76- - HELLOWORLD_NS=`kubectl get pods -A --kubeconfig=consumer.conf | grep hello | awk '{print $1}'`
77- - kubectl get pods $HELLOWORLD_POD --kubeconfig=consumer.conf -n $HELLOWORLD_NS -o json | jq -r '.spec.containers[0].resources'
78-
79- 5. Check the Kubernetes resources created by KubePlus for the application
71+ 4. Check the Kubernetes resources created by KubePlus for the application
8072 - kubectl appresources HelloWorldService hs1 default -k consumer.conf
81- - Should see output of following nature:
73+ - Should see output of the following nature:
8274
8375 NAMESPACE KIND NAME
8476 default HelloWorldService hs1
@@ -89,17 +81,17 @@ You can use either the provider.conf or consumer.conf in below commands.
8981 hs1 NetworkPolicy restrict-cross-ns-traffic
9082
9183
92- 6 . Retrievel application url
84+ 5 . Retrievel application url
9385 - kubectl appurl HelloWorldService hs1 default -k consumer.conf
9486 - curl <app-url> from above output
9587 - should see "Hello hello hello" displayed
9688
97- 7 . Retrievel application logs
89+ 6 . Retrievel application logs
9890 - kubectl applogs HelloWorldService hs1 default -k consumer.conf
9991
100- 8 . Retrievel application metrics
92+ 7 . Retrievel application metrics
10193 - kubectl metrics HelloWorldService hs1 default -k consumer.conf
102- - Should see output of following nature:
94+ - Should see output of the following nature:
10395 ----------------------------------------------------------
10496 Kubernetes Resources created:
10597 Number of Sub-resources: -
@@ -115,10 +107,14 @@ You can use either the provider.conf or consumer.conf in below commands.
115107 Total Network bytes transferred: 0
116108 ----------------------------------------------------------
117109
118- 9. Check resource connectivity graph
119- - kubectl connections HelloWorldService hs1 default -k consumer.conf -o png
110+ 8. Test application update
111+ - kubectl apply -f hs1-replicas-2.yaml --kubeconfig=consumer.conf
112+
113+ 9. Verify that 2 Pods are created in the hs1 namespace
114+ - kubectl get pods -n hs1
115+ - kubectl appresources HelloWorldService hs1 default -k consumer.conf
116+ - kubectl metrics HelloWorldService hs1 default -k consumer.conf
120117
121- 10. Follow steps from steps-app-upgrade.txt to see an example of application upgrade.
122118
123119Clean up:
124120-----------
0 commit comments