Skip to content

Commit

Permalink
edusharing-crawler
Browse files Browse the repository at this point in the history
  • Loading branch information
oeh-search-etl-gha committed Dec 2, 2022
1 parent 8b328e6 commit 6e45013
Show file tree
Hide file tree
Showing 5 changed files with 152 additions and 0 deletions.
23 changes: 23 additions & 0 deletions automation/edusharing-crawler/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# 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/
6 changes: 6 additions & 0 deletions automation/edusharing-crawler/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
apiVersion: v1
appVersion: 0.1.0
description: A Helm chart for Kubernetes
name: edusharing-crawler
type: application
version: 0.0.01
52 changes: 52 additions & 0 deletions automation/edusharing-crawler/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "edusharing-crawler.name" -}}
{{- default .Release.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 "edusharing-crawler.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 "edusharing-crawler.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Common labels
*/}}
{{- define "edusharing-crawler.labels" -}}
helm.sh/chart: {{ include "edusharing-crawler.chart" . }}
{{ include "edusharing-crawler.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}

{{/*
Selector labels
*/}}
{{- define "edusharing-crawler.selectorLabels" -}}
app.kubernetes.io/name: {{ include "edusharing-crawler.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}

31 changes: 31 additions & 0 deletions automation/edusharing-crawler/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{{- $env := $.Values.env }}
{{- if .env }}
{{- $env = concat $env .env }}
{{- end }}
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "edusharing-crawler.name" . }}
labels:
{{- include "edusharing-crawler.labels" . | nindent 4 }}
spec:
replicas: {{ .Values.replicaCount }}
selector:
matchLabels:
{{- include "edusharing-crawler.selectorLabels" . | nindent 6 }}
template:
metadata:
labels:
{{- include "edusharing-crawler.selectorLabels" . | nindent 8 }}
spec:
containers:
- name: {{ include "edusharing-crawler.name" . }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
resources:
{{- toYaml .Values.resources | nindent 12 }}
{{- with $env }}
env:
{{- toYaml . | nindent 16 }}
{{- end }}
40 changes: 40 additions & 0 deletions automation/edusharing-crawler/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
image:
repository: ghcr.io/hpi-schul-cloud/oeh-search-etl
pullPolicy: IfNotPresent
# -- Overrides the image tag whose default is the chart appVersion.
# Tag anpassen
tag: "0.0.8"

nameOverride: ""
fullnameOverride: ""

resources: {}
# limits:
# cpu: 1000m
# memory: 1024Mi
# requests:
# cpu: 500m
# memory: 512Mi

# envs depend on crawler, only CRAWLER and SCHEDULE are always required
env:
- name: CRAWLER
value: hello_world
- name: SCHEDULE
value: "*-*-13:30"
# - name: EDU_SHARING_BASE_URL
# valueFrom:
# secretKeyRef:
# name: edusharing-secret
# key: url
# - name: EDU_SHARING_USERNAME
# valueFrom:
# secretKeyRef:
# name: edusharing-secret
# key: username
# - name: edu-sharing-password
# valueFrom:
# secretKeyRef:
# name: edusharing-secret
# key: password

0 comments on commit 6e45013

Please sign in to comment.