Skip to content

Commit d26b9ca

Browse files
committed
more outputs added
1 parent 3444f77 commit d26b9ca

File tree

2 files changed

+138
-2
lines changed

2 files changed

+138
-2
lines changed

content/en/conf24/1-zero-config-k8s/7-log-observer-connect/3-deploy.md

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,99 @@ weight: 3
66

77
To see the changes in effect, we need to redeploy the services, First, let's change the location of the images from the external repo to the local one by running the following script:
88

9+
{{< tabs >}}
10+
{{% tab title="Change deployment to local containers" %}}
11+
912
```bash
1013
. ~/workshop/petclinic/scripts/set_local.sh
1114
```
1215

16+
{{% /tab %}}
17+
{{% tab title="Output" %}}
18+
19+
```text
20+
Script execution completed. Modified content saved to /home/splunk/workshop/petclinic/petclinic-local.yaml
21+
```
22+
23+
{{% /tab %}}
24+
{{< /tabs >}}
25+
1326
The result is a new file on disk called `petclinic-local.yaml`. Switch to the local versions by using the new version of the deployment YAML. First delete the old containers from the original deployment with:
1427

28+
{{< tabs >}}
29+
{{% tab title="Deleting remote Petclinic services" %}}
30+
1531
```bash
1632
kubectl delete -f ~/workshop/petclinic/petclinic-deploy.yaml
1733
```
1834

35+
{{% /tab %}}
36+
{{% tab title="Output" %}}
37+
38+
```text
39+
deployment.apps "config-server" deleted
40+
service "config-server" deleted
41+
deployment.apps "discovery-server" deleted
42+
service "discovery-server" deleted
43+
deployment.apps "api-gateway" deleted
44+
service "api-gateway" deleted
45+
service "api-gateway-external" deleted
46+
deployment.apps "customers-service" deleted
47+
service "customers-service" deleted
48+
deployment.apps "vets-service" deleted
49+
service "vets-service" deleted
50+
deployment.apps "visits-service" deleted
51+
service "visits-service" deleted
52+
deployment.apps "admin-server" deleted
53+
service "admin-server" deleted
54+
service "petclinic-db" deleted
55+
deployment.apps "petclinic-db" deleted
56+
configmap "petclinic-db-initdb-config" deleted
57+
deployment.apps "petclinic-loadgen-deployment" deleted
58+
configmap "scriptfile" deleted
59+
```
60+
61+
{{% /tab %}}
62+
{{< /tabs >}}
63+
1964
followed by:
2065

66+
{{< tabs >}}
67+
{{% tab title="Starting local Petclinic services" %}}
68+
2169
```bash
2270
kubectl apply -f ~/workshop/petclinic/petclinic-local.yaml
2371
```
2472

73+
{{% /tab %}}
74+
{{% tab title="Output" %}}
75+
76+
```text
77+
deployment.apps/config-server created
78+
service/config-server created
79+
deployment.apps/discovery-server created
80+
service/discovery-server created
81+
deployment.apps/api-gateway created
82+
service/api-gateway created
83+
service/api-gateway-external created
84+
deployment.apps/customers-service created
85+
service/customers-service created
86+
deployment.apps/vets-service created
87+
service/vets-service created
88+
deployment.apps/visits-service created
89+
service/visits-service created
90+
deployment.apps/admin-server created
91+
service/admin-server created
92+
service/petclinic-db created
93+
deployment.apps/petclinic-db created
94+
configmap/petclinic-db-initdb-config created
95+
deployment.apps/petclinic-loadgen-deployment created
96+
configmap/scriptfile created
97+
```
98+
99+
{{% /tab %}}
100+
{{< /tabs >}}
101+
25102
This will cause the containers to be replaced with the local version, you can verify this by checking the containers:
26103

27104
```bash

content/en/conf24/1-zero-config-k8s/8-rum/1-rebuild-app.md

Lines changed: 61 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,32 +44,91 @@ cat ~/spring-petclinic-microservices/spring-petclinic-api-gateway/src/main/resou
4444
RUM_AUTH: '[redacted]',
4545
RUM_APP_NAME: 'k8s-petclinic-workshop-store',
4646
RUM_ENVIRONMENT: 'k8s-petclinic-workshop-workshop'
47-
}
4847

48+
}
4949
```
5050

5151
{{% /tab %}}
5252
{{< /tabs >}}
5353

5454
Change into the `api-gateway` directory and force a new build for just the `api-gateway` service:
5555

56+
{{< tabs >}}
57+
{{% tab title="Building api-gateway" %}}
58+
5659
``` bash
5760
cd ~/spring-petclinic-microservices/spring-petclinic-api-gateway
5861
../mvnw clean install -D skipTests -P buildDocker
5962
```
6063

61-
and push the new container to the local registry
64+
{{% /tab %}}
65+
{{% tab title=" Output" %}}
66+
67+
```text
68+
Successfully built 2d409c1eeccc
69+
Successfully tagged localhost:9999/spring-petclinic-api-gateway:local
70+
[INFO] Built localhost:9999/spring-petclinic-api-gateway:local
71+
[INFO] ------------------------------------------------------------------------
72+
[INFO] BUILD SUCCESS
73+
[INFO] ------------------------------------------------------------------------
74+
[INFO] Total time: 26.250 s
75+
[INFO] Finished at: 2024-05-31T15:51:20Z
76+
[INFO] ------------------------------------------------------------------------
77+
```
78+
79+
{{% /tab %}}
80+
{{< /tabs >}}
81+
82+
and now push the new container to the local registry, the others get skipped:
83+
84+
{{< tabs >}}
85+
{{% tab title="Updating docker repo with RUM api-gateway" %}}
6286

6387
``` bash
6488
. ~/workshop/petclinic/scripts/push_docker.sh
6589
```
6690

91+
{{% /tab %}}
92+
{{% tab title="Verifying only change to api-gateway gets pushed" %}}
93+
94+
```text
95+
The push refers to repository [localhost:9999/spring-petclinic-api-gateway]
96+
9a7b16677cf9: Pushed
97+
f2e09ed98998: Layer already exists
98+
291752eeb66b: Layer already exists
99+
ac28fe526c24: Layer already exists
100+
0a37fe4a02de: Layer already exists
101+
4b1e7b998de9: Layer already exists
102+
a2a8ef39e636: Layer already exists
103+
86cb6a9eb3cd: Layer already exists
104+
985fdc63de98: Layer already exists
105+
4ab2850febd7: Layer already exists
106+
2db7720a8970: Layer already exists
107+
629ca62fb7c7: Layer already exists
108+
```
109+
110+
{{% /tab %}}
111+
{{< /tabs >}}
112+
67113
As soon as the container is pushed into the repository, just restart the `api-gateway` to apply the changes:
68114

115+
{{< tabs >}}
116+
{{% tab title="Rollout restart api-gateway" %}}
117+
69118
``` bash
70119
kubectl rollout restart deployment api-gateway
71120
```
72121

122+
{{% /tab %}}
123+
{{% tab title=" Output" %}}
124+
125+
```text
126+
deployment.apps/api-gateway restarted
127+
```
128+
129+
{{% /tab %}}
130+
{{< /tabs >}}
131+
73132
Validate that the application is running by visiting **http://<IP_ADDRESS>:81** (replace **<IP_ADDRESS>** with the IP address you obtained above). Make sure the application is working correctly by visiting the **All Owners** **(1)** and select an owner, then add a **visit** **(2)**. We will use this action when checking RUM
74133

75134
![pet](../../images/petclinic-pet.png)

0 commit comments

Comments
 (0)