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
{{ message }}
This repository was archived by the owner on Jul 22, 2024. It is now read-only.
# Navigate microservices deplyoment options with Cloud Foundry, Kubernetes, OpenWhisk and Istio
3
+
# Navigate application deployment options with Cloud Foundry, Kubernetes, OpenWhisk and Istio
4
4
5
-
Microservices and containers are now influencing application design and deployment patterns and will continue to do so for the foreseeable future. According to one survey, 60 percent of all new applications will use cloud-enabled continuous delivery microservice architectures, DevOps, and containers. But with the proliferation of microservices, a number of deployment platforms have emerged. What do we choose and why? In this journey, we help you navigate microservices deployment options with some popular microservices platforms like Cloud Foundry, Kubernetes, OpenWhisk and Istio
5
+
PaaS platforms like Cloud Foundry, container orchestrators like Kubernetes, Serverless platforms like OpenWhisk and Service-mesh like Istio are all great technologies to deploy and manage your microservices on. Common wisdom says there is no such thing as too many choices, but abundance of choices can lead to analysis paralysis. In this code we look at deployment experience the different platforms provide, and what do we gain and loose by choosing one vs another.
6
6
7
-
We use a sample Node.js application, flightassist for demonstrating and comparing various microservices deployment technologies. Specifically, a set of trade-offs and comparisons can be made between these deployment models, and this application is a proving ground for those discussions.
7
+
We start with a sample Node.js monolithic application, Flightassist, factor it into two microservices, and then use it for demonstrating and comparing various deployment technologies. A set of trade-offs and comparisions can be made between these deployment models, and this application provides a basis for those discussions.
After you deployed Flightassist using any platform, you can go to [How to Use Flightassist](#how-to-use-flightassist) and start testing your application.
64
67
@@ -86,7 +89,7 @@ curl -k -X PUT {your-cloudantURL}/trips
86
89
curl -k -X PUT {your-cloudantURL}/weather
87
90
curl -k -X PUT {your-cloudantURL}/connections
88
91
```
89
-
# Deploy monolithic Flightassist application using Cloud Foundry
92
+
# 2. Deploy monolithic Flightassist application using Cloud Foundry
90
93
91
94
In this scenario, we will deploy Flightassist as a monolithic application and host it on Cloud Foundry.
92
95
@@ -112,7 +115,9 @@ application.
112
115
113
116
Congratulation, now you can learn about [How to Use Flightassist](#how-to-use-flightassist) and start testing your application.
114
117
115
-
# Factor monolithic application into microservices and test
118
+
# 3. Factor monolithic application into microservices and test
119
+
120
+
To factor the application into microservices, we add a python microservice to the picture. Instead of directly accessing the apis from Node app, the python program will serve as a proxy to query. This step tests the two microservices and associated dockerfiles which are created.
Now, your FlightAssist application should be running on http://localhost:3000/
135
139
136
-
# Scenario One: Deploy Flightassist microservices on Cloud Foundry
140
+
# 4. Deploy Flightassist microservices on Cloud Foundry
141
+
142
+
Make sure you have both developer accounts mentioned in prerequisites. Also make sure you have cloudant and weatherinsights services created as listed in [step 1](#1-create-your-cloudant-database-and-insights-for-weather-service).
143
+
144
+
In this scenario, we take the Flightassist which is factored in microservices. Since Cloud Foundry apps (warden containers) are not allowed to talk privately, they need to communicate via public route.
**make sure you pick a unique name for the app, too.**
168
+
169
+
Now we inject the environment variables as in monolithic deployment:
170
+
-`FLIGHTSTATS_APP_ID` : application ID assigned by FlightStats
171
+
-`FLIGHTSTATS_APP_KEY` : application key assigned by FlightStats
172
+
-`TRIPIT_API_KEY` : API key assigned by TripIt
173
+
-`TRIPIT_API_SECRET` : API secret assigned by TripIt
174
+
-`BASE_URL`: You URL for accessing your application. In the format **https://**{app_name}.mybluemix.net**/**
175
+
176
+
Plus, a couple more since we have two apps:
177
+
-`USE_WEATHER_SERVICE`: true
178
+
-`MICROSERVICE_URL`: <i>name1</i>.mybluemix.net
179
+
180
+
Now we start the 2nd app:
181
+
`cf start <name2>`
137
182
138
-
# Scenario Two: Deploy Flightassist microservices on Kubernetes Cluster
183
+
You can now test the apps by going to http://<i>name2</i>.mybluemix.net
139
184
140
-
In this scenario, we want to break down Flightassist to multiple containers. Therefore, we will run Flightassist as our main application with weather-service as our microservice to query the weather data. Then, we will host those containers using Docker Compose or Kubernetes.
185
+
# 5. Deploy Flightassist microservices on Kubernetes Cluster
186
+
187
+
In this scenario, we use the Flightassist microservices in which are in two containers. We will run Flightassist as our main application with weather-service as our microservice to query the weather data. Then, we will host those containers using Kubernetes.
141
188
142
189
First, follow the [Kubernetes Cluster Tutorial](https://github.com/IBM/container-journey-template) to create your own cluster on Bluemix.
Congratulation, now your Flightassist application should be running on `http://<your_node_ip>:30080`. You can go to [How to Use Flightassist](#how-to-use-flightassist) and start testing your application.
181
228
182
229
183
-
# Scenario Three: Deploy Flightassist microservices on Istio
230
+
# 6. Deploy Flightassist microservices on Istio
231
+
232
+
Istio is an open platform that provides a uniform way to connect, manage, and secure microservices. Istio is the result of a joint collaboration between IBM, Google and Lyft as a means to support traffic flow management, access policy enforcement and the telemetry data aggregation between microservices, all without requiring changes to the code
233
+
234
+
## 6.1 Installing Istio in your Cluster
184
235
185
-
## 1. Installing Istio in your Cluster
186
-
### 1.1 Download the Istio source
236
+
### Download the Istio source
187
237
1. Download the latest Istio release for your OS: [Istio releases](https://github.com/istio/istio/releases)
188
238
2. Extract and go to the root directory.
189
239
3. Copy the `istioctl` bin to your local bin
@@ -192,7 +242,7 @@ Congratulation, now your Flightassist application should be running on `http://<
192
242
## example for macOS
193
243
```
194
244
195
-
### 1.2 Grant Permissions
245
+
### Grant Permissions
196
246
1. Run the following command to check if your cluster has RBAC
197
247
```bash
198
248
$ kubectl api-versions | grep rbac
@@ -212,7 +262,7 @@ Congratulation, now your Flightassist application should be running on `http://<
212
262
213
263
* If **your cluster has no RBAC** enabled, proceed to installing the **Control Plane**.
214
264
215
-
### 1.3 Install the [Istio Control Plane](https://istio.io/docs/concepts/what-is-istio/overview.html#architecture) in your cluster
265
+
### Install the [Istio Control Plane](https://istio.io/docs/concepts/what-is-istio/overview.html#architecture) in your cluster
Next, edit `flightassist_serverless.yaml` and replace the `<namespace>` with your own namespace, `<your-app-end-point-url>` with your node ip and nodeport, and `<your-openwhisk-auth>` with your OpenWhisk authentication. You can run `wsk property get --auth | awk '{print $3}'` to view your OpenWhisk authentication.
273
323
274
-
Now, let's deploy the new flightassist app with serverless.
324
+
Now, let's deploy the new flightassist app with serverless capability
275
325
276
326
```bash
277
327
kubectl create -f flightassist_serverless.yaml
@@ -291,6 +341,18 @@ Now you can see the most recent flight status and weather for all your flights w
291
341
292
342

293
343
344
+
# Summary
345
+
346
+
It's hard to compare the different technologies toe to toe since they are targeted for different use cases. However,we can get a sense of their pros and cons from the above example.
347
+
348
+
**Cloud Foundry**: Developer Centric; Developers don't have to build or maintain containers; Support various programming languages and libraries; Large bases of services; Kind of hacky to deploy multi apps; Needs to know CF functions well to manage.
349
+
350
+
**Kubernetes**: Orchestration tool that manages complicated container delolyments well; Large services available ;Developer has to build and maintain containers in the repositories.
351
+
352
+
**Istio**: Addtion to Kubernetes; Provide load balancing and other features; Needs to know the "envoy" concept.
353
+
354
+
**OpenWhisk**: Serverless, event triggering; low cost; function based, doesn't work for large apps; Stateless.
0 commit comments