Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
K
K8s Project
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Joël Cori
K8s Project
Commits
34e67e67
Commit
34e67e67
authored
11 months ago
by
Joël Cori
Browse files
Options
Downloads
Patches
Plain Diff
UPDATE readme
parent
5ff29c5c
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
ReadMe_deploy_online_boutique.md
+141
-139
141 additions, 139 deletions
ReadMe_deploy_online_boutique.md
with
141 additions
and
139 deletions
deploy_online_boutique.md
→
ReadMe_
deploy_online_boutique.md
+
141
−
139
View file @
34e67e67
# Online Boutique Deployment
## Getting Started
### Step 1: Clone the Repository
Clone the Online Boutique repository to your local machine.
```
sh
git clone https://gitlab.unige.ch/oct_cui/k8s-project.git
cd
k8s-project
```
### (Step 2: Pull the Docker Images)
Make the script executable by running:
```
sh
chmod
+x pull_images.sh
```
Run the Script
```
sh
./pull_images.sh
```
### Step 3: Build Docker Images
Build the Docker images for each microservice. You can use the following commands:
```
sh
cd
src/adservice
sudo
docker build
-t
adservice:latest
.
cd
../cartservice
sudo
docker build
-t
cartservice:latest
.
cd
../checkoutservice
sudo
docker build
-t
checkoutservice:latest
.
cd
../currencyservice
sudo
docker build
-t
currencyservice:latest
.
cd
../emailservice
sudo
docker build
-t
emailservice:latest
.
cd
../frontend
sudo
docker build
-t
frontend:latest
.
cd
../paymentservice
sudo
docker build
-t
paymentservice:latest
.
cd
../productcatalogservice
sudo
docker build
-t
productcatalogservice:latest
.
cd
../recommendationservice
sudo
docker build
-t
recommendationservice:latest
.
cd
../shippingservice
sudo
docker build
-t
shippingservice:latest
.
```
### Step 3: Check the Kubernetes Deployment with Helm
Ensure your Helm chart is set up correctly. The directory structure should look like this:
```
online-boutique/
├── charts/
├── templates/
├── deployment.yaml
├── frontend-deployment.yaml
├── frontend-service.yaml
├── hpa.yaml
├── ingress.yaml
├── NOTES.txt
├── service.yaml
├── serviceaccount.yaml
├── values.yaml
└── Chart.yaml
```
### Step 4: Deploy the Helm Chart
Deploy the Online Boutique Helm chart:
```
sh
microk8s helm3 upgrade
--install
online-boutique ./online-boutique
```
### Step 5: Verify Deployment
Verify that all pods and services are running correctly:
```
sh
microk8s kubectl get pods
microk8s kubectl get svc
```
### Step 6: Port Forward the Frontend Service
Port forward the frontend service to access the application:
```
sh
microk8s kubectl port-forward svc/frontend 8080:8080
```
### Step 7: Access the Application
Open your browser and navigate to:
```
http://localhost:8080
```
You should see the Online Boutique application running. You can now interact with the app, browse products, add items to the cart, and checkout.
## Troubleshooting
If you encounter any issues, check the logs of the respective pods:
```
sh
microk8s kubectl logs <pod-name>
```
For more detailed debugging, you can describe the resources:
```
sh
microk8s kubectl describe pod <pod-name>
microk8s kubectl describe svc <svc-name>
```
## Cleanup
To remove the deployment, use the following command:
```
sh
microk8s helm3 uninstall online-boutique
```
To stop and remove MicroK8s, use:
```
sh
microk8s stop
microk8s reset
# Online Boutique Deployment
ubuntu@10.195.71.93
## Getting Started
### Step 1: Clone the Repository
Clone the Online Boutique repository to your local machine.
```
sh
git clone https://gitlab.unige.ch/oct_cui/k8s-project.git
cd
k8s-project
```
### (Step 2: Pull the Docker Images)
Make the script executable by running:
```
sh
chmod
+x pull_images.sh
```
Run the Script
```
sh
./pull_images.sh
```
### Step 3: Build Docker Images
Build the Docker images for each microservice. You can use the following commands:
```
sh
cd
src/adservice
sudo
docker build
-t
adservice:latest
.
cd
../cartservice
sudo
docker build
-t
cartservice:latest
.
cd
../checkoutservice
sudo
docker build
-t
checkoutservice:latest
.
cd
../currencyservice
sudo
docker build
-t
currencyservice:latest
.
cd
../emailservice
sudo
docker build
-t
emailservice:latest
.
cd
../frontend
sudo
docker build
-t
frontend:latest
.
cd
../paymentservice
sudo
docker build
-t
paymentservice:latest
.
cd
../productcatalogservice
sudo
docker build
-t
productcatalogservice:latest
.
cd
../recommendationservice
sudo
docker build
-t
recommendationservice:latest
.
cd
../shippingservice
sudo
docker build
-t
shippingservice:latest .
```
### Step 3: Check the Kubernetes Deployment with Helm
Ensure your Helm chart is set up correctly. The directory structure should look like this:
```
online-boutique/
├── charts/
├── templates/
├── deployment.yaml
├── frontend-deployment.yaml
├── frontend-service.yaml
├── hpa.yaml
├── ingress.yaml
├── NOTES.txt
├── service.yaml
├── serviceaccount.yaml
├── values.yaml
└── Chart.yaml
```
### Step 4: Deploy the Helm Chart
Deploy the Online Boutique Helm chart:
```
sh
microk8s helm3 upgrade
--install
online-boutique ./online-boutique
```
### Step 5: Verify Deployment
Verify that all pods and services are running correctly:
```
sh
microk8s kubectl get pods
microk8s kubectl get svc
```
### Step 6: Port Forward the Frontend Service
Port forward the frontend service to access the application:
```
sh
microk8s kubectl port-forward svc/frontend 8080:8080
```
### Step 7: Access the Application
Open your browser and navigate to:
```
http://localhost:8080
```
You should see the Online Boutique application running. You can now interact with the app, browse products, add items to the cart, and checkout.
## Troubleshooting
If you encounter any issues, check the logs of the respective pods:
```
sh
microk8s kubectl logs <pod-name>
```
For more detailed debugging, you can describe the resources:
```
sh
microk8s kubectl describe pod <pod-name>
microk8s kubectl describe svc <svc-name>
```
## Cleanup
To remove the deployment, use the following command:
```
sh
microk8s helm3 uninstall online-boutique
```
To stop and remove MicroK8s, use:
```
sh
microk8s stop
microk8s reset
```
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment