Skip to content

Commit ef133e1

Browse files
author
noah
committed
Init chart
0 parents  commit ef133e1

File tree

15 files changed

+534
-0
lines changed

15 files changed

+534
-0
lines changed

.github/workflows/deploy.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: release
2+
on:
3+
push:
4+
tags: '*'
5+
6+
jobs:
7+
release:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v2
11+
- name: Publish Helm charts
12+
uses: stefanprodan/helm-gh-pages@master
13+
with:
14+
token: ${{ secrets.DEPLOY_TOKEN }}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
values.*yml

LICENSE

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
BSD 3-Clause License
2+
3+
Copyright (c) 2021, Gitploy
4+
All rights reserved.
5+
6+
Redistribution and use in source and binary forms, with or without
7+
modification, are permitted provided that the following conditions are met:
8+
9+
1. Redistributions of source code must retain the above copyright notice, this
10+
list of conditions and the following disclaimer.
11+
12+
2. Redistributions in binary form must reproduce the above copyright notice,
13+
this list of conditions and the following disclaimer in the documentation
14+
and/or other materials provided with the distribution.
15+
16+
3. Neither the name of the copyright holder nor the names of its
17+
contributors may be used to endorse or promote products derived from
18+
this software without specific prior written permission.
19+
20+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
23+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
24+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
26+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
27+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
28+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

README.md

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# Gitploy Helm Charts
2+
3+
This repository hosts official Helm charts for Gitploy. These charts are used to deploy Gitploy to Kubernetes.
4+
5+
## Install Helm
6+
7+
Read and follow the Helm installation guide.
8+
9+
## Add the Gtiploy Helm Chart repo
10+
11+
In order to be able to use the charts in this repository, add the name and URL to your Helm client:
12+
13+
```console
14+
$ helm repo add gitployio https://gitploy.io/helm-charts/
15+
$ helm repo update
16+
```
17+
18+
## Installing Gitploy
19+
20+
See the [Gitploy Installation](./docs/install.md).
21+
22+
## Configuring Gitploy
23+
24+
See [values.yaml](./charts/gitploy/values.yaml) to see the Chart's default values.
25+
26+
To adjust an existing Gitploy install's configuration:
27+
28+
```console
29+
# If you have a values file:
30+
$ helm upgrade gitploy gitployio/gitploy --namespace gitploy --values values.overrides.yaml
31+
# If you want to change one value and don't have a values file:
32+
$ helm upgrade gitploy gitployio/gitploy --namespace gitploy --reuse-values --set someKey=someVal
33+
```
34+
35+
## Upgrading Gitploy
36+
37+
Read the release notes to make sure there are no backwards incompatible changes. Make adjustments to your values as needed, then run `helm upgrade`.
38+
39+
40+
```console
41+
# This pulls the latest version of the gitploy chart from the repo.
42+
$ helm repo update
43+
$ helm upgrade gitploy gitployio/gitploy --namespace gitploy --values values.overrides.yaml
44+
```
45+
46+
## Uninstalling Gitploy
47+
48+
To uninstall/delete the `gitploy` deployment in the `gitploy` namespace:
49+
50+
```console
51+
$ helm delete gitploy --namespace gitploy
52+
```
53+
54+
## Documentation
55+
56+
See the Gitploy documentation site for more information.
57+
58+
## License
59+
60+
BSD 3-Clause License

charts/gitploy/.helmignore

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Patterns to ignore when building packages.
2+
# This supports shell glob matching, relative path matching, and
3+
# negation (prefixed with !). Only one pattern per line.
4+
.DS_Store
5+
# Common VCS dirs
6+
.git/
7+
.gitignore
8+
.bzr/
9+
.bzrignore
10+
.hg/
11+
.hgignore
12+
.svn/
13+
# Common backup files
14+
*.swp
15+
*.bak
16+
*.tmp
17+
*~
18+
# Various IDEs
19+
.project
20+
.idea/
21+
*.tmproj
22+
.vscode/

charts/gitploy/Chart.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
apiVersion: v1
2+
appVersion: "0.1.0"
3+
description: A Helm chart for Gitploy
4+
name: gitploy
5+
version: 0.1.0

charts/gitploy/templates/NOTES.txt

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
1. Get the application URL by running these commands:
2+
{{- if .Values.ingress.enabled }}
3+
{{- range $host := .Values.ingress.hosts }}
4+
{{- range .paths }}
5+
http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ . }}
6+
{{- end }}
7+
{{- end }}
8+
{{- else if contains "NodePort" .Values.service.type }}
9+
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "gitploy.fullname" . }})
10+
export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
11+
echo http://$NODE_IP:$NODE_PORT
12+
{{- else if contains "LoadBalancer" .Values.service.type }}
13+
NOTE: It may take a few minutes for the LoadBalancer IP to be available.
14+
You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "gitploy.fullname" . }}'
15+
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "gitploy.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}")
16+
echo http://$SERVICE_IP:{{ .Values.service.port }}
17+
{{- else if contains "ClusterIP" .Values.service.type }}
18+
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "gitploy.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
19+
echo "Visit http://127.0.0.1:8080 to use your application"
20+
kubectl port-forward $POD_NAME 8080:80
21+
{{- end }}

charts/gitploy/templates/_helpers.tpl

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
{{/* vim: set filetype=mustache: */}}
2+
{{/*
3+
Expand the name of the chart.
4+
*/}}
5+
{{- define "gitploy.name" -}}
6+
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
7+
{{- end -}}
8+
9+
{{/*
10+
Create a default fully qualified app name.
11+
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
12+
If release name contains chart name it will be used as a full name.
13+
*/}}
14+
{{- define "gitploy.fullname" -}}
15+
{{- if .Values.fullnameOverride -}}
16+
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}}
17+
{{- else -}}
18+
{{- $name := default .Chart.Name .Values.nameOverride -}}
19+
{{- if contains $name .Release.Name -}}
20+
{{- .Release.Name | trunc 63 | trimSuffix "-" -}}
21+
{{- else -}}
22+
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
23+
{{- end -}}
24+
{{- end -}}
25+
{{- end -}}
26+
27+
{{/*
28+
Create chart name and version as used by the chart label.
29+
*/}}
30+
{{- define "gitploy.chart" -}}
31+
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
32+
{{- end -}}
33+
34+
{{/*
35+
Common labels
36+
*/}}
37+
{{- define "gitploy.labels" -}}
38+
app.kubernetes.io/name: {{ include "gitploy.name" . }}
39+
helm.sh/chart: {{ include "gitploy.chart" . }}
40+
app.kubernetes.io/instance: {{ .Release.Name }}
41+
{{- if .Chart.AppVersion }}
42+
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
43+
{{- end }}
44+
app.kubernetes.io/managed-by: {{ .Release.Service }}
45+
{{- end -}}
46+
47+
{{/*
48+
Create the name of the service account to use
49+
*/}}
50+
{{- define "gitploy.serviceAccountName" -}}
51+
{{- if .Values.serviceAccount.create -}}
52+
{{ default (include "gitploy.fullname" .) .Values.serviceAccount.name }}
53+
{{- else -}}
54+
{{ default "default" .Values.serviceAccount.name }}
55+
{{- end -}}
56+
{{- end -}}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
kind: ConfigMap
2+
apiVersion: v1
3+
metadata:
4+
name: {{ include "gitploy.fullname" . }}
5+
labels:
6+
{{ include "gitploy.labels" . | indent 4 }}
7+
data:
8+
{{- range $envKey, $envVal := .Values.env }}
9+
{{ $envKey | upper }}: {{ $envVal | quote }}
10+
{{- end }}
11+
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
name: {{ include "gitploy.fullname" . }}
5+
labels:
6+
{{ include "gitploy.labels" . | indent 4 }}
7+
spec:
8+
replicas: {{ .Values.replicaCount }}
9+
selector:
10+
matchLabels:
11+
app.kubernetes.io/name: {{ include "gitploy.name" . }}
12+
app.kubernetes.io/instance: {{ .Release.Name }}
13+
template:
14+
metadata:
15+
labels:
16+
app.kubernetes.io/name: {{ include "gitploy.name" . }}
17+
app.kubernetes.io/instance: {{ .Release.Name }}
18+
spec:
19+
{{- with .Values.imagePullSecrets }}
20+
imagePullSecrets:
21+
{{- toYaml . | nindent 8 }}
22+
{{- end }}
23+
containers:
24+
- name: {{ .Chart.Name }}
25+
securityContext:
26+
{{- toYaml .Values.podSecurityContext | nindent 12 }}
27+
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
28+
imagePullPolicy: {{ .Values.image.pullPolicy }}
29+
ports:
30+
- name: http
31+
containerPort: 8080
32+
protocol: TCP
33+
livenessProbe:
34+
httpGet:
35+
path: /healthz
36+
port: http
37+
resources:
38+
{{- toYaml .Values.resources | nindent 12 }}
39+
envFrom:
40+
- configMapRef:
41+
name: {{ include "gitploy.fullname" . }}
42+
{{- range .Values.extraSecretNamesForEnvFrom }}
43+
- secretRef:
44+
name: {{ . }}
45+
{{- end }}
46+
volumeMounts:
47+
- name: storage-volume
48+
mountPath: {{ .Values.persistentVolume.mountPath }}
49+
subPath: "{{ .Values.persistentVolume.subPath }}"
50+
{{- with .Values.nodeSelector }}
51+
nodeSelector:
52+
{{- toYaml . | nindent 8 }}
53+
{{- end }}
54+
{{- with .Values.affinity }}
55+
affinity:
56+
{{- toYaml . | nindent 8 }}
57+
{{- end }}
58+
{{- with .Values.tolerations }}
59+
tolerations:
60+
{{- toYaml . | nindent 8 }}
61+
{{- end }}
62+
volumes:
63+
- name: storage-volume
64+
{{- if .Values.persistentVolume.enabled }}
65+
persistentVolumeClaim:
66+
claimName: {{ if .Values.persistentVolume.existingClaim }}{{ .Values.persistentVolume.existingClaim }}{{- else }}{{ template "gitploy.fullname" . }}{{- end }}
67+
{{- else }}
68+
emptyDir:
69+
{{- if .Values.emptyDir.sizeLimit }}
70+
sizeLimit: {{ .Values.emptyDir.sizeLimit }}
71+
{{- else }}
72+
{}
73+
{{- end -}}
74+
{{- end -}}

0 commit comments

Comments
 (0)