티스토리 뷰
1.PV생성
apiVersion: v1
kind: PersistentVolume
metadata:
name: pv-local
labels:
type: local
spec:
storageClassName: manual
capacity:
storage: 5Gi
accessModes:
- ReadWriteOnce
hostPath:
path: "/mnt/data"
2.PVC생성
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: pvc-local-testi
namespace: operations
spec:
storageClassName: manual
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
3.config 또는 secret생성
ConfigMap
apiVersion: v1
kind: ConfigMap
metadata:
name: postgres-config
labels:
app: postgres
namespace: operations
data:
POSTGRES_DB: postgresdb
POSTGRES_USER: root
POSTGRES_PASSWORD: admin123
Secret
apiVersion: v1
kind: Secret
metadata:
name: 이름
namespace: operations
data:
POSTGRES_DB: <base64>
POSTGRES_USER: <base64>
POSTGRES_PASSWORD: <base64>
4.postgreSQL deployment 생성
apiVersion: apps/v1
kind: Deployment
metadata:
name: postgres
namespace: operations
spec:
replicas: 1
selector:
matchLabels:
app: postgres
template:
metadata:
labels:
app: postgres
spec:
containers:
- name: postgres
image: postgres:13.3
imagePullPolicy: "IfNotPresent"
ports:
- containerPort: 5432
envFrom:
- configMapRef: #configMap 을 사용한 경우
name: postgres-config
- secretRef: #secret 을 사용한 경우
name: <secret 이름>
volumeMounts:
- mountPath: /var/lib/postgresql/data
name: postgredb
volumes:
- name: postgredb
persistentVolumeClaim:
claimName: pvc-local-testi
*************************************
apiVersion: apps/v1
kind: Deployment
metadata:
name: test-db
namespace: test
spec:
replicas: 1
selector:
matchLabels:
app: test
tier: postgresql
template:
metadata:
labels:
app: test
tier: postgresql
spec:
containers:
- name: postgres
image: postgres:13.3
imagePullPolicy: "IfNotPresent"
ports:
- containerPort: 5432
envFrom:
- secretRef:
name: test-db-secret
volumeMounts:
- mountPath: /var/lib/postgresql/data
name: test-db-pv
volumes:
- name: test-db-pv
persistentVolumeClaim:
claimName: test-db-pv-claim
5.postgreSQL service 생성
apiVersion: v1
kind: Service
metadata:
name: postgres
labels:
app: postgres
namespace: operations
spec:
type: NodePort
ports:
- port: 5432
selector:
app: postgres
postgreSQL연동 test
psql -h localhost -U root --password -p <NodePort> postgresdb
좋아요1
공유하기
게시글 관리
댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
링크
TAG
- 코로나19
- (InstantClient) 설치하기(HP-UX)
- K8s
- 오라클 홈디렉토리 copy 후 startup 에러
- 우분투
- 버쳐박스
- 5.4.0.1072
- 테라폼
- 스토리지 클레스
- 쿠버네티스
- 튜닝
- 커널
- 여러서버 컨트롤
- pod 상태
- MSA
- 키알리
- 트리이스
- CVE 취약점 점검
- Oracle
- [오라클 튜닝] sql 튜닝
- 오라클 인스턴트클라이언트(InstantClient) 설치하기(HP-UX)
- 오라클 트러블 슈팅(성능 고도화 원리와 해법!)
- 앤시블
- 오라클
- directory copy 후 startup 에러
- ORACLE 트러블 슈팅(성능 고도화 원리와 해법!)
- startup 에러
- ubuntu
- 설치하기(HP-UX)
- [오라클 튜닝] instance 튜닝2
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | |||||
3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 | 18 | 19 | 20 | 21 | 22 | 23 |
24 | 25 | 26 | 27 | 28 | 29 | 30 |
글 보관함