bitbucket data center 설치완료하고 간단하게 CI/CD 테스트를 하려고합니다.

bitbucket 개발사에서 나온 Bamboo를 설치해서 이용하겠습니다.

 

준비.도메인주소 등록

설치된 bamboo 를 접근하기 위한 도메인주소를 정하고, 가비아 사이트에가서 등록합니다.

bamb.sytech.store 로 등록하겠습니다.

 

준비. 네임스페이스 생성

bamboo가 설치될 namespace를 마련합니다.

PS C:\Users\ky945\SYk8s> k create namespace syns-bamb
namespace/syns-bamb created

 

준비. 시크릿 생성

bamb.sytech.store 도메인으로 https 접속을 위해 인증서 값을 secret 으로 생성합니다.

*.sytech.store 도메인에 공인인증서가 있는 로컬PC 디렉토리 위치로 이동합니다.

다음 명령어를 실행합니다.

PS C:\Users\ky945\sytech.store.ssl> ls

    Directory: C:\Users\ky945\sytech.store.ssl

Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
-a---        2025-04-04  오후 8:33           2036 sytech.store.crt
-a---        2025-04-04  오후 8:33           2494 sytech.store.key
-a---        2025-04-04  오후 8:33           3866 sytech.store.pem

PS C:\Users\ky945\sytech.store.ssl> k create secret tls sy-bamb-tls `
>> --cert=sytech.store.crt `
>> --key=sytech.store.key `
>> -n syns-bamb
secret/sy-bamb-tls created

 

추가로 secret 하나더 생성합니다.

이후에 bitbucket 과 Bamboo 간에 Application link 생성시 서로에 도메인 인증서가 등록되야합니다.

저는 와일드카드 인증서라서 그대로 사용하겠습니다.

주의! key 파일이 담기지않게 생성해야합니다. 그렇지않으면 pod 기동시 keytool 명령어에서 인증서 에러가 납니다.

PS C:\Users\ky945\sytech.store.ssl> k create secret generic sy-bamb-fullcrt `
--from-file=sytech.store.pem -n syns-bamb
# TLS타입이 아닌 generic 타입으로 생성합니다. key파일까지 들어가면 안됩니다.
# chain인증서까지 있는 pem파일로 생성했습니다. sytech.store.crt 이파일도 될지는 테스트 못해봤습니다.

PS C:\Users\ky945\SYk8s> k get secret -n syns-bamb
NAME                               TYPE                 DATA   AGE
sy-bamb-fullcrt                    Opaque               1      3h43m
sy-bamb-tls                        kubernetes.io/tls    2      6d16h
sypostgre                          Opaque               1      4d6h
# 생성된거를 확인합니다.

 

준비. 영구스토리지 생성

간단하게 설치하고 테스트하기위한 목적이므로 StorageClass는 hostpath를 사용합니다.

bamboo에서는 local-home 과 shared-home 2개의 스토리지가 필요합니다.

로컬PC에 2개 용도로 디렉토리를 생성합니다.

PS C:\Users\ky945\SYbamb> ls

    Directory: C:\Users\ky945\SYbamb

Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
d----        2025-04-13  오후 8:08                local-home    # 로컬용 PV 디렉토리
d----        2025-04-14  오후 9:04                shared-home   # 공유용 PV 디렉토리

 

로컬용 스토리지볼륨을 생성합니다.

PS C:\Users\ky945\SYbamb> cd ../SYk8s

PS C:\Users\ky945\SYk8s> notepad sy-bamb-local-home.yaml

apiVersion: v1
kind: PersistentVolume
metadata:
  name: sy-bamb-local-pv
spec:
  capacity:
    storage: 10Gi
  accessModes:
    - ReadWriteOnce
  storageClassName: hostpath
  persistentVolumeReclaimPolicy: Retain
  hostPath:
    path: "/run/desktop/mnt/host/c/Users/ky945/SYbamb/local-home"
    type: DirectoryOrCreate
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: sy-bamb-local-pvc
spec:
  accessModes:
    - ReadWriteOnce
  storageClassName: hostpath
  resources:
    requests:
      storage: 10Gi
      
PS C:\Users\ky945\SYk8s> k apply -f sy-bamb-local-home.yaml -n syns-bamb
persistentvolume/sy-bamb-local-pv created
persistentvolumeclaim/sy-bamb-local-pvc created
# syns-bamb 네임스페이스에 생성이 완료되었습니다.

 

공유용 스토리지볼륨을 생성합니다.

PS C:\Users\ky945\SYk8s> notepad sy-bamb-shared-home.yaml

apiVersion: v1
kind: PersistentVolume
metadata:
  name: sy-bamb-shared-pv
spec:
  capacity:
    storage: 10Gi
  accessModes:
    - ReadWriteOnce
  storageClassName: hostpath
  persistentVolumeReclaimPolicy: Retain
  hostPath:
    path: "/run/desktop/mnt/host/c/Users/ky945/SYbamb/shared-home"
    type: DirectoryOrCreate
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: sy-bamb-shared-pvc
spec:
  accessModes:
    - ReadWriteOnce
  storageClassName: hostpath
  resources:
    requests:
      storage: 10Gi

PS C:\Users\ky945\SYk8s> k apply -f sy-bamb-shared-home.yaml -n syns-bamb
persistentvolume/sy-bamb-shared-pv created
persistentvolumeclaim/sy-bamb-shared-pvc created
# syns-bamb 네임스페이스에 생성을 성공하였습니다.

 

준비. database 설치

bamboo에서는 별도에 databse를 사용할것을 권고하고 있습니다.

간단하게 설치할수있는 PostgreSQL로 설치하겠습니다.

PS C:\Users\ky945> helm repo add syrepo-bitnami https://charts.bitnami.com/bitnami
PS C:\Users\ky945> helm repo update syrepo-bitnami
PS C:\Users\ky945> helm install sy-postgre syrepo-bitnami/postgresql `
>> --set auth.postgresPassword=2qkrckdqo `
>> --set primary.persistence.enabled=false `
>> --namespace syns-bamb `
>> --set fullnameOverride=sypostgre
NAME: sy-postgre
LAST DEPLOYED: Wed Apr 16 06:18:05 2025
NAMESPACE: syns-bamb
STATUS: deployed
REVISION: 1
TEST SUITE: None
NOTES:
CHART NAME: postgresql
CHART VERSION: 16.6.3
APP VERSION: 17.4.0

Did you know there are enterprise versions of the Bitnami catalog? For enhanced secure software supply chain features, unlimited pulls from Docker, LTS support, or application customization, see Bitnami Premium or Tanzu Application Catalog. See https://www.arrow.com/globalecs/na/vendors/bitnami for more information.

** Please be patient while the chart is being deployed **

PostgreSQL can be accessed via port 5432 on the following DNS names from within your cluster:

    sypostgre.syns-bamb.svc.cluster.local - Read/Write connection

To get the password for "postgres" run:

    export POSTGRES_PASSWORD=$(kubectl get secret --namespace syns-bamb sypostgre -o jsonpath="{.data.postgres-password}" | base64 -d)

To connect to your database run the following command:

    kubectl run sypostgre-client --rm --tty -i --restart='Never' --namespace syns-bamb --image docker.io/bitnami/postgresql:17.4.0-debian-12-r15 --env="PGPASSWORD=$POSTGRES_PASSWORD" \
      --command -- psql --host sypostgre -U postgres -d postgres -p 5432

    > NOTE: If you access the container using bash, make sure that you execute "/opt/bitnami/scripts/postgresql/entrypoint.sh /bin/bash" in order to avoid the error "psql: local user with ID 1001} does not exist"

To connect to your database from outside the cluster execute the following commands:

    kubectl port-forward --namespace syns-bamb svc/sypostgre 5432:5432 &
    PGPASSWORD="$POSTGRES_PASSWORD" psql --host 127.0.0.1 -U postgres -d postgres -p 5432

WARNING: The configured password will be ignored on new installation in case when previous PostgreSQL release was deleted through the helm command. In that case, old PVC will have an old password, and setting it through helm won't take effect. Deleting persistent volumes (PVs) will solve the issue.

WARNING: There are "resources" sections in the chart not set. Using "resourcesPreset" is not recommended for production. For production installations, please set the following values according to your workload needs:
  - primary.resources
  - readReplicas.resources
+info https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/

 

repository 추가

모든준비가 끝났으면 atlassian에 repository를 추가하고, update를 합니다.

PS C:\Users\ky945\SYk8s> helm repo add syrepo-bamboo https://atlassian.github.io/data-center-helm-charts
"syrepo-bamboo" has been added to your repositories

PS C:\Users\ky945\SYk8s> helm repo update syrepo-bamboo
Hang tight while we grab the latest from your chart repositories...
...Successfully got an update from the "syrepo-bamboo" chart repository
Update Complete. ⎈Happy Helming!⎈

 

설정값 적용

설처전에 ingress 와 영구스토리지에 대한 설정을 적용해야합니다.

bamboo에 values을 가져옵니다.

PS C:\Users\ky945\SYk8s> helm show values syrepo-bamboo/bamboo > bamboo-values.yaml

 

yaml파일에 volumes , ingress , bamboo 부분을 설정합니다.

PS C:\Users\ky945\SYk8s> notepad bamboo-values.yaml

volumes:
  localHome:
    persistentVolumeClaim:
      create: false                    # 자동생성되는것을 취소합니다. 기본값.
    customVolume:                      # {} 이부분 삭제하세요
      persistentVolumeClaim:
        claimName: sy-bamb-local-pvc   # 사전에 생성한 로컬용 pvc를 지정합니다.
  sharedHome:
    persistentVolumeClaim:
      create: false                    # 자동생성되는것을 취소합니다. 기본값.
    customVolume:                      # {} 이부분 삭제하세요
      persistentVolumeClaim:
        claimName: sy-bamb-local-pvc   # 사전에 생성한 공유용 pvc를 지정합니다.
        
ingress:
  create: true                     # ingress를 생성합니다.
  className: "nginx"               # ingress contoller는 nginx 사용합니다. 기본값.
  nginx: true                    
  host: bamb.sytech.store          # bamboo 접속 주소
  path: /                         
  tlsSecretName: sy-bamb-tls       # https 통신을 위한 TLS secret을 지정합니다.

bamboo:
  additionalCertificates:
    secretName: sy-bamb-fullcrt    # 추후 bamboo 와 bitbucket 간에 Application link 생성을 위해 필요합니다.

 

설치실행

PS C:\Users\ky945\SYk8s> helm install sy-bamb syrepo-bamboo/bamboo `
>> --namespace syns-bamb `
>> --set fullnameOverride=sybamb `
>> -f bamboo-values.yaml
NAME: sy-bamb
LAST DEPLOYED: Tue Apr 15 06:18:02 2025
NAMESPACE: syns-bamb
STATUS: deployed
REVISION: 1
NOTES:
Thank you for installing Bamboo.

Your release is named sy-bamb, and resides in namespace syns-bamb.

Please run sanity tests against the release to verify it's healthy:

  $ helm test sy-bamb -n syns-bamb

If the Kubernetes resources in the release are still starting up, then the tests may fail, so it
is advisable to wait for the tests to pass before continuing.

To see the custom values you used for this release:

  $ helm get values sy-bamb -n syns-bamb

Bamboo service URL: https://bamb.sytech.store/

For further documentation, see https://atlassian.github.io/data-center-helm-charts/

 

helm으로 설치가 완료되었습니다.

PC 웹브라우저에서  https://bamb.sytech.store 접속합니다.

라이센스 입력을 해야합니다. 하단에 "Generate a Bamboo Data Center license" 클릭합니다.

 

새창이 열리고 다음을 입력 과 선택합니다.

- 조직 : SYcompany 

- 인스턴스는 : '아직 설치되지 않음' 

"라이선스 생성" 클릭합니다.

 

생성된 라이선스 키를 복사합니다.

 

다시 원래 설치페이지로 돌아와서 복사한 라이선스키를 붙여넣습니다.

 

준비과정에서 간단히 설치한 PostgreSQL 을 선택합니다.

 

DB접속정보를 입력합니다.

Database URL : jdbc:postgresql://sypostgre.syns-bamb.svc.cluster.local:5432/postgres   
# PostgreSQL 설치시에 기본생성된 postgres DB를 사용합니다.

User name : postgres  
# PostgreSQL 설치시에 기본생성된 계정을 사용합니다.

Password : **** 
# PostgreSQL 설치시에 설정한 비밀번호를 입력합니다.

 

admin계정을 생성합니다.

 

설치를 성공했습니다.

 

'쿠버네티스 환경' 카테고리의 다른 글

CI/CD 테스트2  (0) 2025.04.17
Bitbucket 설치  (0) 2025.04.09
인그레스 컨트롤러 설치  (0) 2025.04.05
helm 설치  (0) 2025.04.05
공인인증서 만들기  (0) 2025.04.04

+ Recent posts