그누보드 쿠버네티스 배포
시도 해본 사항입니다.
참고만 해주세요.출처: https://sdk.xyz/2021/05/01/gnu-k8s
내년(2022년) 에 pubilc cloud 에 분산환경으로 그누보드를 배포하는것이 목표입니다.
올 초에 시도했던것을 공유드립니다.
그누보드 쿠버네티스 설치
이 글은 Ubuntu 18.04 LTS 운영체제에서 kubernetes환경에서 LNMP 소프트웨어를 설치하고 구성하는 방법에 대해 설명합니다.
LNMP(Linux + Nginx + MariaDB + PHP-FPM) 구성을 이 글에서는 Ubuntu 18.04 LTS 운영체제에 k8s로 설명합니다.
순서
-
PVC
- clone 그누보드
- /data/ mount
- php-fpm
- Nginx ConfigMap 구성
-
Deployment
- nginx
- php-fpm
-
Ingress 설정
- ssl: cert-manager.io 사용
- secret 생성
- domain 연결
- *
TODO
- DB(MariaBD) -> k8s (현재 다른 서버에 있음)
- k8s 백업 환경 구성 -> 별도 게시글로
최종 yaml 종류
- pod.yaml
- service.yaml
- deployment.yaml
- nginxConfig.yaml
쿠버네티스 기본 명령어
kubectl -> k
Create Persistent Volume
PV(Persistent Volume)생성
https://kubernetes.io/ko/docs/concepts/storage/persistent-volumes/
퍼시스턴트 볼륨 생성
https://bcho.tistory.com/1259
쿠버네티스 #5 - 디스크 (볼륨/Volume) - 참고: 조대협의 블로그 Kubernetes Persistent Volume 생성하기 - PV, PVC
pv.yaml
[code]apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: dir
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
[/code]
참고 PV 에제들
NFS
[code]apiVersion: v1
kind: PersistentVolume
metadata:
name: wildfly-pv
labels:
name: wildfly-pv
spec:
capacity:
storage: 10Ti
accessModes:
- ReadWriteMany
nfs:
server: 192.168.56.104
path: /mypath
---
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: wildfly-pvc
spec:
accessModes:
- ReadWriteMany
resources:
requests:
storage: 10Ti
selector:
matchLabels:
name: wildfly-pv[/code]
HostPath
[code]apiVersion: v1
kind: Pod
metadata:
name: hostpath
spec:
containers:
- name: redis
image: redis
volumeMounts:
- name: terrypath
mountPath: /data/shared
volumes:
- name: terrypath
hostPath:
path: /tmp
type: Directory[/code]
[code]repoGit[/code]/strong> 지원 하지 않음.
PHP-FPM 서비스 생성
php_service.yaml
[code]apiVersion: v1
kind: Service
metadata:
name: php
labels:
tier: backend
spec:
selector:
app: php
tier: backend
ports:
protocol: TCP
port: 9000 [/code]
Create PHP-FPM Deployment
[code]apiVersion: apps/v1
kind: Deployment
metadata:
name: php
labels:
tier: backend
spec:
replicas: 1
selector:
matchLabels:
app: php
tier: backend
template:
metadata:
labels:
app: php
tier: backend
spec:
volumes:
- name: dir
persistentVolumeClaim:
claimName: dir
containers:
- name: php
image: woosungchoi/fpm-alpine:latest
volumeMounts:
- name: dir
mountPath: /dir
initContainers:
- name: install
image: busybox
volumeMounts:
- name: dir
mountPath: /dir
command:
- git
- "clone"
- https://github.com/gnuboard/gnuboard5
- "/dir/"[/code]
image: woosungchoi/fpm-alpine:latest
우성짱님의 php-8.x 버전: 항상 최신 fpm으로 유지 가능하다.
결과
k get svc
PV에는 여러가지 종류가 있습니다.
그누보드 디렉토리 생성
mkdir
Ingress
clone ingress
$ git clone https://github.com/kubernetes/ingress-nginx.git
Cloning into 'ingress-nginx'...
remote: Enumerating objects: 100500, done.
remote: Counting objects: 100% (149/149), done.
remote: Compressing objects: 100% (93/93), done.
remote: Total 100500 (delta 61), reused 110 (delta 45), pack-reused 100351
Receiving objects: 100% (100500/100500), 117.29 MiB | 10.61 MiB/s, done.
Resolving deltas: 100% (55540/55540), done.
네임스페이스 생성
kubectl create namespace ingress-nginx
Ingress 확인
root@node1:~/kubernetes-book/ingress# kubectl get svc -n ingress-nginx
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
ingress-nginx-controller NodePort 10.233.5.71 <none> 80:30326/TCP,443:30910/TCP 8m54s
ingress-nginx-controller-admission ClusterIP 10.233.27.122 <none> 443/TCP 8m54s
root@node1:~/kubernetes-book/ingress#
참조사이트
Kubernetes Basic PHP 7.3 Application with Nginx on Google Cloud
[초보]쿠버네티스에서 그누보드5 서비스 설정하기 - 영통사람
https://sir.kr/g5_tip/12697 - 명량폐인
도커(Docker)를 이용한 그누보드5 로컬 개발환경 설정 - 우성짱
Ubuntu 18.04 LTS 에서 웹서버(NGINX + PHP-FPM + MariaDB) 구성하기 - 라엘
댓글 2개
게시판 목록
그누보드5 팁자료실
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 공지 | 3년 전 | 4429 | ||
| 2664 |
선택과집중
|
4개월 전 | 574 | |
| 2663 |
|
4개월 전 | 626 | |
| 2662 |
|
4개월 전 | 582 | |
| 2661 |
선택과집중
|
4개월 전 | 512 | |
| 2660 | 4개월 전 | 588 | ||
| 2659 |
Modify
|
4개월 전 | 654 | |
| 2658 |
선택과집중
|
4개월 전 | 416 | |
| 2657 | 4개월 전 | 452 | ||
| 2656 |
|
5개월 전 | 965 | |
| 2655 |
선택과집중
|
5개월 전 | 549 | |
| 2654 | 5개월 전 | 405 | ||
| 2653 |
선택과집중
|
5개월 전 | 591 | |
| 2652 | 5개월 전 | 398 | ||
| 2651 | 5개월 전 | 447 | ||
| 2650 |
선택과집중
|
5개월 전 | 328 | |
| 2649 |
선택과집중
|
5개월 전 | 426 | |
| 2648 | 5개월 전 | 442 | ||
| 2647 |
welcome
|
5개월 전 | 545 | |
| 2646 |
디지털홍익인간
|
5개월 전 | 453 | |
| 2645 | 5개월 전 | 469 | ||
| 2644 |
선택과집중
|
5개월 전 | 515 | |
| 2643 | 5개월 전 | 459 | ||
| 2642 | 5개월 전 | 372 | ||
| 2641 | 5개월 전 | 361 | ||
| 2640 | 5개월 전 | 394 | ||
| 2639 | 5개월 전 | 1363 | ||
| 2638 |
|
5개월 전 | 517 | |
| 2637 |
세르반데스
|
5개월 전 | 402 | |
| 2636 |
선택과집중
|
6개월 전 | 571 | |
| 2635 |
선택과집중
|
6개월 전 | 687 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기