---
# System prepended metadata

title: 如何將系統做上雲處理相關實務演練
tags: [fubon, ocp]

---

---
title: 如何將系統做上雲處理相關實務演練
tags: ocp,fubon
---
如何將系統做上雲處理相關實務演練
===
[TOC]

## k8s-full-course 課程(resource+lab)
- https://git.webcomm.com.tw/POC/k8s-full-course

## 專案參考
- 富邦-OPENAPI
    - https://git.webcomm.com.tw/FUBON/FUBON_OPEN_API
- 富邦-OAuth Server
    - https://git.webcomm.com.tw/FUBON/FUBON_IDAUTH
- 富邦-搶碼活動
    - https://git.webcomm.com.tw/FUBON/Fubon-1111
- 富邦-富盛上雲
    - https://git.webcomm.com.tw/FUBON/JSB_MIGRATION_OCP/src/branch/%E5%AF%8C%E7%9B%9B%E6%A1%88%E4%B8%8A%E9%9B%B2
- 新光-Redis Cluster(使用 Helm 安裝)
    - https://git.webcomm.com.tw/POC/redis-cluster



## 參考資料
- Cloud Lab tutorial
    - https://hackmd.io/@S_HP7z6qQmC4l2tX34ATug/SkyBm8Qx9/%2FrOqjbnkbTWCtgbWGbcy6oQ


## 包版練習
### lab1-1.1 (體會 Container 的生命週期)
```
1. 起 container
2. 刪 container
3. 起 container, 置入 檔案 -> 刪除 container
4. 起 container -> 體會 container 重新來的機制
```
`docker run -d --name=my-build  maven:latest tail -f /dev/null`
`docker images`
`docker ps -a`
`docker rm 563`
`docker rm my-build`
`docker stop my-build && docker rm my-build`
`docker exec -it my-build sh`
`docker stop my-build`
`docker start my-build`
`docker exec -it my-build sh`

### lab1-1.2(體會 container 外掛資料夾的機制(狀態外部化))

![](https://hackmd.io/_uploads/ByAojWYhc.png)

`docker run -d --name=my-build -v $OLDPWD/customer-application:/app -v $OLDPWD/build/repository:/root/.m2/repository -w /app maven:latest tail -f /dev/null`

### lab1-1.3 (建立 Jar 檔)
```
利用 container 進行包版
```
`docker run -it --rm --name=my-build -v $OLDPWD/customer-application:/app -v $OLDPWD/build/repository:/root/.m2/repository -w /app maven:latest mvn clean install -f pom.xml`
`docker logs my-build --follow`

### lab1-1.4 (建立自己的 Image)
```
docker build -t my-customer-application:1.0.0 $OLDPWD/customer-application
```

### lab6-Graceful shutdown

`docker stop -t 30  my-customer-application`
`docker logs my-customer-application --follow`


## COMMAND 參考
### Linux
`ps -aux`
`ls -lst `
`pwd`
`touch aa.txt`
### OC CMD

`oc get deployment`
`oc describe deployment`
`oc describe deployment customer-application-000`
`oc get pods`
`oc get pods customer-application-006-9867b5c4c-thd99`
`oc describe pods customer-application-006-9867b5c4c-thd99`
`oc exec -it customer-application-000-65bd956d95-fgjvj sh`

`oc get service`