반응형
# Namespace
이미 구성된 "devops" 사용
참고) Jenkins 구성하기 https://clued.tistory.com/49
# PV 생성
apiVersion: v1
kind: PersistentVolume
metadata:
namespace: devops
name: jira-pv
spec:
storageClassName: nfs-sc
capacity:
storage: 100Gi
persistentVolumeReclaimPolicy: Retain
accessModes:
- ReadWriteMany
nfs:
server: 12.34.56.78
path: '/volume1/nfs_root/jira'
readOnly: false
# PVC 생성
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: jira-pvc
namespace: devops
spec:
storageClassName: nfs-sc
accessModes:
- ReadWriteMany
resources:
requests:
storage: 100Gi
# Deployment 생성
apiVersion: apps/v1
kind: Deployment
metadata:
name: jira
namespace: devops
spec:
replicas: 1
selector:
matchLabels:
app: jira
template:
metadata:
labels:
app: jira
spec:
containers:
- name: jira
image: atlassian/jira-software
imagePullPolicy: IfNotPresent
ports:
- name: http-port
containerPort: 8080
volumeMounts:
- name: jira-volume
mountPath: /var/atlassian/application-data/jira
volumes:
- name: jira-volume
persistentVolumeClaim:
claimName: jira-pvc
# Service 생성
apiVersion: v1
kind: Service
metadata:
name: jira-svc
namespace: devops
spec:
ports:
- port: 8080
targetPort: 8080
protocol: TCP
name: http
selector:
app: jira
# Ingress 생성
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: jira-ingress
namespace: devops
annotations:
kubernetes.io/ingress.class: nginx
nginx.ingress.kubernetes.io/cors-allow-credentials: "true"
nginx.ingress.kubernetes.io/cors-allow-headers: Authorization, origin, accept
nginx.ingress.kubernetes.io/cors-allow-methods: GET, OPTIONS
nginx.ingress.kubernetes.io/enable-cors: "true"
spec:
rules:
- host: jira.devops.lan
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: jira-svc
port:
number: 8080
# DB 구성하기
- 사전에 postgresql 구성이 끝나야 한다
- 참고) Postgresql 구성하기 https://clued.tistory.com/50
root@postgresql-statefulset-0:~# psql -U devops
psql (11.14 (Debian 11.14-1.pgdg90+1))
Type "help" for help.
devops=# CREATE database jira WITH ENCODING 'UNICODE' LC_COLLATE 'C' LC_CTYPE 'C' TEMPLATE template0 OWNER devops;
CREATE DATABASE
devops=#
# DB 설정 (참고)

반응형
'인프라 관리 > ▷ Docker & Kubernetes' 카테고리의 다른 글
Kubernetes 설치 (0) | 2023.01.22 |
---|---|
cri-o 설치 (1) | 2023.01.22 |
kubernetes환경에서 postgresql 구성하기 (StatefulSet) (0) | 2022.04.18 |
Kuberentes 환경에서 Jenkins 구성하기 (0) | 2022.04.15 |
Nginx Ingress Controller 구성하기 (0) | 2022.04.15 |