update build branch

main
ycz008 2023-12-19 16:29:49 +08:00
parent 96b108d5c2
commit c2570694ce
5 changed files with 129 additions and 0 deletions

58
dev-upgrade/pg/pg.yaml Normal file
View File

@ -0,0 +1,58 @@
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: pg
spec:
replicas: 1
serviceName: pg
selector:
matchLabels:
app: pg
template:
metadata:
labels:
app: pg
spec:
containers:
- name: pg
image: postgres:14
ports:
- containerPort: 5432
volumeMounts:
- name: pg_data
mountPath: /var/lib/postgresql/data
env:
- name: POSTGRES_USER
value: "sonar"
- name: POSTGRES_PASSWORD
value: "sonar"
- name: POSTGRES_DB
value: "sonar"
volumes:
- name: pg_data
hostPath:
path: /data/sonarqube/postgresql/data
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: "kubernetes.io/hostname"
operator: In
values:
- bfs-k8snode-10-2-0-14.hetzner.base.beaconfireinc.com
---
apiVersion: v1
kind: Service
metadata:
name: pg
labels:
app: pg
spec:
ports:
- protocol: TCP
port: 5432
targetPort: 5432
selector:
app: pg
type: ClusterIP

View File

@ -0,0 +1,71 @@
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: sonarqube
spec:
replicas: 1
serviceName: sonarqube
selector:
matchLabels:
app: sonarqube
template:
metadata:
labels:
app: sonarqube
spec:
containers:
- name: sonarqube
image: sonarqube:10.3-community
env:
- name: SONAR_JDBC_URL
value: jdbc:postgresql://db:5432/sonar
- name: SONAR_JDBC_USERNAME
value: sonar
- name: SONAR_JDBC_PASSWORD
value: sonar
ports:
- name: http
containerPort: 9000
protocol: TCP
resources: {}
volumeMounts:
- name: sonarqube-data
mountPath: /opt/sonarqube/data
- name: sonarqube-logs
mountPath: /opt/sonarqube/logs
- name: sonarqube-extensions
mountPath: /opt/sonarqube/extensions
volumes:
- name: sonarqube-data
hostPath:
path: /data/sonarqube/sonarqube/data
- name: sonarqube-logs
hostPath:
path: /data/sonarqube/sonarqube/logs
- name: sonarqube-extensions
hostPath:
path: /data/sonarqube/sonarqube/extensions
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: "kubernetes.io/hostname"
operator: In
values:
- bfs-k8snode-10-2-0-14.hetzner.base.beaconfireinc.com
---
apiVersion: v1
kind: Service
metadata:
name: sonarqube
spec:
type: ClusterIP
ports:
- name: http
protocol: TCP
port: 9000
targetPort: http
selector:
app: sonarqube