Add custom files

This commit is contained in:
wbsong111
2024-11-25 15:54:18 +09:00
parent 41cb81de75
commit 4841267126
3 changed files with 179 additions and 0 deletions
+72
View File
@@ -0,0 +1,72 @@
# postgres-ha 버전 갱신 가이드
## 1. git 작업 환경 구성
- 서비스 카탈로그 git 다운로드
```
$ git clone https://github.com/paasup/service-catalog.git
```
- 작업 브랜치로 체크아웃
```
$ git checkout -b update-rancher/2.9.1
```
## 2. helm 차트 버전 업데이트
- README-build.md, custom-values.yaml(이름 미정)을 제외한 파일 삭제
``` sh
# chart 디렉토리로 이동
cd ~/service-catalog/charts/rancher
# 파일 삭제 전 삭제할 파일 목록 확인
find . -mindepth 1 \( -name "CUSTOM-README.md" -o -name "BUILD-README.md" -o -name "custom-values.yaml" \) -prune -o -print
# 파일 삭제
find . -mindepth 1 \(-name "CUSTOM-README.md" -o -name "BUILD-README.md" -o -name "custom-values.yaml" \) -prune -o -exec rm -rf {} +
```
- bitnami/postgres-ha 차트 다운로드
``` sh
# charts 디렉토리로 이동
cd ~/service-catalog/charts
# helm repo 추가
helm repo add rancher-latest https://releases.rancher.com/server-charts/latest
helm repo update
# helm 차트
helm pull rancher-latest/rancher --version="2.9.1"
# 차트 변경
tar xzvf rancher*.tgz
# 필요 없는 파일 삭제
rm rancher-*.tgz
```
## 3. git push 및 tag 추가
- 갱신작업 진행후 commit
```
$ git add .
$ git commit -m "update rancher/2.9.1"
```
- main 브랜치에 체크아웃 후 merge
```
$ git checkout main
$ git merge update-rancher/2.9.1
```
- git에 push 후 작업 브랜치 삭제
```
$ git push -u origin main
$ git branch -d update-rancher/2.9.1
```
- git tag 추가 후 push
```
$ git tag rancher/2.9.1
$ git push origin rancher/2.9.1
```
+73
View File
@@ -0,0 +1,73 @@
# Rancher 배포
## 1. 배포시 주의 사항
- ingress 배포를 위해서는 인증서가 [secret으로 배포](#인증서-secret-생성)되어 있어야 한다.
- [사설 인증서 사용](#사설-인증서-사용)시 ca를 secret으로 배포되어 있어야 한다.
## 2.custom-values.yaml 설명
- custom-values.yaml에 정의된 값에 대한 설명이다.
### 1) 오프라인 설정
- private 환경 배포시 사용한다.
| Name | 설명 | 기본값 |
| ---------------------- | ------------------------------------------------------------ | ------ |
| `systemDefaultRegistry` | 오프라인 설치 시에 설정. <br />paasup 설치시에는 "paasup.io"로 설정 | `""` |
| `rancherImage` | 오프라인 설치 시에 설정. <br />paasup 설치시에는 "paasup.io/rancher/rancher"로 설정 | `""` |
### 2) Pod 설정
| Name | 설명 | 기본값 |
| ------------------------ | ---------------------------------- | --------- |
| `extraEnv` | rancher pod의 replicas 설정. | "1" |
| `replicas` | rancher pod의 replicas 설정. | "1" |
| `tolerations` | rancher pod의 toleration 설정. | `[]` |
| `nodeSelector` | rancher pod의 nodeSelector 설정. | `{}` |
| `resources.request.cpu` | rancher pod의 cpu requst 설정. | `"100m"` |
| `resources.request.memory` | rancher pod의 memory requst 설정. | `"300Mi"` |
| `resources.limits.cpu` | rancher pod의 cpu limits 설정. | `"300m"` |
| `resources.limits.memory` | rancher pod의 memory limits 설정. | `500Mi` |
### 3) Timezone 설정
- pod의 기본 timezone 설정을 위해 추가.
- 기본값으로 KST를 사용하기 위하여 Asia/Seolul로 설정하였다.
``` yaml
extraEnv:
- name: TZ
value: Asia/Seoul
```
### 4) Ingress 설정
- Rancher에서 ingress 사용을 위해서는 다음과 같이 설정할 수 있다.
``` yaml
# ingress 배포 전 인증서 secret 배포 필요(secret 이름은 platform)
hostname: rancher.example.org
ingress:
enable: true
tls:
source: secret
secretName: rancher-tls-ingress
extraAnnotations:
nginx.ingress.kubernetes.io/proxy-body-size: 10m
# 사설인증서 사용시 true 설정
privateCA: true
```
#### 인증서 secret 생성
- ingress 사용을 위해서는 인증서를 secret으로 제공해야한다. 로컬 파일을 이용해 secret을 생성하는 방법은 다음과 같다.
``` sh
kubectl create secret tls rancher-tls-ingress --cert=<path-to-cert-file> --key=<path-to-key-file> -n <namespace>
```
#### 사설 인증서 사용
- 사설 인증서 사용시에는 ca를 secret으로 생성해야 한다. 로컬 파일을 이용해 secret을 생성하는 방법은 다음과 같다. secret의 이름은 `tls-ca`로 생성해야 한다.
``` sh
kubectl create secret generic tls-ca --from-file=${CERT_FILE} -n ${NAMESPACE}
```
+34
View File
@@ -0,0 +1,34 @@
## 오프라인 환경에서 rancher의 기본 registry 설정
# systemDefaultRegistry: paasup.io
# rancherImage: paasup.io/rancher/rancher
## ingress 설정
hostname: rancher.example.org
ingress:
enable: true
tls:
source: secret
secretName: rancher-tls-ingress
extraAnnotations:
nginx.ingress.kubernetes.io/proxy-body-size: 10m
# 사설 인증서 사용시 true
privateCA: true
replicas: 1
tolerations: []
nodeSelector: {}
resources:
requests:
cpu: 100m
memory: 500Mi
limits:
cpu: 1000m
memory: 1000Mi
extraEnv:
- name: TZ
value: Asia/Seoul