관리 메뉴

피터의 개발이야기

[kubernetes] Helm을 이용한 Redmine 설치 본문

DevOps/Redmine

[kubernetes] Helm을 이용한 Redmine 설치

기록하는 백앤드개발자 2022. 9. 13. 00:04
반응형

ㅁ 개요

 ㅇ kubernetes 환경으로 Redmine을 구성하는 과정을 정리하였다.

 ㅇ 중간에  예행연습으로 생성한 redmine의 볼륨의 영향으로 트러블이 발생하여 PV를 삭제한 후 재설치하여 정상 설치가 되었다.

 

 

ㅁ Helm Remote Repository 연결

 helm은 잘 구축된 템플릿을 원격 리파지토리를 이용하여 손쉽게 가져올 수 있다는 강점이 있다. 쿠버네티스 생태계에서 잘 짜여진 템플릿을 사용하여 원하는 환경을 빠르게 구축할 수 있다. 우선적으로 원격 저장소를 연결해야 한다.

# 원격 저장소 리스트 확인
$ helm repo list
Error: no repositories to show 

# 원격 저장소 추가
helm repo add stable https://charts.helm.sh/stable
"stable" has been added to your repositories

 

 ㅇ 원격 저장소를 확인한 결과 아직 아무런 원격 저장소를 확인 되지 않았다.
 ㅇ https://charts.helm.sh/stable 저장소를 추가하였다.

 

 

ㅁ Helm Redmine 정보확인

# 원격 저장소에서 redmine 정보 확인
$ helm search repo redmine
NAME          	CHART VERSION	APP VERSION	DESCRIPTION
stable/redmine	14.1.12      	4.1.0      	DEPRECATED A flexible project management web ap...

 ㅇ 설치할 redmine의 정보를 확인하였다. 

 ㅇ APP VERSION이 4.1.0 최신 버전은 아니었다.

 ㅇ Description에서 Deprecated라는 설명이 되어 있어서 다른 버젼을 찾아야 했다.

 

 

 

ㅁ bitnami 원격저장소 추가  및 정보조회

# bitnami 원격저장소 추가
$ helm repo add bitnami https://charts.bitnami.com/bitnami
"bitnami" has been added to your repositories

# 원격 저장소 목록조회
$ helm repo list
NAME   	URL
stable 	https://charts.helm.sh/stable
bitnami	https://charts.bitnami.com/bitnami

# 원격 저장소 redmine 정보조회
$ helm search repo redmine
NAME           	CHART VERSION	APP VERSION	DESCRIPTION
bitnami/redmine	20.3.3       	5.0.2      	Redmine is an open source management applicatio...
stable/redmine 	14.1.12      	4.1.0      	DEPRECATED A flexible project management web ap...

 ㅇ bitnami라는 helm 원격저장소를 추가하였다.

 ㅇ 추가된 원격저장소를 통해 bitnami/redmine chart 정보를 확인 할 수 있었다.

 

 

ㅁ bitnami/redmine Value 확인 및  수정

# values 로컬로 다운로드 받기
$ helm inspect values bitnami/redmine > redmine.values

###########################
## 비밀번호 지정 및 한국어 설정
###########################
## @param redmineUsername Redmine username
##
redmineUsername: user
## @param redminePassword Redmine user password
## Defaults to a random 10-character alphanumeric string if not set
##
redminePassword: password**

## @param redmineLanguage Redmine default data language
##
redmineLanguage: ko

##############################
## 서비스 포트 80 -> 8010으로 수정
##############################
service:
  ## @param service.type Redmine service type
  ##
  type: LoadBalancer
  ## @param service.ports.http Redmine service HTTP port
  ##
  ports:
    http: 8010
    

###################################
## PostgreSQL 비활성화
###################################
## PostgreSQL chart configuration
## ref: https://github.com/bitnami/charts/blob/master/bitnami/postgresql/values.yaml
## @param postgresql.enabled Switch to enable or disable the PostgreSQL helm chart
## @param postgresql.auth.username Name for a custom user to create
## @param postgresql.auth.password Password for the custom user to create
## @param postgresql.auth.database Name for a custom database to create
## @param postgresql.auth.existingSecret Name of existing secret to use for PostgreSQL credentials
## @param postgresql.architecture PostgreSQL architecture (`standalone` or `replication`)
##
postgresql:
  enabled: false

 

 

ㅁ bitnami/redmine 설치

# redmine 설치
$ helm install peterica bitnami/redmine --values redmine.values
NAME: peterica
LAST DEPLOYED: Mon Sep 12 23:26:54 2022
NAMESPACE: default
STATUS: deployed
REVISION: 1
TEST SUITE: None
NOTES:
CHART NAME: redmine
CHART VERSION: 20.3.3
APP VERSION: 5.0.2

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

1. Get the Redmine URL:

  NOTE: It may take a few minutes for the LoadBalancer IP to be available.
        Watch the status with: 'kubectl get svc --namespace default -w peterica-redmine'
  export SERVICE_IP=$(kubectl get svc --namespace default peterica-redmine --template "{{ range (index .status.loadBalancer.ingress 0) }}{{ . }}{{ end }}")

  echo "Redmine URL: http://$SERVICE_IP:8010/"

2. Login with the following credentials

  export REDMINE_USERNAME=user
  export REDMINE_PASSWORD=$(kubectl get secret --namespace "default" peterica-redmine -o jsonpath="{.data.redmine-password}" | base64 -d)

  echo Username: $REDMINE_USERNAME
  echo Password: $REDMINE_PASSWORD

  You can access the DB using the following password:
  export MARIADB_PASSWORD=$(kubectl get secret --namespace "default" peterica-mariadb -o jsonpath="{.data.mariadb-password}" | base64 -d)

 

 

ㅁ 트래블 슈팅

# pod 상세정보 확인
$ kubectl describe pods peterica-mariadb-0

Events:
  Type     Reason     Age                   From               Message
  ----     ------     ----                  ----               -------
  Normal   Scheduled  2m23s                 default-scheduler  Successfully assigned default/peterica-mariadb-0 to docker-desktop
  Normal   Pulled     37s (x5 over 2m23s)   kubelet            Container image "docker.io/bitnami/mariadb:10.6.9-debian-11-r0" already present on machine
  Normal   Created    37s (x5 over 2m23s)   kubelet            Created container mariadb
  Normal   Started    37s (x5 over 2m23s)   kubelet            Started container mariadb
  Warning  BackOff    33s (x10 over 2m14s)  kubelet            Back-off restarting failed container

 ㅇ pod 상세 정보 확인을 하였다.

 ㅇ 이벤트 내용으로는 원인파악이 어려워 log를 확인하였다.

 

# pod 로그확인
$ kubectl logs  peterica-mariadb-0
mariadb 14:30:17.57
mariadb 14:30:17.59 Welcome to the Bitnami mariadb container
mariadb 14:30:17.61 Subscribe to project updates by watching https://github.com/bitnami/containers
mariadb 14:30:17.63 Submit issues and feature requests at https://github.com/bitnami/containers/issues
mariadb 14:30:17.65
mariadb 14:30:17.67 INFO  ==> ** Starting MariaDB setup **
mariadb 14:30:17.81 INFO  ==> Validating settings in MYSQL_*/MARIADB_* env vars
mariadb 14:30:17.85 INFO  ==> Initializing mariadb database
mariadb 14:30:18.01 WARN  ==> The mariadb configuration file '/opt/bitnami/mariadb/conf/my.cnf' is not writable. Configurations based on environment variables will not be applied for this file.
mariadb 14:30:18.02 INFO  ==> Using persisted data
mariadb 14:30:18.18 INFO  ==> Running mysql_upgrade
mariadb 14:30:18.22 INFO  ==> Starting mariadb in background
2022-09-12 14:30:18 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2022-09-12 14:30:18 0 [Note] InnoDB: Number of pools: 1
2022-09-12 14:30:18 0 [Note] InnoDB: Using crc32 + pclmulqdq instructions
2022-09-12 14:30:18 0 [Note] mysqld: O_TMPFILE is not supported on /opt/bitnami/mariadb/tmp (disabling future attempts)
2022-09-12 14:30:18 0 [Warning] InnoDB: Linux Native AIO disabled.
2022-09-12 14:30:18 0 [Note] InnoDB: Initializing buffer pool, total size = 134217728, chunk size = 134217728
2022-09-12 14:30:18 0 [Note] InnoDB: Completed initialization of buffer pool
2022-09-12 14:30:18 0 [Note] InnoDB: 128 rollback segments are active.
2022-09-12 14:30:18 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2022-09-12 14:30:18 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2022-09-12 14:30:18 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
2022-09-12 14:30:18 0 [Note] InnoDB: 10.6.9 started; log sequence number 1564767; transaction id 3213
2022-09-12 14:30:18 0 [Note] InnoDB: Loading buffer pool(s) from /bitnami/mariadb/data/ib_buffer_pool
2022-09-12 14:30:18 0 [Note] Plugin 'FEEDBACK' is disabled.
2022-09-12 14:30:18 0 [Note] Server socket created on IP: '127.0.0.1'.
2022-09-12 14:30:18 0 [Warning] 'proxies_priv' entry '@% root@peterica-mariadb-0' ignored in --skip-name-resolve mode.
2022-09-12 14:30:18 0 [Note] InnoDB: Buffer pool(s) load completed at 220912 14:30:18
2022-09-12 14:30:18 0 [Note] /opt/bitnami/mariadb/sbin/mysqld: ready for connections.
Version: '10.6.9-MariaDB'  socket: '/opt/bitnami/mariadb/tmp/mysql.sock'  port: 3306  Source distribution
2022-09-12 14:30:20 3 [Warning] Access denied for user 'root'@'localhost' (using password: YES)
mariadb 14:30:20.44 INFO  ==> Stopping mariadb
2022-09-12 14:30:20 0 [Note] /opt/bitnami/mariadb/sbin/mysqld (initiated by: unknown): Normal shutdown
2022-09-12 14:30:20 0 [Note] InnoDB: FTS optimize thread exiting.
2022-09-12 14:30:20 0 [Note] InnoDB: Starting shutdown...
2022-09-12 14:30:20 0 [Note] InnoDB: Dumping buffer pool(s) to /bitnami/mariadb/data/ib_buffer_pool
2022-09-12 14:30:20 0 [Note] InnoDB: Buffer pool(s) dump completed at 220912 14:30:20
2022-09-12 14:30:20 0 [Note] InnoDB: Removed temporary tablespace data file: "./ibtmp1"
2022-09-12 14:30:20 0 [Note] InnoDB: Shutdown completed; log sequence number 1564779; transaction id 3214
2022-09-12 14:30:20 0 [Note] /opt/bitnami/mariadb/sbin/mysqld: Shutdown complete

 ㅇ  WARN  ==> The mariadb configuration file '/opt/bitnami/mariadb/conf/my.cnf' is not writable. Configurations based on environment variables will not be applied for this file.

 ㅇ 해당 에러를 통해 볼륨에 문제점이 있다고 판단이 되었다.

 ㅇ 참고로 글을 쓰기 이전에 value 변경 없이 기본 install 하였을 때에는 잘 진행 되었다. 이후 삭제하고 다시 설치하는 과정에서 볼륨에 데이터가 일부 남아있어서 문제가 발생한 것 같다.

 ㅇ  persistentvolumes를 확인하고 삭제를 진행하였다.

 

 

ㅁ Delete PersistentVolumes(PV) 

# persistentvolumes 조회
$ kubectl get persistentvolumes
NAME                                       CAPACITY   ACCESS MODES   RECLAIM POLICY   STATUS        CLAIM                                  STORAGECLASS   REASON   AGE
pvc-025983a3-27c6-4340-a7db-5a6f4c909408   8Gi        RWO            Delete           Bound         default/data-my-release-postgresql-0   hostpath                4h33m
pvc-12fd051b-aa78-416b-8a57-3f5a78e77431   8Gi        RWO            Delete           Bound         default/data-peterica-mariadb-0        hostpath                4h11m
pvc-3139c0cf-44b5-491c-b1d3-91f89cdfecd6   8Gi        RWO            Delete           Bound         default/data-peterica-postgresql-0     hostpath                4h11m
pvc-33428b75-93aa-492d-ae23-dc7e51019ab8   8Gi        RWO            Delete           Bound         default/data-jiyae-postgresql-0        hostpath                4h27m
pvc-db20b5fd-fa48-471b-b329-9d91636364e7   8Gi        RWO            Delete           Bound         default/peterica-redmine               hostpath                9m42s
pvc-e2b27fbf-8d9f-414e-bdbe-76a70f4dbf61   8Gi        RWO            Delete           Bound         default/data-my-release-mariadb-0      hostpath                4h33m
pvc-fdc79374-5c00-4651-b974-3cc9da855b8d   8Gi        RWO            Delete           Terminating   default/data-jiyae-mariadb-0           hostpath                4h27m

# PV 삭제
$ kubectl delete pv pvc-e2b27fbf-8d9f-414e-bdbe-76a70f4dbf61
persistentvolume "pvc-e2b27fbf-8d9f-414e-bdbe-76a70f4dbf61" deleted

 ㅇ 사전에 테스트했던 볼륨 정보들이 있음을 확인하였다.

 ㅇ 필요없는 볼륨은 삭제처리를 진행하였다.

 

 

ㅁ helm delete

# 기존에 된 설치된 peterica 삭제
$ helm delete peterica
release "peterica" uninstalled

 ㅇ helm은 비유적으로 쿠버네티스 패키지 매니저이다. 마치 apt, yum 툴처럼 쿠버네티스의 구성 오브젝트를 관리 할 수 있다.

 ㅇ helm delete peterica 명령어를 통해 설치된 로컬 peterica helm를 삭제하였다.

 ㅇ 참고로 helm uninstall peterica 명령어도 동일하게 작동한다.

 

 

ㅁ bitnami/redmine 설치 재설치

 ㅇ 기존의 방법으로 다시 설치를 수행하였다.

 ㅇ redmine 설치되는 과정이 궁금하여 log를 살펴 보았다.

 

 

ㅁ redmine 설치 로그

$ kubectl logs -f peterica-redmine-7ffdd874c4-ct5hm
redmine 15:42:18.40
redmine 15:42:18.43 Welcome to the Bitnami redmine container
redmine 15:42:18.45 Subscribe to project updates by watching https://github.com/bitnami/containers
redmine 15:42:18.47 Submit issues and feature requests at https://github.com/bitnami/containers/issues
redmine 15:42:18.49
redmine 15:42:18.59 INFO  ==> Validating settings in MYSQL_CLIENT_* env vars
redmine 15:42:18.69 INFO  ==> Validating settings in POSTGRESQL_CLIENT_* env vars
redmine 15:42:19.05 INFO  ==> Ensuring Redmine directories exist
redmine 15:42:19.20 INFO  ==> Trying to connect to the database server
redmine 15:42:19.32 INFO  ==> Configuring Redmine database connections
redmine 15:42:20.60 INFO  ==> Configuring Redmine application with settings provided via environment variables
redmine 15:42:20.94 INFO  ==> Executing database migrations
redmine 15:44:20.10 INFO  ==> Updating admin user credentials
redmine 15:44:20.19 INFO  ==> Loading default configuration data
redmine 15:45:18.94 INFO  ==> Persisting Redmine installation
redmine 15:45:20.22 INFO  ==> ** Redmine setup finished! **

redmine 15:45:20.36 INFO  ==> ** Starting Redmine **
=============== Phusion Passenger(R) Standalone web server started ===============
PID file: /opt/bitnami/redmine/passenger.3000.pid
Log file: /opt/bitnami/redmine/log/passenger.3000.log
Environment: production
Accessible via: http://0.0.0.0:3000/

You can stop Phusion Passenger(R) Standalone by pressing Ctrl-C.
Problems? Check https://www.phusionpassenger.com/library/admin/standalone/troubleshooting/
===============================================================================
[ N 2022-09-12 15:45:29.9177 641/T5 age/Cor/SecurityUpdateChecker.h:519 ]: Security update check: no update found (next check in 24 hours)

 ㅇ Executing database migrations 작업이 2분동안 이루어 지면서 지체가 있었다.

 ㅇ 기본적인 MariaDB 구성을 위한 시간이 소요되었고 약 5분정도 후 redmine에 접속 할 수 있었다.

 

 

ㅁ Redmine 초기화면

 ㅇ 접속 port를 80에서 8010으로 수정되었고, 정상적으로 접근 확인되었다.

 

 

ㅁ Remine 로그인

 ㅇ 기본 password가 아닌 수정된 password로 접속하면 된다.

 

 

ㅁ 프로젝트 생성

 ㅇ 기본 프로젝트를 생성하였다.

 

 

 

ㅁ 첫일감 생성하기

  ㅇ 기본적인 정보를 넣은 후 만들기를 클릭하였다.

 

 

 ㅇ 첫 일감이 만들어 졌다.

 

 

 

ㅁ 함께 보면 좋은 사이트

 

Overview - Redmine

Redmine¶ Redmine is a flexible project management web application. Written using the Ruby on Rails framework, it is cross-platform and cross-database. Redmine is open source and released under the terms of the GNU General Public License v2 (GPL). Features

www.redmine.org

 

redmine 20.3.3 · bitnami/bitnami

Redmine is an open source management application. It includes a tracking issue system, Gantt charts for a visual view of projects and deadlines, and supports SCM integration for version control.

artifacthub.io

 

반응형
Comments