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 Sep 16, 2021. It is now read-only.
@@ -4,36 +4,57 @@ In this Code Pattern, we will deploy a React application using Kubernetes.
4
4
5
5
There are many choices when looking for the right solution to manage and deploy our applications. It can often be overwhelming when we're trying to pick the right solution. One of our many choices is Kubernetes. This pattern will take you through how to get a front end application deployed on Kubernetes. After implementing the code, you will have the knowledge to deploy your own applications on Kubernetes.
6
6
7
-
This repository uses the React JavaScript library to build out the front end of the application. Redux is a predictable state container used hand in hand with React. The OMDb API is used to get movie information based on user input. It handles all of the state management within the application. Docker is an open source tool that is used to package the application into a container. Kubernetes handles the management and deployment of the containerized application.
7
+
This repository uses the React JavaScript library to build out the front end of the application. Redux is a predictable state container used hand in hand with React. The OMDb API is called to get movie information based on user input. It handles all of the state management within the application. Docker is an open source tool that is used to package the application into a container. IBM Cloud provides one to use with Kubernetes deployments called IBM Cloud Container Service. Kubernetes handles the management and deployment of the containerized application.
8
8
9
9
When the reader has completed this Code Pattern, they will understand how to:
10
10
* Containerize a React application using Docker
11
11
* Deploy and manage an application using Kubernetes
12
12
13
13
## Flow
14
14
15
+

16
+
17
+
1. The user accesses the application through the web interface. The user enters a movie title into the input.
18
+
2. The React application is rendered to the user on access.
19
+
3. The application calls the OMDb API and receives a JSON object of the response to show the user.
20
+
15
21
## Included components
16
22
* IBM Cloud Container Service: IBM Bluemix Container Service manages highly available apps inside Docker containers and Kubernetes clusters on the IBM Cloud.
17
23
* Kubernetes Cluster: Create and manage your own cloud infrastructure and use Kubernetes as your container orchestration engine.
18
24
19
25
## Featured technologies
20
26
* Node.js: An open-source JavaScript run-time environment for executing server-side JavaScript code.
21
27
* Cloud: Accessing computer and information technology resources through the Internet.
22
-
* Containers: Virtual software objects that include all the elements that an app needs to run.
23
28
* Container Orchestration: Automating the deployment, scaling and management of containerized applications.
24
29
25
30
# Watch the video
26
31
27
32
# Steps
28
33
Use the ``Deploy to IBM Cloud`` button **OR** run locally.
29
34
35
+
## Prerequisites
36
+
1. You must get an API key from [OMDb API](http://www.omdbapi.com/) in order to get a response from the API. You will insert your API key in /src/actions/index.js on line 42
37
+
38
+
2. Create an environment variable for your docker username
39
+
```
40
+
$ export docker_username="YOUR_DOCKER_USERNAME"
41
+
```
42
+
43
+
## Deploy to IBM Cloud
44
+
[](https://bluemix.net/deploy?repository=https://github.com/IBM/watson-banking-chatbot.git)
45
+
46
+
1. Press the above ``Deploy to IBM Cloud`` button and then click on ``Deploy``.
47
+
48
+
<!--optional step-->
49
+
2. In Toolchains, click on Delivery Pipeline to watch while the app is deployed. Once deployed, the app can be viewed by clicking 'View app'.
50
+

51
+
52
+
30
53
## Run locally
31
54
> NOTE: These steps are only needed when running locally instead of using the ``Deploy to IBM Cloud`` button.
32
55
33
56
1.[Clone the repo](#1-clone-the-repo)
34
-
2.[Retrieve an api key for OMDb API](#2-retrieve-an-api-key-for-omdb-api)
35
-
3.[Containerize the application using Docker](#3-containerize-the-application-using-docker)
36
-
4.[Deploy the application on Kubernetes](#3-deploy-the-application-on-kubernetes)
57
+
2.[Run the application](#2-run-the-application)
37
58
38
59
### 1. Clone the repo
39
60
@@ -43,39 +64,102 @@ Clone the `react-redux-api-example` locally. In a terminal, run:
You must get an API key from http://www.omdbapi.com/ in order to get a response from the API. You will insert your API key in /src/actions/index.js on line 42
You can now access the application at http://localhost:3000
127
+
128
+
# Sample output
129
+
130
+
<imgwidth="1415"alt="screen shot 2017-03-13 at 6 14 10 pm"src="https://cloud.githubusercontent.com/assets/18426780/23879083/fa0df756-0818-11e7-8569-469367b84280.png">
131
+
132
+
133
+
# Privacy Notice
134
+
If using the `Deploy to IBM Cloud` button some metrics are tracked, the following
135
+
information is sent to a [Deployment Tracker](https://github.com/IBM/cf-deployment-tracker-service) service
136
+
on each deployment:
137
+
138
+
* Node.js package version
139
+
* Node.js repository URL
140
+
* Application Name (`application_name`)
141
+
* Application GUID (`application_id`)
142
+
* Application instance index number (`instance_index`)
143
+
* Space ID (`space_id`)
144
+
* Application Version (`application_version`)
145
+
* Application URIs (`application_uris`)
146
+
* Labels of bound services
147
+
* Number of instances for each bound service and associated plan information
148
+
149
+
This data is collected from the `package.json` file in the sample application and the `VCAP_APPLICATION` and `VCAP_SERVICES` environment variables in IBM Cloud and other Cloud Foundry platforms. This data is used by IBM to track metrics around deployments of sample applications to IBM Cloud to measure the usefulness of our examples, so that we can continuously improve the content we offer to you. Only deployments of sample applications that include code to ping the Deployment Tracker service will be tracked.
150
+
151
+
## Disabling Deployment Tracking
152
+
153
+
To disable tracking, simply remove ``require("cf-deployment-tracker-client").track();`` from the ``app.js`` file in the top level directory.
154
+
155
+
# Links
156
+
*[Demo on Youtube](https://www.youtube.com/watch?v=Jxi7U7VOMYg)
***Container Orchestration Code Patterns**: Enjoyed this Code Pattern? Check out our other [Container Orchestration Code Patterns](https://developer.ibm.com/code/technologies/container-orchestration/).
162
+
***Kubernetes on IBM Cloud**: Deliver your apps with the combined the power of [Kubernetes and Docker on IBM Cloud](https://www.ibm.com/cloud-computing/bluemix/containers)
0 commit comments