Skip to content
This repository was archived by the owner on Jul 18, 2024. It is now read-only.

Commit 2ab07e8

Browse files
jungcwanimeshsingh
authored andcommitted
Adding Korean version of README.md file (README.ko.md) (#22)
* Adding Korean translated version - README.md file name it as README-ko.md * added link to Korean version of README.md * Delete README-ko.md * Korean version of README.md
1 parent 67c1b0b commit 2ab07e8

File tree

2 files changed

+204
-0
lines changed

2 files changed

+204
-0
lines changed

README.ko.md

Lines changed: 202 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,202 @@
1+
[![Build Status](https://travis-ci.org/IBM/Kubernetes-container-service-GitLab-sample.svg?branch=master)](https://travis-ci.org/IBM/Kubernetes-container-service-GitLab-sample)
2+
3+
# 쿠버네티스 클러스터에 GitLab 구축하기
4+
5+
본 프로젝트는 일반적인 멀티 컴포넌트 워크로드(여기에서는 GitLab)를 쿠버네티스 클러스터에 구축하는 방법을 소개합니다. Git 기반의 코드 트래킹 툴로 잘 알려져 있는 GitLab은 전형적인 멀티-티어 앱으로, 각 구성요소마다 각각의 컨터이너 기반으로 실행됩니다. 마이크로서비스 컨테이너들이 웹 티어와 상태/작업 내용 캐싱을 위한 Redis, 그리고 데이터베이스용으로 PostgreSQL에 이용됩니다.
6+
7+
다양한 GitLab 구성요소(NGINX, Ruby on Rails, Redis, PostgreSQL 등)들이 쿠버네티스 환경에 구성될 것입니다. 이 예제는 Bluemix의 Compose for PostgreSQL라는 관리형 데이터베이스로도 구성이 가능합니다.
8+
9+
![흐름도](images/gitlab_container_2.png)
10+
11+
1. 사용자가 웹 인터페이스를 통해, 또는 GitHub 저장소에 코드를 푸시하여 GitLab을 사용합니다. GitLab 컨테이너는 NGINX와 gitlab-workhorse(파일 다운로드 또는 Git 푸시/풀과 같은 대량의 HTTP 요청을 위한 리버시 프록시 역할을 하는) 뒤에서 메인 Ruby on Rails 애플리케이션을 실행합니다. GitLab은 HTTP/HTTPS를 통해 저장소를 제공함과 동시에, GitLab API를 활용하여 권한부여 및 접근권한을 함으로써 Git 오브젝트를 제공합니다.
12+
13+
2. 인증 및 권한부여 확인 후에, GitLab Rails 애플리케이션이 새로이 요청되는 작업, 작업 정보, 메타데이터 등을 비영구적 데이터베이스의 역할을 하는 Redis 작업 대기열로 전송합니다.
14+
15+
3. Git 저장소가 로컬 파일 시스템에 생성됩니다.
16+
17+
4. 사용자가 사용자, 역할, 병합 요청, 그룹 등을 생성하면, PostgreSQL에 모두 저장됩니다.
18+
19+
5. 사용자가 Git 쉘을 통하여 Git 저장소에 접근합니다.
20+
21+
## 포함된 구성요소
22+
- [GitLab](https://about.gitlab.com/)
23+
- [PostgreSQL](https://www.postgresql.org/)
24+
- [Redis](https://redis.io/)
25+
- [쿠버네티스 클러스터(Kubernetes Clusters)](https://console.ng.bluemix.net/docs/containers/cs_ov.html#cs_ov)
26+
- [Bluemix 컨테이너 서비스(Bluemix container service)](https://console.ng.bluemix.net/catalog/?taxonomyNavigation=apps&category=containers)
27+
- [Bluemix Compose for PostgreSQL](https://console.ng.bluemix.net/catalog/services/compose-for-postgresql)
28+
29+
## 목표
30+
이 시나리오는 하기 작업들에 대한 가이드를 제공합니다.
31+
32+
- 컨테이너 빌드 및 컨테이너 레지스트리에 빌드된 컨테이너 저장하기
33+
- 쿠버네티스 상에서 영구적 디스크를 정의하기 위해 로컬 PersistentVolume (PV) 생성하기
34+
- 쿠버네티스 pods 및 서비스를 사용해 컨테이너 구성하기
35+
- 쿠버네티스 애플리케이션 상에서 Bluemix 서비스 이용하기
36+
- 쿠버네티스에 분산형 GitLab 구성하기
37+
38+
## 구성 시나리오
39+
40+
### 도커(Docker)를 활용한 구성
41+
42+
[도커를 활용한 Gitlab 구성(Deploy GitLab with Docker)](docs/deploy-with-docker.md)을 참고하십시오.
43+
44+
### 쿠버네티스 환경에 구성하기
45+
46+
로컬 환경에서 테스트를 위해서는 [미니큐브(Minikube)](https://kubernetes.io/docs/getting-started-guides/minikube)로, 클라우드 상에서는 [IBM Bluemix 컨테이너 서비스(IBM Bluemix Container Service](https://github.com/IBM/container-journey-template#container-journey-template---creating-a-kubernetes-cluster) 를 활용하여 쿠버네티스 클러스터를 생성하십시오. 본 예제의 코드는 Travis를 사용하여 [Bluemix 컨테이너 서비스의 쿠버네티스 클러스터(Kubernetes Cluster from Bluemix Container Service)](https://console.ng.bluemix.net/docs/containers/cs_ov.html#cs_ov) 상에서 정기적으로 테스트 됩니다.
47+
48+
Bluemix 컨테이너 레지스트리(Bluemix Container Registry)를 이용하고자 하는 경우, Bluemix 컨테이너 레지스트리에 [이미지 업로드(Uploading the images)](docs/use-bluemix-container-registry)하여 시작할 수 있습니다.
49+
50+
### Bluemix 컨테이너 서비스의 쿠버네티스 클러스터 환경에 DevOps 툴체인 이용하여 구성하기
51+
Gitlab을 Bluemix 환경에 직접 구성하고자 한다면, 아래의 ‘Deploy to Bluemix’ 버튼을 클릭하여 Gitlab 예제 구성을 위한  [Bluemix DevOps s서비스 툴체인과 파이프라인](https://console.ng.bluemix.net/docs/services/ContinuousDelivery/toolchains_about.html#toolchains_about)을 생성하십시오. 그렇지 않은 경우 [단계](#단계)로 이동하십시오.
52+
53+
[![Create Toolchain](https://github.com/IBM/container-journey-template/blob/master/images/button.png)](https://console.ng.bluemix.net/devops/setup/deploy/)
54+
55+
[툴체인 가이드](https://github.com/IBM/container-journey-template/blob/master/Toolchain_Instructions_new.md)를 참고하여 툴체인과 파이프라인을 완성하십시오.
56+
57+
#### 단계
58+
59+
1. [쿠버네티스를 사용하여 서비스 및 Deployment 생성](#1-use-kubernetes-to-create-services-and-deployments-for-gitlab-redis-and-postgresql) 하기
60+
- 1.1 [별도 PostgreSQL 컨테이너 구성하여 사용하기](#11-use-postgresql-in-container) 또는
61+
- 1.2 [Bluemix의 PostgreSQL 사용하기 (Bluemix Compose for PostgreSQL)](#12-use-postgresql-from-bluemix)
62+
2. [GitLab접근을 위한 외부 ip 및 포트 확인하기](#2-retrieve-external-ip-and-port-for-gitlab)
63+
3. [GitLab이 준비되었습니다! GitLab을 사용하여 저장소를 관리하십시오](#3-gitlab-is-ready-use-gitlab-to-host-your-repositories)
64+
65+
#### 1. 쿠버네티스를 사용하여 GitLab, Redis, PostgreSQL용 서비스 및 Deployment생성 하기
66+
67+
쿠버네티스 클러스터가 `kubectl` 명령 실행을 통해 연결 가능한지 확인하십시오.
68+
69+
```bash
70+
$ kubectl get nodes
71+
NAME STATUS AGE VERSION
72+
x.x.x.x Ready 17h v1.5.3-2+be7137fd3ad68f
73+
```
74+
75+
> 참고:이 단계에서 실패하는 경우, [Minikube](https://kubernetes.io/docs/getting-started-guides/minikube) 또는 [IBM Bluemix Container Service](https://console.ng.bluemix.net/docs/containers/cs_troubleshoot.html#cs_troubleshoot)의 문제해결 문서를 참고하십시오.
76+
77+
##### 1.1 별도의 PostgreSQL 컨테이너 사용하기
78+
79+
PostgreSQL를 위한 별도 컨테이너 이미지를 사용하고 있다면, 다음 명령들을 실행하거나 퀵스타트 스크립트 `bash quickstart.sh` 를 통해 쿠버네티스 클러스터 상에서 실행시킵니다.
80+
81+
```bash
82+
$ kubectl create -f kubernetes/local-volumes.yaml
83+
$ kubectl create -f kubernetes/postgres.yaml
84+
$ kubectl create -f kubernetes/redis.yaml
85+
$ kubectl create -f kubernetes/gitlab.yaml
86+
```
87+
88+
서비스와 deployment가 모두 생성한 후에는 3-5분 간 대기해야 합니다. 쿠버네티스 UI에서 배치 현황을 확인할 수 있습니다. 'kubectl proxy' 명령어를 실행 후, 브라우저 상에서 'http://127.0.0.1:8001/ui' 로 이동하면 GitLab 컨테이너가 언제 준비되는지 확인 가능합니다.
89+
90+
![Kubernetes Status Page](images/kube_ui.png)
91+
92+
그 다음 [GitLab용 외부 ip 및 포트를 확인하십시오.(2-retrieve-external-ip-and-port-for-GitLab)
93+
94+
##### 1.2 Bluemix의 PostgreSQL 사용하기 (Bluemix Compose for PostgreSQL)
95+
96+
Bluemix 카탈로그나 bx 명령을 사용하여 Compose for PostgreSQL 의 서비스 인스턴스를 생성하고, 신임정보를 추가할 수 있습니다.
97+
98+
```bash
99+
$ bx service create compose-for-postgresql Standard "Compose for PostgreSQL-GL"
100+
$ bx service key-create "Compose for PostgreSQL-GL" Credentials-1
101+
```
102+
103+
Bluemix에 위치한 서비스의 신임정보 오브젝트에서 연결되는 문자열을 검색하십시오.
104+
105+
```bash
106+
$ bx service key-show "Compose for PostgreSQL-GL" "Credentials-1" | grep "postgres:"
107+
```
108+
109+
![Postgres Connection String example](images/pg_credentials.png)
110+
111+
```kubernetes/gitlab-postgres-svc.yaml```파일을 수정하고, COMPOSE_PG_PASSWORD는 암호로, COMPOSE_PG_HOST는 호스트네임으로, COMPOSE_PG_PORT는 포트로 바꾸십시오
112+
113+
위 예의 사용 후, ```env:``` 섹션은 아래와 같이 보입니다.
114+
115+
```yaml
116+
env:
117+
- name: GITLAB_OMNIBUS_CONFIG
118+
value: |
119+
postgresql['enable'] = false
120+
gitlab_rails['db_username'] = "admin"
121+
gitlab_rails['db_password'] = "ETIDRKCGOEIGBMZA"
122+
gitlab_rails['db_host'] = "bluemix-sandbox-dal-9-portal.6.dblayer.com"
123+
gitlab_rails['db_port'] = "26576"
124+
gitlab_rails['db_database'] = "compose"
125+
gitlab_rails['db_adapter'] = 'postgresql'
126+
gitlab_rails['db_encoding'] = 'utf8'
127+
redis['enable'] = false
128+
gitlab_rails['redis_host'] = 'redis'
129+
gitlab_rails['redis_port'] = '6379'
130+
gitlab_rails['gitlab_shell_ssh_port'] = 30022
131+
external_url 'http://gitlab.example.com:30080'
132+
133+
```
134+
135+
136+
다음 명령들을 실행하거나 쿠버네티스 클러스터로 퀵스타트 스크립트 `bash quickstart-postgres-svc.sh`를 실행하십시오.
137+
138+
```bash
139+
$ kubectl create -f kubernetes/local-volumes.yaml
140+
$ kubectl create -f kubernetes/redis.yaml
141+
$ kubectl create -f kubernetes/gitlab-postgres-svc.yaml
142+
```
143+
144+
서비스와 배치를 모두 생성한 후에는 3-5분 간 대기해야 합니다. 쿠버네티스 UI에서 배치 현황을 확인할 수 있습니다. 'kubectl proxy'를 실행하여 URL 'http://127.0.0.1:8001/ui' 로 이동하면 GitLab 컨테이너가 언제 준비되는지 확인 가능합니다.
145+
146+
![Kubernetes Status Page](images/kube_ui_gr.png)
147+
148+
### 2. GitLab외부 접속 ip 및 포트 확인하기
149+
150+
몇 분 후에 다음 명령을 실행하여 외부 IP와 NodePort 번호를 확인하십시오.
151+
152+
```bash
153+
$ kubectl get nodes
154+
NAME STATUS AGE
155+
169.47.241.22 Ready 23h
156+
$ kubectl get svc gitlab
157+
NAME CLUSTER-IP EXTERNAL-IP PORT(S) AGE
158+
gitlab 10.10.10.148 <nodes> 80:30080/TCP,22:30022/TCP 2s
159+
```
160+
161+
> 참고: 30080 포트는 gitlab UI에 사용되고, 30022 포트는 ssh에 사용됩니다.
162+
163+
> 참고: gitlab 외부 url은 `gitlab.example.com` 으로 설정됩니다. 이 url이 상기 IP 주소를 가리키도록 호스트 파일에 추가하면 gitlab이 예상하는 url을 통해 사용할 수 있습니다. 이것이 불가능할 경우, IP 주소(이 예에서는 169.47.241.22)를 사용하면 됩니다.
164+
165+
> 참고: 만약 Minikube를 이용하여 로컬환경에서 쿠버네티스를 구성하는 경우, `minikube service list` 명령을 통해 서비스들에 대한 IP 주소를 확인할 수 있습니다.
166+
167+
축하합니다. 이제, 링크 [http://gitlab.example.com:30080](http://gitlab.example.com:30080) 또는 http://<node_ip>:30080 을 이용하여 웹 브라우저에서 gitlab 서비스에 액세스할 수 있습니다.
168+
### 3. GitLab이 준비되었습니다! GitLab을 사용하여 저장소를 관리하십시오
169+
170+
Gitlab이 실행되고 있으므로, [신규 사용자로 등록하고 프로젝트를 생성할 수 있습니다.](docs/using-gitlab.md).
171+
172+
### 문제 해결
173+
174+
pods가 시작되지 않는다면, 로그를 확인해보십시오.
175+
```bash
176+
kubectl get pods
177+
kubectl logs <pod name>
178+
```
179+
180+
### 정리
181+
182+
서비스, deployment, 생성된 볼륨 등을 모두 삭제하고자 하는 경우, 다음 명령을 실행하십시오.
183+
184+
```bash
185+
kubectl delete deployment,service,pvc -l app=gitlab
186+
```
187+
188+
PersistentVolume(PV)을 삭제하는 명령:
189+
190+
```bash
191+
kubectl delete pv local-volume-1 local-volume-2 local-volume-3
192+
```
193+
194+
PostgreSQL 신임정보를 삭제하는 명령 및 Bluemix에서 서비스 인스턴스를 제거하는 명령:
195+
196+
```bash
197+
bx service key-delete "Compose for PostgreSQL-GL" Credentials-1
198+
bx service delete "Compose for PostgreSQL-GL"
199+
```
200+
201+
# 라이센스
202+
[Apache 2.0](LICENSE)

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
# GitLab deployment on Kubernetes Cluster
44

5+
*Read this in other languages: [한국어](README.ko.md).*
6+
57
This project shows how a common multi-component workload, in this case GitLab, can be deployed on Kubernetes Cluster. GitLab is famous for its Git-based and code-tracking tool. GitLab represents a typical multi-tier app and each component will have their own container(s). The microservice containers will be for the web tier, the state/job database with Redis and PostgreSQL as the database.
68

79
By using different GitLab components (NGINX, Ruby on Rails, Redis, PostgreSQL, and more), you can deploy it to Kubernetes. This example is also deployable using Compose for PostgreSQL in Bluemix as the database.

0 commit comments

Comments
 (0)