준비. 저장소 생성

프로그램소스가 저장될 공간을 bitbucket에 생성합니다.

처음이므로 먼저 프로젝트를 생성합니다.

웹UI 로그인 -> 상단 Projects -> Create project 클릭

 

- Poject name : sy-project

- Project key : SYP (대문자로 자동생성됩니다.)

Create project 클릭합니다.

 

repository를 생성합니다. Create repository 클릭

 

- Name : sy-repo

- Default branch name : main

Create repository 클릭합니다.

 

아래 화면이 나오면 성공입니다.

 

준비. 저장소로 push 

테스트로 파일하나 생성하고 저장소로 git push 해봅니다.

PS C:\Users\ky945> cd SYprj
 
PS C:\Users\ky945\SYprj> notepad sytest.txt

this is CI/CD test file


PS C:\Users\ky945\SYprj> ls

    Directory: C:\Users\ky945\SYprj

Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
-a---        2025-04-20  오후 5:00             23 sytest.txt

PS C:\Users\ky945\SYprj> git init
Initialized empty Git repository in C:/Users/ky945/SYprj/.git/

PS C:\Users\ky945\SYprj> git add --all

PS C:\Users\ky945\SYprj> git commit -m "Initial Commit SY"
[master (root-commit) 7e99962] Initial Commit SY
 1 file changed, 1 insertion(+)
 create mode 100644 sytest.txt

PS C:\Users\ky945\SYprj> git remote add origin https://bitb.sytech.store/scm/syp/sy-repo.git

PS C:\Users\ky945\SYprj> git push -u origin HEAD:main
warning: ----------------- SECURITY WARNING ----------------
warning: | TLS certificate verification has been disabled! |
warning: ---------------------------------------------------
warning: HTTPS connections may not be secure. See https://aka.ms/gcm/tlsverify for more information.
git: 'credential-manager-core' is not a git command. See 'git --help'.
Enumerating objects: 3, done.
Counting objects: 100% (3/3), done.
Writing objects: 100% (3/3), 240 bytes | 240.00 KiB/s, done.
Total 3 (delta 0), reused 0 (delta 0), pack-reused 0 (from 0)
To https://bitb.sytech.store/scm/syp/sy-repo.git
 * [new branch]      HEAD -> main
branch 'master' set up to track 'origin/main'.

 

참고. 진행중에 아래 팝업창이 나오면 "Password/Token" 선택하고 username 과 password 입력합니다.

 

준비. 서버생성

빌드는 Bamboo 로컬에서 가능하고, 원격서버에도 가능합니다. 여기서는 로컬에서 빌드하는걸로 하겠습니다.

배포는 원격서버에 합니다. 도커 컨테이너로 배포 대상서버(ubuntu)를 설치합니다. 

PS C:\Users\ky945\SYubuntu> notepad Dockerfile

# Dockerfile
FROM ubuntu:latest

# 원격에서 ssh 접속할 수 있게 ssh서버를 설치합니다.
RUN apt-get update && \
    apt-get install -y openssh-server && \
    mkdir /var/run/sshd

# root 비밀번호 설정 (예: root:root)
RUN echo 'root:root' | chpasswd

# SSH 접속 시 필요한 설정
RUN sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config && \
    sed -i 's/UsePAM yes/UsePAM no/' /etc/ssh/sshd_config

EXPOSE 22
CMD ["/usr/sbin/sshd", "-D"]

PS C:\Users\ky945\SYubuntu> docker build -t syubuntu .
# 도커 이미지를 빌드합니다.

PS C:\Users\ky945\SYubuntu> docker run -d -p 22:22 --name sy-ubuntu syubuntu
ea42aedd7c456efe56702fdc68ac662e84fb156951b29ed13527ff6671395b3e
# 컨테이너로 기동합니다.

PS C:\Users\ky945\SYubuntu> ssh root@localhost
The authenticity of host 'localhost (::1)' can't be established.
ED25519 key fingerprint is SHA256:7tPmV3s741qVSZvEfDmpqKV/FiCeYL7gmZI1pWqyJno.
This key is not known by any other names.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added 'localhost' (ED25519) to the list of known hosts.
root@localhost's password:
root@ea42aedd7c45:~#
# 컨테이너로 ssh접속이 정상입니다.

 

준비를 끝내고 plan 생성을 시작합니다.

 

- Project name : sy-bam-project

- Project key : SYB (자동입력됨)

- Project description : sy bamboo project

- Plan name : sy-bam-plan

- Plan key : SYB (자동입력됨)

- Plan description : sy bamboo plan

Create 클릭!

 

- Repository host : Link new repository -> Bitbucket DC/Server 선택

"Link Bamboo to Bitbucket Server" 클릭!

 

Create link 클릭!

 

- Application URL : https://bitb.sytech.store (bitbucket 설치한 URL주소입력)

continue 클릭!

 

주의! 그전에 bitbucket에 로그인해 있어야합니다. 그렇지않으면 Link 생성이 안됩니다. 버그인듯...

bitbucket가 서로 통신이 가능한것을 확인합니다. continue 클릭!

 

bitbucket 사이트로 redirect 되고, bamboo 와 연결이 정상인것을 확인합니다. continue 클릭!

 

bamboo 주소로 redirect 됩니다. Status가 "CONNECTED" 보이면 성공입니다.

 

설치진행 페이지로 다 돌아옵니다.

- Display name : sy-bam-display (적당한 이름 입력)

"Login & approve" 클릭 !

 

Bamboo에서 접근하는걸 허락합니다. Allow 클릭!

 

주의! bitbucket에서 ssh 서비스를 외부로 노출해야합니다. bamboo가 빌드에 필요한 소스저장소를 ssh로 접근합니다. 다음처럼 설정하고 적용합니다.

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

bitbucket:
  sshService:
    enabled: true    # false 를 true로 변경합니다.
    port: 7999       # 기본포트 7999로 입력합니다.
    
PS C:\Users\ky945\SYk8s> helm upgrade --install sy-bitb syrepo-bitbucket/bitbucket `
--namespace syns-bitb `
--set fullnameOverride=sybitb `
-f bitbucket-values.yaml
# bitbucket-values.yaml 내용을 변경하고, 적용합니다.

PS C:\Users\ky945\SYk8s> k get svc -n syns-bitb
NAME          TYPE           CLUSTER-IP      EXTERNAL-IP   PORT(S)                    AGE
sybitb        ClusterIP      10.99.51.156    <none>        80/TCP,7999/TCP,5701/TCP   2d19h
sybitb-ssh    LoadBalancer   10.102.95.203   localhost     7999:32542/TCP             2d
# sybitb-ssh 서비스가 생성되었고, 7999 포트로 외부노출이 된것이 확인됩니다.

 

계속진행합니다.

- Repository : sy-project / sy-repo 선택

- Branch : main 선택

"Save and continue" 클릭!

 

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

Bamboo 설치  (0) 2025.04.13
Bitbucket 설치  (0) 2025.04.09
인그레스 컨트롤러 설치  (0) 2025.04.05
helm 설치  (0) 2025.04.05
공인인증서 만들기  (0) 2025.04.04

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

gitlab 같은 프로그램소스 저장소 기능이 있는 S/W 입니다.

 

준비.도메인주소 등록

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

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

 

준비. 네임스페이스 생성

bitbucket이 설치될 namespace를 마련합니다.

PS C:\Users\ky945\sytech.store.ssl> k create namespace syns-bitb
namespace/syns-bitb created

PS C:\Users\ky945\sytech.store.ssl> k get namespace -A
NAME              STATUS   AGE
default           Active   33h
kube-node-lease   Active   33h
kube-public       Active   33h
kube-system       Active   33h
syns-bitb         Active   2s   # <---- 생성되었습니다.
syns-ingress      Active   32h
syns-nginx        Active   32h

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

 

준비. 시크릿 생성

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

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

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

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

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
# crt 와 key 파일이 있어야 합니다.

PS C:\Users\ky945\sytech.store.ssl> k create secret tls sy-bitb-tls `
--cert=sytech.store.crt `
--key=sytech.store.key `
-n syns-bitb
secret/sy-bitb-tls created   # 생성이 성공하였습니다.

PS C:\Users\ky945\sytech.store.ssl> k get secret -n syns-bitb
NAME          TYPE                DATA   AGE
sy-bitb-tls   kubernetes.io/tls   2      7m11s

# syns-bitb 네임스페이스에 secret이 생성되었습니다.

 

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

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

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

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

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

PS C:\Users\ky945\sytech.store.ssl> k get secret -n syns-bitb
NAME                            TYPE                 DATA   AGE
sy-bitb-fullcrt                 Opaque               1      11s
sy-bitb-tls                     kubernetes.io/tls    2      10d
# 생성된거를 확인합니다.

 

준비. 영구스토리지 생성

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

PV 와 PVC 생성 yaml 파일을 만듭니다.

PS C:\Users\ky945> cd SYk8s
PS C:\Users\ky945\SYk8s> notepad sy-bitb-pv-pvc.yaml

apiVersion: v1
kind: PersistentVolume
metadata:
  name: sy-bitb-pv
spec:
  capacity:
    storage: 10Gi
  accessModes:
    - ReadWriteOnce
  storageClassName: hostpath
  persistentVolumeReclaimPolicy: Retain
  hostPath:
    path: "/run/desktop/mnt/host/c/Users/ky945/SYbitb/data"
# 로컬PC에 C:\Users\ky945\SYbitb\data 를 미리생성해야 합니다.
# /run/desktop/mnt/host/ 뒤에 로컬PC 경로를 붙이는 방법으로 path를 입력합니다.
    type: DirectoryOrCreate
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: sy-bitb-pvc
spec:
  accessModes:
    - ReadWriteOnce
  storageClassName: hostpath
  resources:
    requests:
      storage: 10Gi
      
PS C:\Users\ky945\SYk8s> k apply -f sy-bitb-pv-pvc.yaml -n syns-bitb
persistentvolume/sy-bitb-pv created
persistentvolumeclaim/sy-bitb-pvc created
# pvc는 syns-bitb 네임스페이스에 생성이 됩니다.

 

repository 추가

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

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

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

 

설정값 적용

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

bitbucket에 values을 가져옵니다.

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

PS C:\Users\ky945\SYk8s> ls

    Directory: C:\Users\ky945\SYk8s

Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
-a---        2025-04-12  오전 6:07            525 sy-bitb-pv-pvc.yaml
-a---        2025-04-12  오전 6:27          57792 bitbucket-values.yaml

 

bitbucket-values.yaml 파일을 열어서 다음값을 설정합니다.

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

# 211라인 volumes 내용이 있습니다.
# 값들을 찾아서 변경합니다.
volumes:
  localHome:
    persistentVolumeClaim:
      create: false              # 자동생성되는것을 취소합니다. 기본값.
    customVolume:                # {} 이부분 삭제하세요
      persistentVolumeClaim:
        claimName: sy-bitb-pvc   # 사전에 생성한 pvc를 지정합니다.
  
# 434라인부터 ingress 내용이 있습니다.
# 값들을 찾아서 변경합니다.
ingress:
  create: true                   # ingress를 생성합니다.
  className: "nginx"             # ingress contoller는 nginx 사용합니다. 기본값.
  nginx: true                    
  host: bitb.sytech.store        # bitbucket 접속 주소
  path: /                         
  tlsSecretName: sy-bitb-tls     # https 통신을 위한 TLS secret을 지정합니다.
  
# 1267라인에 secretName 내용이 있습니다.
bitbucket:
  additionalCertificates:        # 1158라인에 있는거와 혼동하시면 안됩니다.
    secretName: sy-bitb-fullcrt  # 추후 bamboo 와 bitbucket 간에 Application link 생성을 위해 필요합니다.

주의! secretName 값이 2곳에 있습니다. bitbucket -> mesh -> additionalCertificates -> secretName: 여기 아닙니다.

 

설치실행

PS C:\Users\ky945\SYk8s> helm install sy-bitb syrepo-bitbucket/bitbucket `
>> --namespace syns-bitb `            # bitbucket 네임스페이스에 설치합니다.
>> --set fullnameOverride=sybitb `    # 이름이 길게 나오지않게 지정합니다.
>> -f bitbucket-values.yaml           # 설정한 값으로 적용합니다.
NAME: sy-bitb
LAST DEPLOYED: Sat Apr 12 08:01:19 2025
NAMESPACE: syns-bitb
STATUS: deployed
REVISION: 1
NOTES:
Thank you for installing Bitbucket.

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

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

  $ helm test sy-bitb -n syns-bitb

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-bitb -n syns-bitb

Bitbucket service URL: https://bitb.sytech.store/



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

# 위 내용으로 나오면 설치는 성공입니다.

 

접속확인

https://bitb.sytech.store 접속합니다. 아래 내용으로 보이면 성공입니다.

Language는 English, Database는 internal로 선택하고 Next를 클릭합니다.

운영환경에서는 별도에 Databse를 사용하라고 합니다.

 

Licensing and settings

- Application title : SYBitbucket 입력

- License key : I need an evaluation license 선택

Generate license

- I have an account  선택 (계정이 없는분은 Create an account 선택합니다.)

 

로그인하면 다음 페이지가 보여집니다.

- 조직 : SYcompany 입력합니다.

- 인스턴스는 "아직 설치되지 않음" 선택합니다.

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

 

확인 클릭

 

다시 원래화면으로 돌아왔습니다.

License key 값이 자동으로 들어가 있습니다. Next 클릭.

 

오류메시지가 나옵니다. 

무시하시고 "Retry Operation" 클릭합니다.

관리자 정보를 입력합니다.

"Go to Bitbucket"을 클릭합니다.

 

앞에서 입력한 Username 과 Password 입력후 "Log in" 클릭합니다.

 

아래 화면이 나오면 설치는 성공입니다.

 

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

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

쿠버네티스에 설치된 프로그램의 서비스를 외부로 노출시킬때 필요한 s/w 입니다.

인프라에 L7스위치 장비같은 역할을 한다고 보면 됩니다.

 

저장소 등록

PS C:\Users\ky945> helm repo add syrepo-ingress-nginx https://kubernetes.github.io/ingress-nginx
"syrepo-ingress-nginx" has been added to your repositories

# syrepo-ingress-nginx 이름으로 저장소를 등록합니다

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

# chart 정보를 최신화 합니다.

 

설치

PS C:\Users\ky945> helm install sy-ingress  syrepo-ingress-nginx/ingress-nginx `
>> --set controller.publishService.enabled=true `
>> --namespace syns-ingress `
>> --create-namespace `
>> --set fullnameOverride=syingress

# sy-ingress : 대문자는 불가합니다. 소문자로 정의합니다.
# syingress : helm이 생성하는 자원이름이 길어서 이름을 짧게 지정합니다.

NAME: sy-ingress
LAST DEPLOYED: Tue Apr  8 20:59:27 2025
NAMESPACE: syns-ingress
STATUS: deployed
REVISION: 1
TEST SUITE: None
NOTES:
The ingress-nginx controller has been installed.
It may take a few minutes for the load balancer IP to be available.
You can watch the status by running 'kubectl get service --namespace syns-ingress syingress-controller --output wide --watch'

An example Ingress that makes use of the controller:
  apiVersion: networking.k8s.io/v1
  kind: Ingress
  metadata:
    name: example
    namespace: foo
  spec:
    ingressClassName: nginx
    rules:
      - host: www.example.com
        http:
          paths:
            - pathType: Prefix
              backend:
                service:
                  name: exampleService
                  port:
                    number: 80
              path: /
    # This section is only required if TLS is to be enabled for the Ingress
    tls:
      - hosts:
        - www.example.com
        secretName: example-tls

If TLS is enabled for the Ingress, a Secret containing the certificate and key must also be provided:

  apiVersion: v1
  kind: Secret
  metadata:
    name: example-tls
    namespace: foo
  data:
    tls.crt: <base64 encoded cert>
    tls.key: <base64 encoded key>
  type: kubernetes.io/tls

 

설치확인

PS C:\Users\ky945> k get all -n syns-ingress
NAME                                        READY   STATUS    RESTARTS   AGE
pod/syingress-controller-7bc7974579-bn7cd   1/1     Running   0          5m32s

NAME                                     TYPE           CLUSTER-IP     EXTERNAL-IP   PORT(S)                      AGE
service/syingress-controller             LoadBalancer   10.96.57.3     localhost     80:31349/TCP,443:31682/TCP   5m32s
service/syingress-controller-admission   ClusterIP      10.106.91.44   <none>        443/TCP                      5m32s

NAME                                   READY   UP-TO-DATE   AVAILABLE   AGE
deployment.apps/syingress-controller   1/1     1            1           5m32s

NAME                                              DESIRED   CURRENT   READY   AGE
replicaset.apps/syingress-controller-7bc7974579   1         1         1       5m32s

# syns-ingress 네임스페이스에 생성된 자원을 확인합니다.
# 80:31349/TCP,443:31682/TCP : 현재 외부에서 80,443으로 접근할수있고, 그에대한 nodeport는 31349, 31682 입니다.

테스트로 nginx web을 설치하고 외부에서 접근이 잘되는지 확인하겠습니다.

PS C:\Users\ky945> helm repo add syrepo-bitnami https://charts.bitnami.com/bitnami
"syrepo-bitnami" has been added to your repositories

# bitnami 저장소를 추가합니다

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

# 저장소 목록 내용을 최신화 합니다.

 

nginx web 을 설치합니다.

PS C:\Users\ky945> helm install sy-nginx syrepo-bitnami/nginx `
>> --set service.type=ClusterIP `
>> --set ingress.enabled=true `
>> --set ingress.hostname=www.sytech.store `
>> --set ingress.ingressClassName=nginx `
>> --namespace syns-nginx --create-namespace

# www.sytech.store : 가비아에서 생성한 도메인주소입니다. 도메인에 IP주소는 로컬PC에 IP 입니다.
# 외부에서 접속될 수 있도록 ingress도 함께 생성이 됩니다.

NAME: sy-nginx
LAST DEPLOYED: Sun Apr  6 09:39:34 2025
NAMESPACE: syns-nginx
STATUS: deployed
REVISION: 1
TEST SUITE: None
NOTES:
CHART NAME: nginx
CHART VERSION: 19.0.4
APP VERSION: 1.27.4

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 **
NGINX can be accessed through the following DNS name from within your cluster:

    sy-nginx.syns-nginx.svc.cluster.local (port 80)

To access NGINX from outside the cluster, follow the steps below:

1. Get the NGINX URL and associate its hostname to your cluster external IP:

   export CLUSTER_IP=$(minikube ip) # On Minikube. Use: `kubectl cluster-info` on others K8s clusters
   echo "NGINX URL: http://www.sytech.store"
   echo "$CLUSTER_IP  www.sytech.store" | sudo tee -a /etc/hosts

# 저는 가비아에서 도메인주소를 생성했고, IP도 등록했습니다. 1번은 안해도 됩니다.
# 로컬PC hosts 파일에 www.sytech.store 도메인에 IP 값이 없으면, 외부 DNS서버에서 IP주소를 찾게됩니다.

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:
  - cloneStaticSiteFromGit.gitSync.resources
  - resources
+info https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/

 

설치확인

PS C:\Users\ky945> k get all -n syns-nginx
NAME                            READY   STATUS    RESTARTS   AGE
pod/sy-nginx-5b9d5dc569-lhfcf   1/1     Running   0          12m

NAME               TYPE        CLUSTER-IP      EXTERNAL-IP   PORT(S)          AGE
service/sy-nginx   ClusterIP   10.101.82.163   <none>        80/TCP,443/TCP   12m

NAME                       READY   UP-TO-DATE   AVAILABLE   AGE
deployment.apps/sy-nginx   1/1     1            1           12m

NAME                                  DESIRED   CURRENT   READY   AGE
replicaset.apps/sy-nginx-5b9d5dc569   1         1         1       12m

# syns-nginx 네임스페이스에 생성된 pod, service, deploy, replica 확인합니다.

 

또한, 생성된 ingress 정보를 확인합니다.

PS C:\Users\ky945> k describe ingress -n syns-nginx
Name:             sy-nginx
Labels:           app.kubernetes.io/instance=sy-nginx
                  app.kubernetes.io/managed-by=Helm
                  app.kubernetes.io/name=nginx
                  app.kubernetes.io/version=1.27.4
                  helm.sh/chart=nginx-19.0.4
Namespace:        syns-nginx
Address:          localhost
Ingress Class:    nginx        # 접속 트래픽을 처리하는 Ingress Controller를 지정합니다.
Default backend:  <default>
Rules:
  Host              Path  Backends
  ----              ----  --------
  www.sytech.store
                    /   sy-nginx:http (10.1.0.42:8080)   # sy-nginx 파드 8080포트로 트래픽을 전달합니다.
Annotations:        meta.helm.sh/release-name: sy-nginx
                    meta.helm.sh/release-namespace: syns-nginx
Events:
  Type    Reason  Age                From                      Message
  ----    ------  ----               ----                      -------
  Normal  Sync    17m (x2 over 18m)  nginx-ingress-controller  Scheduled for sync
  
# Ingress 단순히 정책일 뿐입니다.처리는 Ignress Controller가 합니다.
# 외부에서 http 80포트로 접근하면 sy-nginx 파드 8080포트로 전달합니다.

 

외부에서 http://www.sytech.store 접속하여 아래처럼 초기화면이 보이면 성공입니다.

 

 

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

CI/CD 테스트2  (0) 2025.04.17
Bamboo 설치  (0) 2025.04.13
Bitbucket 설치  (0) 2025.04.09
helm 설치  (0) 2025.04.05
공인인증서 만들기  (0) 2025.04.04

kubernetes용 패키지 관리자 라고 생각하면 됩니다.

저는 윈도우11 docker desktop 에서 쿠버네티스를 활성화해서 사용하므로 윈도우11에 helm을 설치합니다.

Chocolatey 설치

윈도우용 패키지 관리자입니다. 

Chocolatey를 이용해서 helm을 설치합니다.

Powershell 을 관리자 권한으로 실행하고 다음을 실행합니다.

PS C:\Users\ky945> Set-ExecutionPolicy Bypass -Scope Process -Force; `
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; `
iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))

 

Powershell을 닫고, 다시 관리자 권한으로 실행합니다.

PS C:\Users\ky945> choco --version
2.4.3  

# 버전나오면 설치성공

 

Helm 설치

PS C:\Users\ky945> choco install kubernetes-helm

...
< 중간 생략 >
...

PS C:\Users\ky945> helm version
version.BuildInfo{Version:"v3.17.1", GitCommit:"980d8ac1939e39138101364400756af2bdee1da5", GitTreeState:"clean", GoVersion:"go1.23.5"}

# 버전정보 나오면 설치성공

 

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

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

Let’s Encrypt 에서 무료로 공인인증서를 만들어줍니다.

 

도메인생성

도메인이 있어야 공인인증서를 만들수 있습니다.

가비아에서 저렴한 도메인을 구매할수있습니다.

아래 가비아 사이트에 접속합니다.

https://www.gabia.com/

 

웹을 넘어 클라우드로. 가비아

그룹웨어부터 멀티클라우드까지 하나의 클라우드 허브

www.gabia.com

 

회원가입을 하고 로그인합니다.

상단 도메인 -> 도메인검색 으로 들어가서 원하는 도메인을 검색하고 선택하여 결제합니다.

저는 저렴한 sytech.store 를 구매하였습니다.

 

DNS 레코드추가

My가비아 -> DNS관리툴 -> sytech.store 설정 클릭 -> 레코드 수정 -> 다음 값을 입력합니다.

 

- 타입 : A

- 호스트 : www

- 값/위치 : 192.168.0.7   <---- 제 PC 로컬 IP주소입니다.

 

모두 입력하고 확인 ->  저장을 클릭합니다.

다음처럼 나오면 성공입니다.

 

ACME 설치

아래 사이트 접속해서 설치파일 다운로드합니다.

https://www.win-acme.com/

 

win-acme

win-acme This is a ACMEv2 client for Windows that aims to be very simple to start with, but powerful enough to grow into almost every scenario. A very simple interface to create and install certificates on a local IIS server A more advanced interface for m

www.win-acme.com

 

wacs.exe 실행합니다.

M: Create certificate (full options) 선택
2: Manual input 선택
Host : ---> *.sytech.store 입력합니다.
Friendly name '[Manual] *.sytech.store'. <Enter> to accept or type desired name: 엔터입력
4: Single certificate 선택
6: [dns] Create verification records manually (auto-renew not possible) 선택
2: RSA key 선택
2: PEM encoded files (Apache, nginx, etc.) 선택
File path: C:\Users\ky945\sytech.store.ssl ---> 인증서파일 저장위치 입력합니다.
1: None 선택
5: No (additional) store steps 선택
3: No (additional) installation steps 선택
Open in default application? (y/n*) n 선택
Do you agree with the terms? (y*/n)  y 선택
Enter email(s) for notifications about problems and abuse (comma-separated): --> 개인이메일입력

 

다음 3개의 값이 출력됩니다.

이 값들을 My가비아 -> DNS관리툴 -> sytech.store 설정 클릭 -> 레코드 수정  에 입력합니다.

Record: _acme-challenge.sytech.store   <---- _acme-challenge 이것만 사용하세요
Type: TXT
Content: "oRgY0rKDz8hK9903Xhd9NvDBtoDqgUBfydvlMcCn4Lg"  <--- " 기호 빼고 사용하세요

 

wacs으로 돌아와서 Enter 합니다.

가비아사이트로 다시 돌아가서 3개의 값을 입력한 레코드를 삭제하라고합니다. 바로 삭제합니다.

wacs으로 돌아와서 Enter 합니다.

Do you want to specify the user the task will run as? (y/n*) n 선택
Q: Quit 선택

 

C:\Users\ky945\sytech.store.ssl 위치에 인증서 파일이 보이면 성공입니다.

 

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

CI/CD 테스트2  (0) 2025.04.17
Bamboo 설치  (0) 2025.04.13
Bitbucket 설치  (0) 2025.04.09
인그레스 컨트롤러 설치  (0) 2025.04.05
helm 설치  (0) 2025.04.05

+ Recent posts