Skip to content

Commit bce3971

Browse files
Merge branch 'cloud-ark:master' into master
2 parents c2da180 + b9c7927 commit bce3971

File tree

6 files changed

+15
-197
lines changed

6 files changed

+15
-197
lines changed

examples/multitenancy/hello-world/hello-world-service-composition-localchart.yaml

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,6 @@ spec:
2424
kind: HelloWorldService
2525
group: platformapi.kubeplus
2626
version: v1alpha1
27-
policy:
28-
# Add following requests and limits for the first container of all the Pods that are related via
29-
# owner reference relationship to instances of resources specified above.
30-
podconfig:
31-
limits:
32-
cpu: 200m
33-
memory: 2Gi
34-
requests:
35-
cpu: 100m
36-
memory: 1Gi
37-
nodeSelector: values.nodeName
3827
# resmonitor identifies the resource instances that should be monitored for CPU/Memory/Storage.
3928
# All the Pods that are related to the resource instance through either ownerReference relationship, or all the relationships
4029
# (ownerReference, label, annotation, spec properties) are considered in calculating the statistics.

examples/multitenancy/hello-world/hello-world-service-composition.yaml

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,6 @@ spec:
2424
kind: HelloWorldService
2525
group: platformapi.kubeplus
2626
version: v1alpha1
27-
policy:
28-
# Add following requests and limits for the first container of all the Pods that are related via
29-
# owner reference relationship to instances of resources specified above.
30-
podconfig:
31-
limits:
32-
cpu: 200m
33-
memory: 2Gi
34-
requests:
35-
cpu: 100m
36-
memory: 1Gi
37-
nodeSelector: values.nodeName
3827
# resmonitor identifies the resource instances that should be monitored for CPU/Memory/Storage.
3928
# All the Pods that are related to the resource instance through either ownerReference relationship, or all the relationships
4029
# (ownerReference, label, annotation, spec properties) are considered in calculating the statistics.

examples/multitenancy/hello-world/steps-app-upgrade.txt

Lines changed: 0 additions & 141 deletions
This file was deleted.

examples/multitenancy/hello-world/steps.txt

Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@ Hello World as-a-Service
22
-------------------------
33

44
This 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

97
Setup:
108
------
@@ -58,7 +56,7 @@ You can use either the provider.conf or consumer.conf in below commands.
5856

5957
1. 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

6361
2. 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

123119
Clean up:
124120
-----------

examples/multitenancy/hello-world/tenant1.yaml

Lines changed: 0 additions & 8 deletions
This file was deleted.

examples/multitenancy/hello-world/tenant2.yaml

Lines changed: 0 additions & 7 deletions
This file was deleted.

0 commit comments

Comments
 (0)