You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: spring-cloud-kubernetes-examples/kubernetes-circuitbreaker-ribbon-example/readme.md
+1-113Lines changed: 1 addition & 113 deletions
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@ As the Ribbon Kubernetes client is configured within this example, it will fetch
5
5
6
6
### Running the example
7
7
8
-
This project example runs on ALL the Kubernetes or OpenShift environments, but for development purposes you can use [Minishift - OpenShift](https://github.com/minishift/minishift) or [Minikube - Kubernetes](https://kubernetes.io/docs/getting-started-guides/minikube/) tool
8
+
This project example runs on ALL the Kubernetes environments, but for development purposes you can use [Kind](https://github.com/kubernetes-sigs/kind) or [Minikube - Kubernetes](https://kubernetes.io/docs/getting-started-guides/minikube/) tool
9
9
to install the platform locally within a virtual machine managed by VirtualBox, Xhyve or KVM, with no fuss.
10
10
11
11
### Build/Deploy using Minikube
@@ -104,116 +104,4 @@ and next issue a new curl request to get the response from the greeting service
104
104
```
105
105
Hello from Fallback!
106
106
```
107
-
108
-
### Build/Deploy using Minishift
109
-
110
-
First, create a new virtual machine provisioned with OpenShift on your laptop using the command `minishift start`.
111
-
112
-
Next, log on to the OpenShift platform and next within your terminal use the `oc` client to create a project where
113
-
we will install the circuit breaker and load balancing application
114
-
115
-
```
116
-
oc new-project circuit-loadbalancing
117
-
```
118
-
119
-
When using OpenShift, you must assign the `view` role to the *default* service account in the current project in orde to allow our Java Kubernetes Api to access
You can now compile your project and generate the OpenShift resources (yaml files containing the definition of the pod, deployment, build, service and route to be created)
127
-
like also to deploy the application on the OpenShift platform in one maven line :
128
-
129
-
```
130
-
mvn clean install fabric8:deploy -Pkubernetes
131
-
```
132
-
133
-
### Call the Greeting service
134
-
135
-
When maven has finished to compile the code but also to call the platform in order to deploy the yaml files generated and tell to the platform to start the process
136
-
to build/deploy the docker image and create the containers where the Spring Boot application will run 'greeting-service" and "name-service", you will be able to
137
-
check if the pods have been created using this command :
138
-
139
-
```
140
-
oc get pods --selector=project=greeting-service
141
-
```
142
-
143
-
If the status of the Spring Boot pod application is `running` and ready state `1`, then you can
144
-
get the external address IP/Hostname to be used to call the service from your laptop
145
-
146
-
```
147
-
oc get route/greeting-service
148
-
```
149
-
150
-
and then call the service using the curl client
151
-
152
-
```
153
-
curl https://IP_OR_HOSTNAME/greeting
154
-
```
155
-
156
-
to get a response as such
157
-
158
-
```
159
-
Hello from name-service-1-0dzb4!d
160
-
```
161
-
162
-
### Verify the load balancing
163
-
164
-
First, scale the number of pods of the `name service` to 2
165
-
166
-
```
167
-
oc scale --replicas=2 dc name-service
168
-
```
169
-
170
-
Wait a few minutes before to issue the curl request to call the Greeting Service to let the platform to create the new pod.
171
-
172
-
```
173
-
oc get pods --selector=project=name-service
174
-
NAME READY STATUS RESTARTS AGE
175
-
name-service-1-0ss0r 1/1 Running 0 3m
176
-
name-service-1-fblp1 1/1 Running 0 36m
177
-
```
178
-
179
-
If you issue the curl request to access the greeting service, you should see that the message response
180
-
contains a different id end of the message which corresponds to the name of the pod.
181
-
182
-
```
183
-
Hello from name-service-1-0ss0r!
184
-
```
185
-
186
-
As Ribbon will question the Kubernetes API to get, base on the `name-service` name, the list of IP Addresses assigned to the service as endpoints,
187
-
you should see that you will get a different response from one of the 2 pods running
188
-
189
-
```
190
-
oc get endpoints/name-service
191
-
NAME ENDPOINTS AGE
192
-
name-service 172.17.0.2:8080,172.17.0.3:8080 40m
193
-
```
194
-
195
-
Here is an example about what you will get
196
-
197
-
```
198
-
curl https://IP_OR_HOSTNAME/greeting
199
-
Hello from name-service-1-0ss0r!
200
-
curl https://IP_OR_HOSTNAME/greeting
201
-
Hello from name-service-1-fblp1!
202
-
...
203
-
```
204
-
205
-
### Test the fall back
206
-
207
-
In order to test the circuit breaker and the fallback option, you will scale the `name-service` to 0 pods as such
208
-
209
-
```
210
-
oc scale --replicas=0 dc name-service
211
-
```
212
-
213
-
and next issue a new curl request to get the response from the greeting service
Copy file name to clipboardExpand all lines: spring-cloud-kubernetes-examples/kubernetes-zipkin-example/README.md
+2-63Lines changed: 2 additions & 63 deletions
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,7 @@
3
3
This project demonstrates how a Spring Boot application generating statistics as Spring Cloud Sleuth Spans/Traces can send them to a ZipKin server deployed in Kubernetes without the need to
4
4
configure the baseUrl of the ZipKin server deployed as the server will be discovered. The spans/traces generated can be viewed within the Zipkin dashboard under the `serviceName=sleuth-zipkin`
5
5
6
-
The Zipkin server is deployed according to the steps described within the `Minishift` or `Minikube` section.
6
+
The Zipkin server is deployed according to the steps described within the `Minikube` section.
7
7
8
8
The project exposes under the `TraceController` 2 endpoints `/` and `/hi` that you can play with in order to generate traces. When you call the root endpoint `/`, then
9
9
it will issue a call against the second endpoint `/hi` and you will receive `/hi/hello` as response. If you look to the Zipkin dashboard, you will be able to get 2 traces recorded.
@@ -31,7 +31,7 @@ it will issue a call against the second endpoint `/hi` and you will receive `/hi
31
31
32
32
### Running the example
33
33
34
-
This project example runs on ALL the Kubernetes or OpenShift environments, but for development purposes you can use [Minishift - OpenShift](https://github.com/minishift/minishift) or [Minikube - Kubernetes](https://kubernetes.io/docs/getting-started-guides/minikube/) tool
34
+
This project example runs on ALL the Kubernetes environments, but for development purposes you can use [Kind](https://github.com/kubernetes-sigs/kind) or [Minikube - Kubernetes](https://kubernetes.io/docs/getting-started-guides/minikube/) tool
35
35
to install the platform locally within a virtual machine managed by VirtualBox, Xhyve or KVM, with no fuss.
36
36
37
37
### Build/Deploy using Minikube
@@ -96,64 +96,3 @@ export ENDPOINT=$(minikube service kubernetes-zipkin --url)
96
96
curl $ENDPOINT
97
97
curl $ENDPOINT/hi
98
98
```
99
-
100
-
### Build/Deploy using Minishift
101
-
102
-
First, create a new virtual machine provisioned with OpenShift on your laptop using the command `minishift start`.
103
-
104
-
Next, log on to the OpenShift platform and next within your terminal use the `oc` client to create a project where
105
-
we will install the circuit breaker and load balancing application
106
-
107
-
```
108
-
oc new-project zipkin
109
-
```
110
-
111
-
When using OpenShift, you must assign the `view` role to the *default* service account in the current project in order to allow our Java Kubernetes Api to access
You can now compile your project and generate the OpenShift resources (yaml files containing the definition of the pod, deployment, build, service and route to be created)
141
-
like also to deploy the application on the OpenShift platform in one maven line :
142
-
143
-
```
144
-
mvn clean install fabric8:deploy -Pkubernetes
145
-
```
146
-
147
-
You can find the address of the Zipkin server to be opened within your browser using this command
148
-
149
-
```
150
-
oc get route/zipkin --template='{{.spec.host}}'
151
-
```
152
-
153
-
like also the endpoint to call to generate traces
154
-
155
-
```
156
-
export ENDPOINT=$(oc get route/kubernetes-zipkin --template='{{.spec.host}}')
0 commit comments