buildbot: renam/intro

This commit is contained in:
Nico Schottelius 2021-07-28 20:19:27 +02:00
parent e6ac22689a
commit b3f8e33212

View file

@ -2,39 +2,39 @@
apiVersion: apps/v1 apiVersion: apps/v1
kind: Deployment kind: Deployment
metadata: metadata:
name: {{ .Release.Name }}-gitea name: {{ .Release.Name }}-buildbot
spec: spec:
selector: selector:
matchLabels: matchLabels:
app: {{ .Release.Name }}-gitea app: {{ .Release.Name }}-buildbot
replicas: 1 replicas: 1
template: template:
metadata: metadata:
labels: labels:
app: {{ .Release.Name }}-gitea app: {{ .Release.Name }}-buildbot
use-as-service: {{ .Release.Name }} use-as-service: {{ .Release.Name }}
spec: spec:
initContainers: initContainers:
- name: wait-for-cert # - name: wait-for-cert
image: busybox # image: busybox
command: # command:
- sh # - sh
- -c # - -c
- until ls /etc/letsencrypt/live/{{ tpl .Values.fqdn . }}/fullchain.pem; do sleep 5; done # - until ls /etc/letsencrypt/live/{{ tpl .Values.fqdn . }}/fullchain.pem; do sleep 5; done
volumeMounts: # volumeMounts:
- name: etcletsencrypt # - name: etcletsencrypt
mountPath: "/etc/letsencrypt" # mountPath: "/etc/letsencrypt"
containers: containers:
# This container will only start *after* the cert has been placed # This container will only start *after* the cert has been placed
- name: nginx # - name: nginx
image: nginx:1.21-alpine # image: nginx:1.21-alpine
ports: # ports:
- containerPort: 443 # - containerPort: 443
volumeMounts: # volumeMounts:
- name: nginx-config # - name: nginx-config
mountPath: "/etc/nginx/conf.d/" # mountPath: "/etc/nginx/conf.d/"
- name: etcletsencrypt # - name: etcletsencrypt
mountPath: "/etc/letsencrypt" # mountPath: "/etc/letsencrypt"
- name: postgres - name: postgres
image: postgres:13 image: postgres:13
ports: ports:
@ -47,39 +47,34 @@ spec:
- name: postgres-data - name: postgres-data
mountPath: "/var/lib/postgresql/data" mountPath: "/var/lib/postgresql/data"
subPath: postgres subPath: postgres
- name: gitea - name: buildbot
image: gitea/gitea:{{ .Chart.AppVersion }} image: buildbot/buildbot:v{{ .Chart.AppVersion }}
ports: ports:
- containerPort: 22 - containerPort: 8010
- containerPort: 3000
securityContext:
capabilities:
add:
- SYS_CHROOT
env: env:
- name: USER_UID # - name: USER_UID
value: "1000" # value: "1000"
- name: USER_GID # - name: USER_GID
value: "1000" # value: "1000"
- name: GITEA__server__DOMAIN # - name: BUILDBOT__server__DOMAIN
value: "{{ tpl .Values.fqdn . }}" # value: "{{ tpl .Values.fqdn . }}"
- name: GITEA__server__ROOT_URL # - name: BUILDBOT__server__ROOT_URL
value: "https://{{ tpl .Values.fqdn . }}" # value: "https://{{ tpl .Values.fqdn . }}"
- name: GITEA__database__DB_TYPE - name: BUILDBOT_DB_URL
value: "postgres" value: "postgresql+psycopg2://{POSTGRES_USER}:{POSTGRES_PASSWORD}@db/{POSTGRES_DB}"
- name: GITEA__database__HOST - name: BUILDBOT__database__HOST
value: "localhost" value: "localhost"
- name: GITEA__database__NAME - name: POSTGRES_DB
valueFrom: valueFrom:
configMapKeyRef: configMapKeyRef:
name: {{ tpl .Values.identifier . }}-postgres-config name: {{ tpl .Values.identifier . }}-postgres-config
key: POSTGRES_DB key: POSTGRES_DB
- name: GITEA__database__USER - name: POSTGRES_USER
valueFrom: valueFrom:
configMapKeyRef: configMapKeyRef:
name: {{ tpl .Values.identifier . }}-postgres-config name: {{ tpl .Values.identifier . }}-postgres-config
key: POSTGRES_USER key: POSTGRES_USER
- name: GITEA__database__PASSWD - name: POSTGRES_PASSWORD
valueFrom: valueFrom:
configMapKeyRef: configMapKeyRef:
name: {{ tpl .Values.identifier . }}-postgres-config name: {{ tpl .Values.identifier . }}-postgres-config
@ -113,22 +108,13 @@ metadata:
spec: spec:
type: ClusterIP type: ClusterIP
ports: ports:
- port: 22
name: ssh
# Required for letsencrypt # Required for letsencrypt
- port: 80 - port: 8010
name: http name: http
- port: 443 - port: 443
name: https name: https
selector: selector:
use-as-service: {{ .Release.Name }} use-as-service: {{ .Release.Name }}
# ---
# apiVersion: v1
# kind: ConfigMap
# metadata:
# name: {{ tpl .Values.identifier . }}-giteaconfig
# data:
# {{ tpl (.Files.Glob "gitea/*").AsConfig . | indent 2 }}
--- ---
apiVersion: v1 apiVersion: v1
kind: PersistentVolumeClaim kind: PersistentVolumeClaim
@ -200,34 +186,34 @@ spec:
persistentVolumeClaim: persistentVolumeClaim:
claimName: {{ tpl .Values.identifier . }}-letsencrypt-certs claimName: {{ tpl .Values.identifier . }}-letsencrypt-certs
backoffLimit: 3 backoffLimit: 3
--- #---
apiVersion: v1 # apiVersion: v1
kind: ConfigMap # kind: ConfigMap
metadata: # metadata:
name: {{ tpl .Values.identifier . }}-nginx-config # name: {{ tpl .Values.identifier . }}-nginx-config
data: # data:
default.conf: | # default.conf: |
server { # server {
listen 443 ssl; # listen 443 ssl;
listen [::]:443 ssl; # listen [::]:443 ssl;
server_name {{ tpl .Values.fqdn . }}; # server_name {{ tpl .Values.fqdn . }};
ssl_certificate /etc/letsencrypt/live/{{ tpl .Values.fqdn . }}/fullchain.pem; # ssl_certificate /etc/letsencrypt/live/{{ tpl .Values.fqdn . }}/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/{{ tpl .Values.fqdn . }}/privkey.pem; # ssl_certificate_key /etc/letsencrypt/live/{{ tpl .Values.fqdn . }}/privkey.pem;
client_max_body_size 256m; # client_max_body_size 256m;
location / { # location / {
proxy_pass http://localhost:3000; # proxy_pass http://localhost:3000;
} # }
} # }
--- ---
apiVersion: v1 apiVersion: v1
kind: ConfigMap kind: ConfigMap
metadata: metadata:
name: {{ tpl .Values.identifier . }}-postgres-config name: {{ tpl .Values.identifier . }}-postgres-config
data: data:
POSTGRES_USER: gitea POSTGRES_USER: buildbot
POSTGRES_PASSWORD: aiJohtoqueeng0oosh8ohfoh1chahPh3 POSTGRES_PASSWORD: aiJohtoqueeng0oosh8ohfoh1chahPh3
POSTGRES_DB: gitea POSTGRES_DB: buildbot