-
Notifications
You must be signed in to change notification settings - Fork 90
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SYS-616 add gitea helm chart with git-dump updates (#147)
- Loading branch information
1 parent
fbe4fbe
commit 74aff01
Showing
15 changed files
with
222 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,8 +11,10 @@ ENV API_TOKEN_SECRET= \ | |
DEST_DIR=/var/backup/git \ | ||
HOUR=0 MINUTE=45 \ | ||
KEEP_DAYS=31 \ | ||
ORG= \ | ||
[email protected]:instantlinux/ \ | ||
REPOS= \ | ||
SCM_TYPE=github \ | ||
SSHKEY_SECRET=git-dump_sshkey \ | ||
SSH_PORT=22 \ | ||
USERNAME=git-dump \ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -48,8 +48,10 @@ These variables can be passed to the image from kubernetes.yaml or docker-compos | |
| HOUR | 0 |cron-syntax backup hour | | ||
| KEEP_DAYS | 31 | days of snapshots to keep | | ||
| MINUTE | 45 | cron-syntax minutes past hour | | ||
| ORG | | org in SCM | | ||
| REPO_PREFIX | [email protected]:instantlinux/ | prefix for each repository URI | | ||
| REPOS | | repository URIs to back up | | ||
| SCM_TYPE | github | type - github, gitlab, or gitea | | ||
| SSHKEY_SECRET | git-dump_sshkey | docker secret name as below | | ||
| SSH_PORT | 22 | TCP port of git service | | ||
| TZ | UTC | time zone | | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
*~ | ||
.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
apiVersion: v2 | ||
name: gitea | ||
description: Gitea source code management | ||
home: https://github.com/instantlinux/docker-tools | ||
sources: | ||
- https://github.com/instantlinux/docker-tools | ||
- https://github.com/go-gitea/gitea | ||
type: application | ||
version: 0.1.0 | ||
appVersion: 1.21.7-rootless | ||
dependencies: | ||
- name: chartlib | ||
version: 0.1.8 | ||
repository: https://instantlinux.github.io/docker-tools |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
{{- if hasKey .Values "service" }} | ||
{{- if or .Values.service.enabled (not (hasKey .Values.service "enabled")) }} | ||
1. Get the application URL by running these commands: | ||
{{- if hasKey .Values "ingress" }} | ||
{{- if .Values.ingress.enabled }} | ||
{{- range $host := .Values.ingress.hosts }} | ||
{{- range .paths }} | ||
http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ .path }} | ||
{{- end }} | ||
{{- end }} | ||
{{- else if contains "NodePort" .Values.service.type }} | ||
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "local.fullname" . }}) | ||
export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") | ||
echo http://$NODE_IP:$NODE_PORT | ||
{{- else if contains "LoadBalancer" .Values.service.type }} | ||
NOTE: It may take a few minutes for the LoadBalancer IP to be available. | ||
You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "local.fullname" . }}' | ||
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "local.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") | ||
echo http://$SERVICE_IP:{{ .Values.service.port }} | ||
{{- else if contains "ClusterIP" .Values.service.type }} | ||
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "local.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") | ||
export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}") | ||
echo "Visit http://127.0.0.1:8080 to use your application" | ||
kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:$CONTAINER_PORT | ||
{{- end }} | ||
{{- end }} | ||
{{- end }} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{{- include "chartlib.configmap" . }} | ||
--- | ||
{{- include "chartlib.deployment" . }} | ||
--- | ||
{{- include "chartlib.hpa" . }} | ||
--- | ||
{{- include "chartlib.ingress" . }} | ||
--- | ||
{{- include "chartlib.ingresstotp" . }} | ||
--- | ||
{{- include "chartlib.service" . }} | ||
--- | ||
{{- include "chartlib.serviceaccount" . }} | ||
--- | ||
{{- include "chartlib.statefulset" . }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: {{ include "local.fullname" . }}-nodeport | ||
labels: | ||
{{- include "local.labels" . | nindent 4 }} | ||
spec: | ||
type: NodePort | ||
ports: | ||
- { port: 2222, nodePort: {{ .Values.nodeportSSH }}, name: ssh } | ||
selector: | ||
{{- include "local.selectorLabels" . | nindent 4 }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{{- if hasKey .Values "service" }} | ||
apiVersion: v1 | ||
kind: Pod | ||
metadata: | ||
name: "{{ include "local.fullname" . }}-test-connection" | ||
labels: | ||
{{- include "local.labels" . | nindent 4 }} | ||
annotations: | ||
"helm.sh/hook": test | ||
spec: | ||
containers: | ||
- name: wget | ||
image: busybox | ||
command: ['wget'] | ||
args: ['{{ include "local.fullname" . }}:{{ .Values.service.port }}'] | ||
restartPolicy: Never | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
# Default values for gitea. | ||
tlsHostname: gitea.example.com | ||
nodeportSSH: 30999 | ||
deployment: | ||
env: | ||
gitea__database__host: "db00:3306" | ||
gitea__database__name: gitea | ||
gitea__database__user: gitea | ||
gitea__mailer__from: [email protected] | ||
gitea__mailer__protocol: smtp | ||
gitea__mailer__smtp_addr: smtp | ||
gitea__service__disable_registration: "false" | ||
gitea__service__require_signin_view: "true" | ||
tz: UTC | ||
# runAsUser unsupported - leave these at default | ||
user_gid: 1000 | ||
user_uid: 1000 | ||
xenv: | ||
- name: gitea__database__passwd | ||
valueFrom: | ||
secretKeyRef: | ||
key: gitea-db-password | ||
name: gitea-db-password | ||
containerPorts: | ||
- containerPort: 2222 | ||
- containerPort: 3000 | ||
livenessProbe: | ||
httpGet: | ||
path: /api/healthz | ||
port: http | ||
initialDelaySeconds: 200 | ||
timeoutSeconds: 5 | ||
periodSeconds: 10 | ||
successThreshold: 1 | ||
failureThreshold: 10 | ||
nodeSelector: | ||
service.gitea: allow | ||
resources: | ||
limits: | ||
memory: 2048Mi | ||
requests: | ||
cpu: 300m | ||
memory: 128Mi | ||
volumeMounts: | ||
- mountPath: /var/lib/gitea | ||
name: data | ||
subPath: data | ||
- mountPath: /etc/gitea | ||
name: data | ||
subPath: etc | ||
# readOnly: true | ||
volumes: | ||
- name: data | ||
hostPath: { path: /var/lib/docker/k8s-volumes/share/gitea } | ||
|
||
image: | ||
repository: gitea/gitea | ||
pullPolicy: IfNotPresent | ||
# tag: default | ||
|
||
nameOverride: "" | ||
fullnameOverride: "" | ||
|
||
serviceAccount: {} | ||
service: | ||
service: | ||
clusterIP: None | ||
ports: | ||
- { port: 80, targetPort: 3000, name: gitea } | ||
- { port: 8999, targetPort: 2222, name: ssh } | ||
type: ClusterIP | ||
autoscaling: | ||
enabled: false | ||
|
||
authelia: | ||
fqdn: authtotp.example.com | ||
ip: 10.101.1.5 | ||
path: /user/login | ||
ingress: | ||
annotations: | ||
cert-manager.io/cluster-issuer: letsencrypt-prod | ||
kubernetes.io/ingress.class: nginx | ||
nginx.ingress.kubernetes.io/enable-access-log: "false" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters