[AWS] EKS GitLab 설치

dongdorrong·2022년 12월 17일
0

AWS

목록 보기
5/7
post-thumbnail

참고 레퍼런스

https://docs.gitlab.com/charts/quickstart/index.html

0. kubectl 설치 (링크)

1. Helm 설치 (링크)

2. EKS 클러스터 생성

root@gitlabhost:~#
root@gitlabhost:~#
root@DESKTOP-5582D12:/mnt/g/내 드라이브/Jobs/5. 공부/eks_gitlab# cat cluster.yml
apiVersion: eksctl.io/v1alpha5
kind: ClusterConfig
metadata:
  name: gitlab-test
  region: ap-southeast-1
nodeGroups:
  - name: ng-1
    instanceType: t3.medium
    desiredCapacity: 2
    volumeSize: 10
root@gitlabhost:~# eksctl create cluster -f cluster.yml
2022-12-18 07:13:14 []  eksctl version 0.122.0
2022-12-18 07:13:14 []  using region ap-southeast-1
2022-12-18 07:13:14 []  setting availability zones to [ap-southeast-1a ap-southeast-1c ap-southeast-1b]
2022-12-18 07:13:14 []  subnets for ap-southeast-1a - public:192.168.0.0/19 private:192.168.96.0/19
2022-12-18 07:13:14 []  subnets for ap-southeast-1c - public:192.168.32.0/19 private:192.168.128.0/19
2022-12-18 07:13:14 []  subnets for ap-southeast-1b - public:192.168.64.0/19 private:192.168.160.0/19
...
...
2022-12-18 07:30:48 []  nodegroup "ng-1" has 0 node(s)
2022-12-18 07:30:48 []  waiting for at least 2 node(s) to become ready in "ng-1"
2022-12-18 07:31:45 []  nodegroup "ng-1" has 2 node(s)
2022-12-18 07:31:45 []  node "ip-192-168-24-53.ap-southeast-1.compute.internal" is ready
2022-12-18 07:31:45 []  node "ip-192-168-48-155.ap-southeast-1.compute.internal" is ready
2022-12-18 07:31:48 []  kubectl command should work with "/root/.kube/config", try 'kubectl get nodes'
2022-12-18 07:31:48 []  EKS cluster "gitlab-test" in "ap-southeast-1" region is ready

3. GitLab Helm repository 추가

root@gitlabhost:~# helm repo add gitlab https://charts.gitlab.io/
"gitlab" has been added to your repositories
root@gitlabhost:~# helm repo list
NAME    URL
gitlab  https://charts.gitlab.io/

4. GitLab 설치

root@gitlabhost:~# helm install gitlab gitlab/gitlab \
  --set global.hosts.domain=<dongdorrong 도메인 주소> \
  --set certmanager-issuer.email=<dongdorrong 메일 주소>
NAME: gitlab
LAST DEPLOYED: Sun Dec 18 07:37:23 2022
NAMESPACE: default
STATUS: deployed
REVISION: 1
NOTES:
=== NOTICE
The minimum required version of PostgreSQL is now 12. See https://gitlab.com/gitlab-org/charts/gitlab/-/blob/master/doc/installation/upgrade.md for more details.

=== NOTICE
You've installed GitLab Runner without the ability to use 'docker in docker'.
The GitLab Runner chart (gitlab/gitlab-runner) is deployed without the `privileged` flag by default for security purposes. This can be changed by setting `gitlab-runner.runners.privileged` to `true`. Before doing so, please read the GitLab Runner chart's documentation on why we
chose not to enable this by default. See https://docs.gitlab.com/runner/install/kubernetes.html#running-docker-in-docker-containers-with-gitlab-runners
Help us improve the installation experience, let us know how we did with a 1 minute survey:https://gitlab.fra1.qualtrics.com/jfe/form/SV_6kVqZANThUQ1bZb?installation=helm&release=15-6

=== NOTICE
The in-chart NGINX Ingress Controller has the following requirements:
    - Kubernetes version must be 1.19 or newer.
    - Ingress objects must be in group/version `networking.k8s.io/v1`.
root@gitlabhost:~# 
root@gitlabhost:~# 
root@gitlabhost:~# # kubectl get svc gitlab-webservice-default
NAME                        TYPE        CLUSTER-IP      EXTERNAL-IP   PORT(S)                      AGE
gitlab-webservice-default   ClusterIP   10.100.31.180   <none>        8080/TCP,8181/TCP,8083/TCP   13m
root@gitlabhost:~# 
root@gitlabhost:~# 
root@gitlabhost:~# kubectl describe svc gitlab-webservice-default
Name:              gitlab-webservice-default
Namespace:         default
Labels:            app=webservice
                   app.kubernetes.io/managed-by=Helm
                   chart=webservice-6.6.2
                   gitlab.com/webservice-name=default
                   heritage=Helm
                   release=gitlab
Annotations:       meta.helm.sh/release-name: gitlab
                   meta.helm.sh/release-namespace: default
Selector:          app=webservice,gitlab.com/webservice-name=default,release=gitlab
Type:              ClusterIP
IP Family Policy:  SingleStack
IP Families:       IPv4
IP:                10.100.31.180
IPs:               10.100.31.180
Port:              http-webservice  8080/TCP
TargetPort:        http-webservice/TCP
Endpoints:         <none>
Port:              http-workhorse  8181/TCP
TargetPort:        http-workhorse/TCP
Endpoints:         <none>
Port:              http-metrics-ws  8083/TCP
TargetPort:        http-metrics-ws/TCP
Endpoints:         <none>
Session Affinity:  None
Events:            <none>

5. 트러블슈팅

  • persistent volume이 없어서 파드가 올라오지 않는 문제 확인, EBS와 persistent volume 생성
  • 노드 CPU, Memory 부족해서 파드가 올라오지 않는 문제 확인하여 t3.medim > t3.xlarge로 변경

트러블슈팅 이후로 gitlab-webserivce에 대한 Ingress 리소스를 Route53 레코드로 등록해서 정상 접속되는 것을 확인했다.

profile
DevOps 엔지니어 / 열심히 해서 잘하자

0개의 댓글