1
0
Fork 0

setup prod

This commit is contained in:
Massaki Archambault 2021-08-26 12:42:48 -04:00
parent b9c69e3f4b
commit f90e1bb0b5
13 changed files with 103 additions and 78 deletions

View File

@ -91,6 +91,5 @@ spec:
app.kubernetes.io/component: runner app.kubernetes.io/component: runner
ports: ports:
- name: http - name: http
protocol: TCP
port: 3000 port: 3000
targetPort: http targetPort: http

View File

@ -68,6 +68,5 @@ spec:
app.kubernetes.io/component: server app.kubernetes.io/component: server
ports: ports:
- name: http - name: http
protocol: TCP
port: 80 port: 80
targetPort: http targetPort: http

View File

@ -5,7 +5,9 @@ metadata:
labels: labels:
app.kubernetes.io/name: gitea app.kubernetes.io/name: gitea
spec: spec:
replicas: 1 # replica count must be set to 1 in database is sqlite replicas: 1 # gitea doesn't handle HA well
strategy:
type: Recreate
selector: selector:
matchLabels: matchLabels:
app.kubernetes.io/name: gitea app.kubernetes.io/name: gitea
@ -18,42 +20,22 @@ spec:
- name: gitea - name: gitea
image: gitea/gitea image: gitea/gitea
env: env:
# - name: INSTALL_LOCK - name: GITEA__DEFAULT__APP_NAME
# value: "yes"
- name: DISABLE_REGISTRATION
value: "yes"
- name: APP_NAME
value: Badjware's code stash value: Badjware's code stash
- name: RUN_MODE - name: GITEA__SERVICE__DISABLE_REGISTRATION
value: prod value: "yes"
- name: ROOT_URL - name: GITEA__SERVER__ROOT_URL
value: https://${GITEA_EXTERNAL_HOST} value: https://${GITEA_EXTERNAL_HOST}
- name: SSH_DOMAIN - name: GITEA__SERVER__SSH_DOMAIN
value: ${GITEA_EXTERNAL_HOST} value: ${GITEA_EXTERNAL_HOST}
- name: GITEA__SERVER__SSH_PORT
value: "30022"
- name: GITEA__METRICS__ENABLED - name: GITEA__METRICS__ENABLED
value: "true" value: "true"
# - name: DB_TYPE - name: GITEA__REPOSITORY__DISABLED_REPO_UNITS
# value: postgres value: repo.wiki
# - name: DB_HOST - name: GITEA__REPOSITORY__DEFAULT_REPO_UNITS
# valueFrom: value: repo.code,repo.releases
# secretKeyRef:
# name: postgres-credentials-secret
# key: host
# - name: DB_NAME
# valueFrom:
# secretKeyRef:
# name: postgres-credentials-secret
# key: database
# - name: DB_USER
# valueFrom:
# secretKeyRef:
# name: postgres-credentials-secret
# key: username
# - name: DB_PASSWD
# valueFrom:
# secretKeyRef:
# name: postgres-credentials-secret
# key: password
ports: ports:
- name: http - name: http
containerPort: 3000 containerPort: 3000
@ -119,10 +101,20 @@ spec:
app.kubernetes.io/name: gitea app.kubernetes.io/name: gitea
ports: ports:
- name: http - name: http
protocol: TCP
port: 80 port: 80
targetPort: http targetPort: http
- name: ssh ---
protocol: TCP apiVersion: v1
port: 22 kind: Service
metadata:
name: gitea-ssh
labels:
app.kubernetes.io/name: gitea
spec:
type: NodePort
selector:
app.kubernetes.io/name: gitea
ports:
- port: 22
targetPort: ssh targetPort: ssh
nodePort: 30022

View File

@ -5,6 +5,9 @@ metadata:
labels: labels:
app.kubernetes.io/name: grafana app.kubernetes.io/name: grafana
spec: spec:
replicas: 1 # we can only have 1 replica for as long as the database is sqlite
strategy:
type: Recreate
selector: selector:
matchLabels: matchLabels:
app.kubernetes.io/name: grafana app.kubernetes.io/name: grafana
@ -107,6 +110,5 @@ spec:
app.kubernetes.io/name: grafana app.kubernetes.io/name: grafana
ports: ports:
- name: http - name: http
protocol: TCP
port: 3000 port: 3000
targetPort: http targetPort: http

View File

@ -1,2 +1,3 @@
resources: resources:
- https://raw.githubusercontent.com/longhorn/longhorn/v1.2.0/deploy/longhorn.yaml - https://raw.githubusercontent.com/longhorn/longhorn/v1.2.0/deploy/longhorn.yaml
- longhorn-ingress.yaml

View File

@ -0,0 +1,19 @@
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: longhorn-frontend
namespace: longhorn-system
labels:
app.kubernetes.io/name: longhorn-ui
spec:
rules:
- host: ${LONGHORN_EXTERNAL_HOST}
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: longhorn-frontend
port:
name: http

View File

@ -94,6 +94,5 @@ spec:
app.kubernetes.io/name: nextcloud app.kubernetes.io/name: nextcloud
ports: ports:
- name: http - name: http
protocol: TCP
port: 80 port: 80
targetPort: http targetPort: http

View File

@ -63,5 +63,4 @@ spec:
ports: ports:
- name: http-metrics - name: http-metrics
port: 9100 port: 9100
protocol: TCP
targetPort: http-metrics targetPort: http-metrics

View File

@ -7,3 +7,6 @@ bases:
# allow "kubectl apply -l managed-by=cluster --prune ..." # allow "kubectl apply -l managed-by=cluster --prune ..."
commonlabels: commonlabels:
managed-by: kustomize-cluster managed-by: kustomize-cluster
transformers:
- transformers/placeholders.yaml

View File

@ -0,0 +1 @@
LONGHORN_EXTERNAL_HOST=longhorn.badjnet.local

View File

@ -0,0 +1,5 @@
apiVersion: badjware/v1
kind: PlaceholderTransformer
metadata:
name: placeholders
placeholdersFile: placeholders.txt

View File

@ -0,0 +1,6 @@
apiVersion: badjware/v1
kind: SSMParameterPlaceholderTransformer
metadata:
name: ssm-parameter
resourceSelectors:
- kind: Secret

View File

@ -1,40 +1,40 @@
# bases: bases:
# - ../../namespaces/kubernetes-dashboard - ../../namespaces/kubernetes-dashboard
# - ../../namespaces/gitea - ../../namespaces/gitea
# - ../../namespaces/grafana - ../../namespaces/grafana
# - ../../namespaces/monitoring - ../../namespaces/monitoring
# images: images:
# - name: gitea/gitea - name: gitea/gitea
# newtag: 1.15.0 newtag: 1.15.0
# - name: grafana - name: grafana
# newtag: 8.1.2 newtag: 8.1.2
# - name: drone/drone - name: drone/drone
# newtag: 2.0.6 newtag: 2.0.6
# - name: drone/drone-runner-kube - name: drone/drone-runner-kube
# newtag: 1.0.0-beta.9 newtag: 1.0.0-beta.9
# secretGenerator: secretGenerator:
# - name: drone-secret - name: drone-secret
# type: Opaque type: Opaque
# namespace: gitea namespace: gitea
# behavior: replace behavior: replace
# literals: literals:
# - rpc_secret=9128146e66f104873df80dad3ef12cf0 - rpc_secret=${ssm:/k3s/prod/drone/gitea/rpc_secret}
# # https://docs.drone.io/server/provider/gitea/ # https://docs.drone.io/server/provider/gitea/
# - name: drone-gitea-oauth-secret - name: drone-gitea-oauth-secret
# type: Opaque type: Opaque
# namespace: gitea namespace: gitea
# behavior: replace behavior: replace
# literals: literals:
# - client_id=6c0c6878-baf1-4648-b0cf-69eeae69e692 - client_id=${ssm:/k3s/prod/drone/gitea/client_id}
# - client_secret=Q78VsgyfgTzKrvQEmokEMj84g7epKrlBpmDjcbhKXCIh - client_secret=${ssm:/k3s/prod/drone/gitea/client_secret}
# # allow "kubectl apply -l managed-by=kustomize --prune ..." # allow "kubectl apply -l managed-by=kustomize --prune ..."
# commonlabels: commonlabels:
# managed-by: kustomize managed-by: kustomize
# transformers: transformers:
# - transformers/placeholders.yaml - transformers/placeholders.yaml
# # - transformers/ssm-secrets.yaml - transformers/ssm-secrets.yaml