예제 MariaDB 구성
예제 MariaDB 구성 (Kubernetes) (Example MariaDB Configuration)
MariaDB에 의존하는 프로젝트를 위한 지속적 통합(CI) 파이프라인 구성 방법을 안내합니다. Drone이 처음이라면 먼저 튜토리얼과 빌드 구성 가이드를 읽어 보세요.
출처: Drone CI Docs
본문
기본 예제 (Basic Example)
아래 예제는 MariaDB 서비스 컨테이너를 실행하는 파이프라인을 보여줍니다. 데이터베이스 서버는 localhost:3306에서 사용할 수 있습니다.
kind: pipeline
type: kubernetes
name: default
steps:
- name: test
image: mariadb
commands:
- sleep 15
- mysql -u root --execute="SELECT VERSION();"
services:
- name: database
image: mariadb
environment:
MYSQL_ALLOW_EMPTY_PASSWORD: 'yes'
MYSQL_DATABASE: test
데이터베이스 설정 (Database Settings)
공식 MariaDB 이미지는 시작 시점에 기본 사용자명, 비밀번호, 데이터베이스 등을 생성하는 데 사용되는 환경 변수를 제공합니다. 자세한 내용은 공식 이미지 문서를 참고하세요.
services:
- name: database
image: mariadb
environment:
MYSQL_DATABASE: test
MYSQL_ALLOW_EMPTY_PASSWORD: 'yes'
자주 겪는 문제 (Common Problems)
MariaDB 컨테이너에 연결할 수 없다면 MariaDB가 초기화를 마치고 연결을 받기 시작할 충분한 시간을 확보했는지 확인하세요.
kind: pipeline
type: kubernetes
name: default
steps:
- name: test
image: mariadb
commands:
- sleep 15
- mysql -u root
더 알아보기 (Learn more)
- Example MariaDB Configuration — Kubernetes 러너용 MariaDB 서비스 예제
- Services — 서비스 컨테이너 개요