EOX GitLab Instance

Commit 67f1c6aa authored by Nikola Jankovic's avatar Nikola Jankovic 💻
Browse files

added chart for tests

parent cfe8e111
Pipeline #17473 passed with stages
in 2 minutes and 46 seconds
stages:
- test
- deploy
- chart
variables:
DOCKER_TLS_CERTDIR: ""
......@@ -36,3 +37,14 @@ deploy:
- docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME
only:
- tags
helm:
image: devth/helm:v3.6.3
stage: chart
script:
# push Helm chart
- "upload_filename=$(helm package ./chart | sed 's/^Successfully packaged chart and saved it to: \\(.*\\)/\\1/')"
- curl -u $HELM_CHART_REPOSITORY_CREDENTIALS -v -X POST https://charts-public.hub.eox.at/api/charts --data-binary "@${upload_filename}"
only:
- tags
- master
# 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
*.orig
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/
apiVersion: v2
name: vs-scheduler
description: A Helm chart for the View server scheduler
# A chart can be either an 'application' or a 'library' chart.
#
# Application charts are a collection of templates that can be packaged into versioned archives
# to be deployed.
#
# Library charts provide useful utilities or functions for the chart developer. They're included as
# a dependency of application charts to inject those utilities and functions into the rendering
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.1.0
# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "2.0.0"
{{- toYaml .Values.config | nindent 2 -}}
{{/*
Expand the name of the chart.
*/}}
{{- define "vs-scheduler.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 "vs-scheduler.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 "vs-scheduler.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}
{{/*
Common labels
*/}}
{{- define "vs-scheduler.labels" -}}
helm.sh/chart: {{ include "vs-scheduler.chart" . }}
{{ include "vs-scheduler.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}
{{/*
Selector labels
*/}}
{{- define "vs-scheduler.selectorLabels" -}}
app.kubernetes.io/name: {{ include "vs-scheduler.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}
{{/*
Create the name of the service account to use
*/}}
{{- define "vs-scheduler.serviceAccountName" -}}
{{- if .Values.serviceAccount.create }}
{{- default (include "vs-scheduler.fullname" .) .Values.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "cache.fullname" . }}-scheduler-config
data:
{{ (tpl (.Files.Glob "files/scheduler-config.yaml").AsConfig . ) | nindent 2}}
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "vs-cache.fullname" . }}-scheduler
labels:
{{- include "vs-cache.labels" . | nindent 4 }}
app.kubernetes.io/service: scheduler
spec:
replicas: {{ .Values.kubeConfig.scheduler.replicaCount }}
selector:
matchLabels:
{{- include "vs-cache.selectorLabels" . | nindent 6 }}
app.kubernetes.io/service: scheduler
strategy:
rollingUpdate:
maxUnavailable: 0
type: RollingUpdate
template:
metadata:
annotations:
prometheus.io/scrape: "false"
labels:
{{- include "vs-cache.selectorLabels" . | nindent 8 }}
app.kubernetes.io/service: scheduler
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
containers:
- name: {{ .Chart.Name }}-scheduler
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy | default "IfNotPresent" }}
resources:
{{- toYaml .Values.resources | nindent 12 }}
args:
- /opt/scheduler/run-scheduler.sh
env:
{{- range $key, $value := .Values.envVar.general }}
- name: {{ $key }}
value: {{ $value | quote }}
{{- end }}
{{- range $key, $value := .Values.envVar.redis }}
- name: {{ $key }}
value: {{ $value | quote }}
{{- end }}
- name: REDIS_HOST
value: {{ .Release.Name }}-redis-master
volumeMounts:
- mountPath: /config.yaml
name: scheduler-config
subPath: scheduler-config.yaml
{{- range $volumes := .Values.volumeMounts }}
- {{- toYaml $volumes | nindent 16 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
volumes:
- configMap:
items:
- key: scheduler-config.yaml
path: scheduler-config.yaml
name: {{ include "vs-cache.fullname" . }}-scheduler-config
name: scheduler-config
{{- range $volumes := .Values.volumes }}
- {{- toYaml $volumes | nindent 12 }}
{{- end }}
# Default values for scheduler.
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.
replicaCount: 1
image:
repository: registry.gitlab.eox.at/vs/scheduler
pullPolicy: IfNotPresent
# Overrides the image tag whose default is the chart appVersion.
tag: ""
imagePullSecrets: []
nameOverride: ""
fullnameOverride: ""
serviceAccount:
# Specifies whether a service account should be created
create: true
# Annotations to add to the service account
annotations: {}
# The name of the service account to use.
# If not set and create is true, a name is generated using the fullname template
name: ""
podAnnotations: {}
config: {}
resources:
{}
# We usually recommend not to specify default resources and to leave this as a conscious
# choice for the user. This also increases chances charts run on environments with little
# resources, such as Minikube. If you do want to specify resources, uncomment the following
# lines, adjust them as necessary, and remove the curly braces after 'resources:'.
# limits:
# cpu: 100m
# memory: 128Mi
# requests:
# cpu: 100m
# memory: 128Mi
autoscaling:
enabled: false
minReplicas: 1
maxReplicas: 100
targetCPUUtilizationPercentage: 80
# targetMemoryUtilizationPercentage: 80
nodeSelector: {}
tolerations: []
affinity: {}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment