Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • justJanne/helm
1 result
Show changes
Commits on Source (2)
......@@ -7,6 +7,7 @@ stages:
- lint
- release
include:
- /amp/pipeline.yml
- /fdroid-repo/pipeline.yml
- /flood/pipeline.yml
- /imghost/pipeline.yml
......
apiVersion: v2
name: amp
description: Helm Chart for amp
type: application
version: 0.1.0
appVersion: "latest"
lint-amp:
stage: lint
rules:
- changes:
- amp/**/*
script:
- helm lint amp
release-amp:
stage: release
needs:
- lint-amp
rules:
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
changes:
- amp/**/*
script:
- apk add --no-cache git
- helm plugin install https://github.com/chartmuseum/helm-push.git
- helm repo add --username gitlab-ci-token --password $CI_JOB_TOKEN repo ${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/helm/stable
- helm cm-push amp repo
{{/*
Expand the name of the chart.
*/}}
{{- define "amp-helm.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).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "amp-helm.fullname" -}}
{{- if .Values.fullnameOverride }}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- $name := default .Chart.Name .Values.nameOverride }}
{{- if contains $name .Release.Name }}
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
{{- end }}
{{- end }}
{{- end }}
{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "amp-helm.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}
{{/*
Common labels
*/}}
{{- define "amp-helm.labels" -}}
helm.sh/chart: {{ include "amp-helm.chart" . }}
{{ include "amp-helm.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}
{{/*
Selector labels
*/}}
{{- define "amp-helm.selectorLabels" -}}
app.kubernetes.io/name: {{ include "amp-helm.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}
{{- define "amp-helm.sslPath" -}}
/certs
{{- end }}
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "amp-helm.fullname" . }}
labels:
{{- include "amp-helm.labels" . | nindent 4 }}
spec:
replicas: {{ .Values.replicaCount }}
selector:
matchLabels:
{{- include "amp-helm.selectorLabels" . | nindent 6 }}
template:
metadata:
{{- with .Values.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "amp-helm.selectorLabels" . | nindent 8 }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
volumes:
- name: data
{{- .Values.volume | nindent 10 }}
- name: tmp
emptyDir: {}
containers:
- name: {{ .Chart.Name }}
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
env:
- name: "AMP_LICENCE"
valueFrom:
secretKeyRef:
key: "license"
name: {{ include "amp-helm.fullname" . }}
- name: "USERNAME"
valueFrom:
secretKeyRef:
key: "admin-user"
name: {{ include "amp-helm.fullname" . }}
- name: "PASSWORD"
valueFrom:
secretKeyRef:
key: "admin-pass"
name: {{ include "amp-helm.fullname" . }}
ports:
- name: sftp
containerPort: 2224
protocol: TCP
- name: http
containerPort: 8080
protocol: TCP
{{- range .Values.gamePorts }}
- name: {{ .name }}
containerPort: {{ .port }}
protocol: {{ .protocol }}
{{- end }}
startupProbe:
httpGet:
path: "/API"
port: http
failureThreshold: 60
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 1
livenessProbe:
httpGet:
path: "/API"
port: http
initialDelaySeconds: 3
periodSeconds: 3
successThreshold: 1
timeoutSeconds: 1
readinessProbe:
httpGet:
path: "/API"
port: http
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 1
resources:
{{- toYaml .Values.resources | nindent 12 }}
volumeMounts:
- mountPath: "/home/amp/.ampdata"
name: data
- mountPath: "/tmp"
name: tmp
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ include "amp-helm.fullname" . }}
labels:
{{- include "amp-helm.labels" . | nindent 4 }}
annotations:
{{- .Values.ingress.annotations | toYaml | nindent 4 }}
spec:
rules:
- host: "{{ .Values.ingress.host }}"
http:
paths:
- path: "{{ .Values.ingress.path }}"
backend:
service:
name: {{ include "amp-helm.fullname" . }}
port:
name: http
pathType: Prefix
apiVersion: v1
kind: Secret
metadata:
name: {{ include "amp-helm.fullname" . }}
labels:
{{- include "amp-helm.labels" . | nindent 4 }}
type: Opaque
stringData:
admin-pass: "{{ .Values.config.admin.pass }}"
admin-user: "{{ .Values.config.admin.user }}"
license: "{{ .Values.config.license }}"
apiVersion: v1
kind: Service
metadata:
name: {{ include "amp-helm.fullname" . }}
labels:
{{- include "amp-helm.labels" . | nindent 4 }}
spec:
type: {{ .Values.service.type }}
ports:
- name: sftp
port: 2224
protocol: TCP
targetPort: sftp
- name: http
port: 8080
protocol: TCP
targetPort: http
{{- range .Values.gamePorts }}
- name: {{ .name }}
port: {{ .port}}
targetPort: {{ .name }}
protocol: {{ .protocol }}
{{- end }}
selector:
{{- include "amp-helm.selectorLabels" . | nindent 4 }}
replicaCount: 1
image:
repository: mitchtalmadge/amp-dockerized
pullPolicy: IfNotPresent
tag: ""
imagePullSecrets: [ ]
nameOverride: ""
fullnameOverride: ""
config:
admin:
user: ""
pass: ""
license: ""
service:
type: ClusterIP
ingress:
host: "example.com"
path: "/"
annotations: {}
gamePorts: []
volume: |-
emptyDir: {}
podAnnotations: { }
podSecurityContext: { }
securityContext: { }
# capabilities:
# drop:
# - ALL
# runAsNonRoot: true
# runAsUser: 1000
resources:
limits:
cpu: 4
ephemeral-storage: 16Gi
memory: 16Gi
requests:
cpu: 2
ephemeral-storage: 4Gi
memory: 4Gi
nodeSelector: { }
tolerations: [ ]
affinity: { }
......@@ -2,5 +2,5 @@ apiVersion: v2
name: mastodon
description: Helm Chart for mastodon
type: application
version: 0.4.2
appVersion: "v4.1"
version: 0.5.0
appVersion: "v4.2"
......@@ -6,7 +6,7 @@ metadata:
component: tootctl
{{- include "mastodon-helm.labels" . | nindent 4 }}
spec:
replicas: {{ .Values.replicaCount }}
replicas: 1
selector:
matchLabels:
component: tootctl
......