Skip to content
This repository was archived by the owner on Feb 22, 2022. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions incubator/gitea/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*~
# Various IDEs
.project
.idea/
*.tmproj
13 changes: 13 additions & 0 deletions incubator/gitea/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: v1
description: 'Gitea: Go Git Service'
name: gitea
appVersion: 1.3.2
version: 0.0.1
home: https://gitea.io/
icon: https://gitea.io/images/favicon.png
keywords:
- git
- gitea
maintainers:
- name: cdrage
email: [email protected]
72 changes: 72 additions & 0 deletions incubator/gitea/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# Gitea Helm Chart

[Gitea][] is a painless self-hosted Git service.

## TL;DR;

```console
$ helm install incubator/gitea
```

## Introduction

This chart bootstraps a [Gitea][] deployment on a [Kubernetes][] cluster using
the [Helm][] package manager.

## Prerequisites Details

* PV support on underlying infrastructure (if persistence is required)

## Installing the Chart

To install the chart with the release name `my-release`:

```console
$ helm install --name my-release incubator/gitea
```

## Uninstalling the Chart

To uninstall/delete the `my-release` deployment:

```console
$ helm delete my-release
```

The command removes nearly all the Kubernetes components associated with the
chart and deletes the release.

## Configuration

The following tables lists some of the configurable parameters of the Gitea
chart and their default values.

| Parameter | Description | Default |
|----------------------------------|--------------------------------------------------------------|---------------------------------------------------------|
| `imageRepository` | Gitea image | `gitea/gitea` |
| `imageTag` | Gitea image version | `1.3.2` |
| `imagePullPolicy` | Gitea image pull policy | `Always` if `imageTag` is `latest`, else `IfNotPresent` |
| `postgresql.install` | Weather or not to install PostgreSQL dependency | `true` |
| `postgresql.postgresHost` | PostgreSQL host (if `postgresql.install == false`) | `nil` |
| `postgresql.postgresUser` | PostgreSQL User to create | `gitea` |
| `postgresql.postgresPassword` | PostgreSQL Password for the new user | `gitea` |
| `postgresql.postgresDatabase` | PostgreSQL Database to create | `gitea` |
| `postgresql.persistence.enabled` | Enable PostgreSQL persistence using Persistent Volume Claims | `true` |

See [values.yaml](values.yaml) for a more complete list, and links to the Gitea documentation.

Specify each parameter using the `--set key=value[,key=value]` argument to
`helm install`.

Alternatively, a YAML file that specifies the values for the parameters can be
provided while installing the chart. For example,

```console
$ helm install --name my-release -f values.yaml incubator/gitea
```

> **Tip**: You can use the default [values.yaml](values.yaml)

[Gitea]: https://github.com/go-gitea/gitea
[Kubernetes]: https://kubernetes.io
[Helm]: https://helm.sh
6 changes: 6 additions & 0 deletions incubator/gitea/requirements.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
dependencies:
- name: postgresql
repository: https://kubernetes-charts.storage.googleapis.com/
version: 0.8.12
digest: sha256:fa8809a605bfa4b36a22ff37b10a7b94f36b227e4d2bca359e6a3a11b791dced
generated: 2018-02-20T10:53:40.627767135-05:00
5 changes: 5 additions & 0 deletions incubator/gitea/requirements.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
dependencies:
- name: postgresql
version: ~0.8.9
repository: https://kubernetes-charts.storage.googleapis.com/
condition: postgresql.install
23 changes: 23 additions & 0 deletions incubator/gitea/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
1. Get the Gitea URL by running:

{{- if contains "NodePort" .Values.serviceType }}

export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ template "gitea.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.serviceType }}

NOTE: It may take a few minutes for the LoadBalancer IP to be available.
Watch the status with: 'kubectl get svc --namespace {{ .Release.Namespace }} -w {{ template "gitea.fullname" . }}'

export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "gitea.fullname" . }} -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
echo http://$SERVICE_IP/
{{- else if contains "ClusterIP" .Values.serviceType }}

export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app={{ template "gitea.fullname" . }}" -o jsonpath="{.items[0].metadata.name}")
echo http://127.0.0.1:8080/
kubectl port-forward $POD_NAME 8080:80
{{- end }}

2. Register a user. The first user registered will be the administrator.
77 changes: 77 additions & 0 deletions incubator/gitea/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
{{/* vim: set filetype=mustache: */}}
{{/*
Expand the name of the chart.
*/}}
{{- define "gitea.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
{{- end -}}

{{/*
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
*/}}
{{- define "gitea.fullname" -}}
{{- $name := default .Chart.Name .Values.nameOverride -}}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
{{- end -}}

{{/*
Create a fully qualified server name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
*/}}
{{- define "gitea.gitea.fullname" -}}
{{- printf "%s-%s" .Release.Name "gitea" | trunc 63 | trimSuffix "-" -}}
{{- end -}}

{{/*
Create a default fully qualified postgresql name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
*/}}
{{- define "gitea.postgresql.fullname" -}}
{{- $name := default "postgresql" .Values.postgresql.nameOverride -}}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
{{- end -}}

{{/*
Determine database user based on use of postgresql dependency.
*/}}
{{- define "gitea.database.host" -}}
{{- if .Values.postgresql.install -}}
{{- template "gitea.postgresql.fullname" . -}}
{{- else -}}
{{- .Values.service.gitea.databaseHost | quote -}}
{{- end -}}
{{- end -}}

{{/*
Determine database user based on use of postgresql dependency.
*/}}
{{- define "gitea.database.user" -}}
{{- if .Values.postgresql.install -}}
{{- .Values.postgresql.postgresUser | quote -}}
{{- else -}}
{{- .Values.service.gitea.databaseUser | quote -}}
{{- end -}}
{{- end -}}

{{/*
Determine database password based on use of postgresql dependency.
*/}}
{{- define "gitea.database.password" -}}
{{- if .Values.postgresql.install -}}
{{- .Values.postgresql.postgresPassword | quote -}}
{{- else -}}
{{- .Values.service.gitea.databasePassword | quote -}}
{{- end -}}
{{- end -}}

{{/*
Determine database name based on use of postgresql dependency.
*/}}
{{- define "gitea.database.name" -}}
{{- if .Values.postgresql.install -}}
{{- .Values.postgresql.postgresDatabase | quote -}}
{{- else -}}
{{- .Values.service.gitea.databaseName | quote -}}
{{- end -}}
{{- end -}}
78 changes: 78 additions & 0 deletions incubator/gitea/templates/configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
kind: ConfigMap
apiVersion: v1
metadata:
name: {{ template "gitea.gitea.fullname" . }}-config
labels:
app: {{ template "gitea.name" . }}
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
component: {{ default "gitea" .Values.service.nameOverride }}
data:
2222: default/{{ template "gitea.fullname" . }}:ssh
app.ini: |-
APP_NAME = {{ .Values.service.gitea.appName }}
RUN_MODE = {{ .Values.service.gitea.runMode }}

[repository.upload]
ENABLED = {{ .Values.service.gitea.repositoryUploadEnabled }}
ALLOWED_TYPES = {{ .Values.service.gitea.repositoryUploadAllowedTypes }}
MAX_FILE_SIZE = {{ .Values.service.gitea.repositoryUploadMaxFileSize }}
MAX_FILES = {{ .Values.service.gitea.repositoryUploadMaxFiles }}

[server]
PROTOCOL = http
DOMAIN = {{ .Values.service.gitea.serverDomain }}
ROOT_URL = {{ .Values.service.gitea.serverRootUrl }}
LANDING_PAGE = {{ .Values.service.gitea.serverLandingPage }}
SSH_DOMAIN = {{ default .Values.service.gitea.serverDomain .Values.service.sshDomain }}
SSH_PORT = {{ .Values.service.sshPort }}
SSH_LISTEN_PORT = {{ .Values.service.sshPort }}

[service]
ENABLE_CAPTCHA = {{ .Values.service.gitea.serviceEnableCaptcha }}
ACTIVE_CODE_LIVE_MINUTES = 180
RESET_PASSWD_CODE_LIVE_MINUTES = 180
REGISTER_EMAIL_CONFIRM = {{ .Values.service.gitea.serviceRegisterEmailConfirm }}
DISABLE_REGISTRATION = {{ .Values.service.gitea.serviceDisableRegistration }}
REQUIRE_SIGNIN_VIEW = {{ .Values.service.gitea.serviceRequireSignInView }}
ENABLE_NOTIFY_MAIL = {{ .Values.service.gitea.serviceEnableNotifyMail }}
ENABLE_REVERSE_PROXY_AUTHENTICATION = false
ENABLE_REVERSE_PROXY_AUTO_REGISTRATION = false

[database]
DB_TYPE = {{ .Values.service.gitea.databaseType | quote }}
HOST = {{ template "gitea.database.host" . }}
NAME = {{ template "gitea.database.name" . }}
USER = {{ template "gitea.database.user" . }}
PASSWD = {{ template "gitea.database.password" . }}
SSL_MODE = {{ .Values.service.gitea.databaseSSLMode }}

[security]
INSTALL_LOCK = true
SECRET_KEY = {{ default "" .Values.service.gitea.securitySecretKey | b64enc | quote }}

[ui]
EXPLORE_PAGING_NUM = {{ .Values.service.gitea.uiExplorePagingNum }}
ISSUE_PAGING_NUM = {{ .Values.service.gitea.uiIssuePagingNum }}
FEED_MAX_COMMIT_NUM = {{ .Values.service.gitea.uiFeedMaxCommitNum }}

[cache]
ADAPTER = {{ .Values.service.gitea.cacheAdapter }}
INTERVAL = {{ .Values.service.gitea.cacheInterval }}
HOST = {{ .Values.service.gitea.cacheHost }}

[webhook]
QUEUE_LENGTH = {{ .Values.service.gitea.webhookQueueLength }}
DELIVER_TIMEOUT = {{ .Values.service.gitea.webhookDeliverTimeout }}
SKIP_TLS_VERIFY = {{ .Values.service.gitea.webhookSkipTlsVerify }}
PAGING_NUM = {{ .Values.service.gitea.webhookPagingNum }}

[log]
MODE = {{ .Values.service.gitea.logMode }}
LEVEL = {{ .Values.service.gitea.logLevel }}

[other]
SHOW_FOOTER_BRANDING = {{ .Values.service.gitea.otherShowFooterBranding }}
SHOW_FOOTER_VERSION = {{ .Values.service.gitea.otherShowFooterVersion }}
SHOW_FOOTER_TEMPLATE_LOAD_TIME = {{ .Values.service.gitea.otherShowFooterTemplateLoadTime }}
69 changes: 69 additions & 0 deletions incubator/gitea/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
apiVersion: apps/v1beta1
kind: Deployment
metadata:
name: {{ template "gitea.gitea.fullname" . }}
labels:
app: {{ template "gitea.name" . }}
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
component: {{ default "gitea" .Values.service.nameOverride }}
spec:
replicas: 1
strategy:
type: RollingUpdate
selector:
matchLabels:
app: {{ template "gitea.fullname" . }}
template:
metadata:
labels:
app: {{ template "gitea.fullname" . }}
release: {{ .Release.Name }}
spec:
containers:
- name: {{ .Chart.Name }}
image: "{{ .Values.image }}:{{ .Values.imageTag }}"
imagePullPolicy: {{ .Values.imagePullPolicy }}
ports:
- containerPort: 3000
- containerPort: {{ .Values.service.sshPort | int }}
livenessProbe:
httpGet:
path: /
port: 3000
# This pod takes a very long time to start up. Be cautious when
# lowering this value to avoid Pod death during startup.
initialDelaySeconds: 200
timeoutSeconds: 1
periodSeconds: 10
successThreshold: 1
failureThreshold: 10
readinessProbe:
httpGet:
path: /
port: 3000
initialDelaySeconds: 30
timeoutSeconds: 1
periodSeconds: 10
successThreshold: 1
failureThreshold: 3
resources:
{{ toYaml .Values.resources | indent 12 }}
volumeMounts:
- name: data
mountPath: /data
- name: config
mountPath: /data/gitea/conf/app.ini
subPath: app.ini
volumes:
- name: config
configMap:
name: {{ template "gitea.fullname" . }}-config
- name: data
{{- if .Values.persistence.enabled }}
persistentVolumeClaim:
claimName: {{ template "gitea.fullname" . }}
{{- else }}
emptyDir: {}
{{- end -}}
Loading