在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):IBM/deploy-react-kubernetes开源软件地址(OpenSource Url):https://github.com/IBM/deploy-react-kubernetes开源编程语言(OpenSource Language):JavaScript 77.2%开源软件介绍(OpenSource Introduction):Deploy a React application on KubernetesDo you have a front end application that contains large amounts of duplication, handles complex states, and manages large amounts of data? React and Redux is the perfect Javascript library if your application is similar to the one described above. React provides a component based structure for everything included in an application and allows abstraction if needed to limit duplication. With Redux, it handles all of the state and can easily manage data in an application. Once an application has been developed, it needs to be deployed for the rest of the world to see. There are many choices when looking for the right solution to manage and deploy your application. It can often be overwhelming when you're trying to pick the right solution. If you're looking for a deployment tool that can provide automation, scalability and management of a deployed application, Kubernetes is the tool for you! An application must be packaged into a container to deploy on Kubernetes. Docker is an open source tool that is used to package the application into a container. The container is then deployed on Kubernetes for public access. Once the application is deployed, Kubernetes handles the management, scalability and automation of the deployed application. In this Code Pattern, we will deploy a React application using Kubernetes. This repository uses the React Javascript library alongside Redux to build out the front end of the application. The OMDb API is used to get movie information based on user input. Redux handles the data between the application and the API, as well as the state between components. Docker is used to package the application and Kubernetes is used to deploy the container. When the reader has completed this Code Pattern, they will understand how to:
Flow
Included components
Featured technologies
Watch the videoStepsPrerequisites
Run locally1. Clone the repoClone the repo locally. In a terminal, run:
2. Run the application
Verify app is running and working correctly. Run the application using DockerPrerequisites:1. Build the imageIn a terminal, run:
Your image should be listed by running:
2. Run the imageIn a terminal, run:
You can now access the application at http://localhost:3000 Run the application on KubernetesPrerequisites
If you have a federated ID, use ibmcloud login --sso to log in to the IBM Cloud CLI.
Copy and paste response in CLI
1. Build imageBuild image in the IBM Container Registry:
2. Deploy the application
To check how many pods are running on Kubernetes run the command:
Expose the app to the web by setting the port. Run the command:
You can now access the application at http://IP_ADDRESS:NODE_PORT Run the application on Kubernetes with a yaml fileNote: Follow the prerequisites in 'Run the application on Kubernetes section' before executing command below.
Sample outputLinksLearn more
LicenseThis code pattern is licensed under the Apache Software License, Version 2. Separate third party code objects invoked within this code pattern are licensed by their respective providers pursuant to their own separate licenses. Contributions are subject to the Developer Certificate of Origin, Version 1.1 (DCO) and the Apache Software License, Version 2. Apache Software License (ASL) FAQ |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论