From 5e4ada2ef646a9c95a3521098b3933fb5226ec1e Mon Sep 17 00:00:00 2001 From: Arie <44765750+Eroyi@users.noreply.github.com> Date: Tue, 29 Oct 2024 12:16:55 +0800 Subject: [PATCH 01/16] upload helm chart Signed-off-by: Arie <44765750+Eroyi@users.noreply.github.com> Signed-off-by: root <44765750+Eroyi@users.noreply.github.com> --- kubernetes/helm-chart/Chart.yaml | 6 + .../helm-chart/charts/mordred/Chart.yaml | 5 + .../charts/mordred/templates/_helper.tpl | 36 +++ .../mordred/templates/_mordred_config.tpl | 156 +++++++++++ .../mordred/templates/_mordred_projects.tpl | 15 ++ .../charts/mordred/templates/deployment.yaml | 81 ++++++ .../charts/mordred/templates/pvc.yaml | 17 ++ .../charts/mordred/templates/service.yaml | 29 ++ .../helm-chart/charts/mordred/values.yaml | 37 +++ kubernetes/helm-chart/charts/nginx/Chart.yaml | 5 + .../charts/nginx/templates/_helper.tpl | 36 +++ .../charts/nginx/templates/_nginx-config.tpl | 61 +++++ .../charts/nginx/templates/deployment.yaml | 81 ++++++ .../charts/nginx/templates/service.yaml | 29 ++ .../helm-chart/charts/nginx/values.yaml | 47 ++++ .../charts/opensearch-dashboard/Chart.yaml | 5 + .../templates/_helper.tpl | 36 +++ .../templates/deployment.yaml | 81 ++++++ .../opensearch-dashboard/templates/pvc.yaml | 17 ++ .../templates/service.yaml | 29 ++ .../charts/opensearch-dashboard/values.yaml | 37 +++ .../charts/opensearch-node/Chart.yaml | 5 + .../opensearch-node/templates/_helper.tpl | 36 +++ .../opensearch-node/templates/deployment.yaml | 86 ++++++ .../charts/opensearch-node/templates/pvc.yaml | 17 ++ .../opensearch-node/templates/service.yaml | 29 ++ .../charts/opensearch-node/values.yaml | 47 ++++ .../charts/sortinghat-worker/Chart.yaml | 5 + .../sortinghat-worker/templates/_helper.tpl | 36 +++ .../templates/deployment.yaml | 81 ++++++ .../sortinghat-worker/templates/pvc.yaml | 17 ++ .../sortinghat-worker/templates/service.yaml | 29 ++ .../charts/sortinghat-worker/values.yaml | 37 +++ .../helm-chart/charts/sortinghat/Chart.yaml | 5 + .../charts/sortinghat/templates/_helper.tpl | 36 +++ .../sortinghat/templates/deployment.yaml | 81 ++++++ .../charts/sortinghat/templates/pvc.yaml | 17 ++ .../charts/sortinghat/templates/service.yaml | 29 ++ .../helm-chart/charts/sortinghat/values.yaml | 42 +++ kubernetes/helm-chart/templates/_image.tpl | 10 + .../helm-chart/templates/configmap.yaml | 16 ++ kubernetes/helm-chart/values.yaml | 250 ++++++++++++++++++ 42 files changed, 1757 insertions(+) create mode 100644 kubernetes/helm-chart/Chart.yaml create mode 100644 kubernetes/helm-chart/charts/mordred/Chart.yaml create mode 100644 kubernetes/helm-chart/charts/mordred/templates/_helper.tpl create mode 100644 kubernetes/helm-chart/charts/mordred/templates/_mordred_config.tpl create mode 100644 kubernetes/helm-chart/charts/mordred/templates/_mordred_projects.tpl create mode 100644 kubernetes/helm-chart/charts/mordred/templates/deployment.yaml create mode 100644 kubernetes/helm-chart/charts/mordred/templates/pvc.yaml create mode 100644 kubernetes/helm-chart/charts/mordred/templates/service.yaml create mode 100644 kubernetes/helm-chart/charts/mordred/values.yaml create mode 100644 kubernetes/helm-chart/charts/nginx/Chart.yaml create mode 100644 kubernetes/helm-chart/charts/nginx/templates/_helper.tpl create mode 100644 kubernetes/helm-chart/charts/nginx/templates/_nginx-config.tpl create mode 100644 kubernetes/helm-chart/charts/nginx/templates/deployment.yaml create mode 100644 kubernetes/helm-chart/charts/nginx/templates/service.yaml create mode 100644 kubernetes/helm-chart/charts/nginx/values.yaml create mode 100644 kubernetes/helm-chart/charts/opensearch-dashboard/Chart.yaml create mode 100644 kubernetes/helm-chart/charts/opensearch-dashboard/templates/_helper.tpl create mode 100644 kubernetes/helm-chart/charts/opensearch-dashboard/templates/deployment.yaml create mode 100644 kubernetes/helm-chart/charts/opensearch-dashboard/templates/pvc.yaml create mode 100644 kubernetes/helm-chart/charts/opensearch-dashboard/templates/service.yaml create mode 100644 kubernetes/helm-chart/charts/opensearch-dashboard/values.yaml create mode 100644 kubernetes/helm-chart/charts/opensearch-node/Chart.yaml create mode 100644 kubernetes/helm-chart/charts/opensearch-node/templates/_helper.tpl create mode 100644 kubernetes/helm-chart/charts/opensearch-node/templates/deployment.yaml create mode 100644 kubernetes/helm-chart/charts/opensearch-node/templates/pvc.yaml create mode 100644 kubernetes/helm-chart/charts/opensearch-node/templates/service.yaml create mode 100644 kubernetes/helm-chart/charts/opensearch-node/values.yaml create mode 100644 kubernetes/helm-chart/charts/sortinghat-worker/Chart.yaml create mode 100644 kubernetes/helm-chart/charts/sortinghat-worker/templates/_helper.tpl create mode 100644 kubernetes/helm-chart/charts/sortinghat-worker/templates/deployment.yaml create mode 100644 kubernetes/helm-chart/charts/sortinghat-worker/templates/pvc.yaml create mode 100644 kubernetes/helm-chart/charts/sortinghat-worker/templates/service.yaml create mode 100644 kubernetes/helm-chart/charts/sortinghat-worker/values.yaml create mode 100644 kubernetes/helm-chart/charts/sortinghat/Chart.yaml create mode 100644 kubernetes/helm-chart/charts/sortinghat/templates/_helper.tpl create mode 100644 kubernetes/helm-chart/charts/sortinghat/templates/deployment.yaml create mode 100644 kubernetes/helm-chart/charts/sortinghat/templates/pvc.yaml create mode 100644 kubernetes/helm-chart/charts/sortinghat/templates/service.yaml create mode 100644 kubernetes/helm-chart/charts/sortinghat/values.yaml create mode 100644 kubernetes/helm-chart/templates/_image.tpl create mode 100644 kubernetes/helm-chart/templates/configmap.yaml create mode 100644 kubernetes/helm-chart/values.yaml diff --git a/kubernetes/helm-chart/Chart.yaml b/kubernetes/helm-chart/Chart.yaml new file mode 100644 index 00000000..a9923534 --- /dev/null +++ b/kubernetes/helm-chart/Chart.yaml @@ -0,0 +1,6 @@ +apiVersion: v2 +description: Nested Chart collection for all grimorelab services. +name: grimoirelab +type: application +version: 1.1.2 +appVersion: 1.2 \ No newline at end of file diff --git a/kubernetes/helm-chart/charts/mordred/Chart.yaml b/kubernetes/helm-chart/charts/mordred/Chart.yaml new file mode 100644 index 00000000..3a15bf2d --- /dev/null +++ b/kubernetes/helm-chart/charts/mordred/Chart.yaml @@ -0,0 +1,5 @@ +apiVersion: v2 +name: mordred +description: Mordred service for GrimoireLab +appVersion: 1.0 +version: 1.0 \ No newline at end of file diff --git a/kubernetes/helm-chart/charts/mordred/templates/_helper.tpl b/kubernetes/helm-chart/charts/mordred/templates/_helper.tpl new file mode 100644 index 00000000..686d5085 --- /dev/null +++ b/kubernetes/helm-chart/charts/mordred/templates/_helper.tpl @@ -0,0 +1,36 @@ +{{/* +Mordred labels +*/}} +{{- define "mordred-pod-labels" -}} +{{- range $name, $value := .Values.appConfiglabels }} +{{ $name }}: {{ $value | quote }} +{{- end -}} +{{- end -}} + +{{/* +Mordred annotations +*/}} +{{- define "mordred-pod-annotations" -}} +{{- range $name, $value := .Values.appConfig.annotations }} +{{ $name }}: {{ $value | quote }} +{{- end -}} +{{- end -}} + + +{{/* +Mordred Service labels +*/}} +{{- define "mordred-service-labels" -}} +{{- range $name, $value := .Values.service.labels }} +{{ $name }}: {{ $value | quote }} +{{- end -}} +{{- end -}} + +{{/* +Mordred Service annotations +*/}} +{{- define "mordred-service-annotations" -}} +{{- range $name, $value := .Values.service.annotations }} +{{ $name }}: {{ $value | quote }} +{{- end -}} +{{- end -}} \ No newline at end of file diff --git a/kubernetes/helm-chart/charts/mordred/templates/_mordred_config.tpl b/kubernetes/helm-chart/charts/mordred/templates/_mordred_config.tpl new file mode 100644 index 00000000..4a56b1f1 --- /dev/null +++ b/kubernetes/helm-chart/charts/mordred/templates/_mordred_config.tpl @@ -0,0 +1,156 @@ +{{/* + Mordred setup config +*/}} +{{- define "mordred-setup-config" -}} +[general] +short_name = GrimoireLab +update = true +min_update_delay = 60 +debug = false +logs_dir = /home/grimoire/logs +bulk_size = 100 +scroll_size = 100 +aliases_file = /home/grimoire/aliases.json + +[projects] +projects_file = /home/grimoire/conf/projects.json + +[es_collection] +url = https://admin:admin@opensearch-node:9200 + +[es_enrichment] +url = https://admin:admin@opensearch-node:9200 +autorefresh = true + +[sortinghat] +host = nginx +user = root +password = root +port = 8000 +path = /identities/api/ +ssl = false +database = sortinghat_db +autoprofile = [github, git] +matching = [email,name,username] +sleep_for = 100 +unaffiliated_group = Unknown +affiliate = true + +[panels] +kibiter_time_from = +kibiter_default_index = +kibiter_url = +kibiter_version = + +[phases] +collection = true +identities = true +enrichment = true +panels = false + +#[bugzillarest] +#raw_index = bugzillarest_demo_raw +#enriched_index = bugzillarest_demo_enriched +#no-archive = true + +#[confluence] +#no-archive = true +#raw_index = confluence_demo_raw +#enriched_index = confluence_demo_enriched + +#[discourse] +#raw_index = discourse_demo_raw +#enriched_index = discourse_demo_enriched +#no-archive = true + +[git] +raw_index = git_demo_raw +enriched_index = git_demo_enriched +latest-items = true +studies = [enrich_demography:git, enrich_areas_of_code:git, enrich_onion:git] + +#[github] +#api-token = +#enterprise-url = +#raw_index = github_demo_raw +#sleep-for-rate = true +#sleep-time = "300" +#enriched_index = github_demo_enriched + +#[gitlab:issues] +#api-token = +#raw_index = gitlab_issues_demo_raw +#enriched_index = gitlab_issues_demo_enriched +#no-archive = true +#enterprise-url = +#sleep-for-rate = true + +#[gitlab:merge] +#api-token = +#raw_index = gitlab_merges_demo_raw +#enriched_index = gitlab_merges_demo_enriched +#no-archive = true +#enterprise-url = +#category = merge_request +#sleep-for-rate = true + +#[jira] +#raw_index = jira_demo_raw +#enriched_index = jira_demo_enriched +#no-archive = true + +#[pipermail] +#raw_index = pipermail_demo_raw +#enriched_index = pipermail_demo_enriched +#no-verify = true + +#[mediawiki] +#raw_index = mediawiki_demo_raw +#enriched_index = mediawiki_demo_enriched +#no-archive = true + +#[meetup] +#raw_index = meetup_demo_raw +#enriched_index = meetup_demo_enriched +#api-token = +#no-archive = true +#sleep-for-rate = true +#sleep-time = "300" + +#[stackexchange] +#raw_index = stackexchange_demo_raw +#enriched_index = stackexchange_demo_enriched +#api-token = +#no-archive = true + +#[slack] +#raw_index = slack_demo_raw +#enriched_index = slack_demo_enriched +#api-token = +#no-archive = true + +#[supybot] +#raw_index = supybot_demo_raw +#enriched_index = supybot_demo_enriched + +#[twitter] +#raw_index = twitter_demo_raw +#enriched_index = twitter_demo_enriched +#api-token = +#no-archive = true +#sleep-for-rate = true +#sleep-time = 300 + +## studies based on enriched indexes + +[enrich_demography:git] + +[enrich_areas_of_code:git] +in_index = git_demo_raw +out_index = git-aoc_demo_enriched + +[enrich_onion:git] +in_index = git +out_index = git-onion_demo_enriched +contribs_field = hash +{{- end }} \ No newline at end of file diff --git a/kubernetes/helm-chart/charts/mordred/templates/_mordred_projects.tpl b/kubernetes/helm-chart/charts/mordred/templates/_mordred_projects.tpl new file mode 100644 index 00000000..1fb036e8 --- /dev/null +++ b/kubernetes/helm-chart/charts/mordred/templates/_mordred_projects.tpl @@ -0,0 +1,15 @@ +{{/* + Mordred project config +*/}} +{{- define "mordred-project-config" -}} +{ + "grimoirelab": { + "meta": { + "title": "GrimoireLab" + }, + "git": [ + "https://github.com/chaoss/grimoirelab.git" + ] + } + } +{{- end }} \ No newline at end of file diff --git a/kubernetes/helm-chart/charts/mordred/templates/deployment.yaml b/kubernetes/helm-chart/charts/mordred/templates/deployment.yaml new file mode 100644 index 00000000..6295789c --- /dev/null +++ b/kubernetes/helm-chart/charts/mordred/templates/deployment.yaml @@ -0,0 +1,81 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: "{{ .Values.appConfig.name }}" + labels: + app: "{{ .Values.appConfig.name }}" + {{- include "mordred-pod-labels" . | nindent 4 }} + annotations: + {{- include "mordred-pod-annotations" . | nindent 4 }} + +spec: + replicas: {{ .Values.appConfig.replicas }} + selector: + matchLabels: + app: "{{ .Values.appConfig.name }}" + template: + metadata: + labels: + app: "{{ .Values.appConfig.name }}" + {{- include "mordred-pod-labels" . | nindent 8 }} + annotations: + {{- include "mordred-pod-annotations" . | nindent 8 }} + spec: + {{- with .Values.global.topologyConfig }} + {{- toYaml . | nindent 6 }} + {{- end }} + terminationGracePeriodSeconds: 10 + {{- with .Values.global.imagePullSecrets}} + imagePullSecrets: + {{- toYaml . | nindent 8}} + {{- end}} + containers: + - name: mordred + image: {{ .Values.appConfig.image }} + ports: + - containerPort: {{ .Values.service.targetPort }} + {{- if .Values.dependencies.storage.enabled }} + volumeMounts: + {{- range .Values.dependencies.storage.volumes }} + - name: {{ .name }} + mountPath: {{ .mountPath }} + {{- if and (eq .type "configmap") (hasKey . "subPath") .subPath }} + subPath: {{ .subPath }} + {{- end }} + {{- end }} + {{- end }} + resources: + limits: + cpu: {{ .Values.appConfig.resources.cpu.limits | quote }} + memory: {{ .Values.appConfig.resources.memory.limits | quote }} + requests: + cpu: {{ .Values.appConfig.resources.cpu.requests | quote }} + memory: {{ .Values.appConfig.resources.memory.requests | quote}} + env: + {{- with .Values.extraEnvs }} + {{- toYaml . | nindent 12 }} + {{- end }} + {{- if .Values.dependencies.storage.enabled }} + volumes: + {{- range .Values.dependencies.storage.volumes }} + - name: {{ .name }} + {{- if eq .type "pvc" }} + persistentVolumeClaim: + claimName: {{ .name }}-pvc + {{- else if eq .type "configmap" }} + configMap: + name: {{ $.Release.Name }}-configmap + {{- if and (hasKey . "configmapKey") (hasKey . "asFile" ) .confimapKey .asFile }} + items: + - key: {{ .configmapKey }} + path: {{ .asFile }} + {{- end }} + {{- else if eq .type "secret" }} + secret: + secretName: {{ .name }}-secret + {{- else }} + emptyDir: + sizeLimit: 100Mi + {{- end }} + {{- end }} + {{- end }} \ No newline at end of file diff --git a/kubernetes/helm-chart/charts/mordred/templates/pvc.yaml b/kubernetes/helm-chart/charts/mordred/templates/pvc.yaml new file mode 100644 index 00000000..da765b3b --- /dev/null +++ b/kubernetes/helm-chart/charts/mordred/templates/pvc.yaml @@ -0,0 +1,17 @@ +{{- range .Values.dependencies.storage.volumes }} + {{- if eq .type "pvc" }} +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: {{ .name }}-pvc + labels: + app: "{{ $.Release.Name }}" +spec: + storageClassName: "{{ .storageClass }}" + accessModes: + - ReadWriteMany + resources: + requests: + storage: {{ .size }} + {{- end }} +{{- end }} \ No newline at end of file diff --git a/kubernetes/helm-chart/charts/mordred/templates/service.yaml b/kubernetes/helm-chart/charts/mordred/templates/service.yaml new file mode 100644 index 00000000..39abf969 --- /dev/null +++ b/kubernetes/helm-chart/charts/mordred/templates/service.yaml @@ -0,0 +1,29 @@ +apiVersion: v1 +kind: Service +metadata: + name: "{{ .Values.appConfig.name }}" + labels: + app: "{{ .Values.appConfig.name }}" + {{- include "mordred-service-labels" . | nindent 4 }} + annotations: + {{- include "mordred-service-annotations" . | nindent 4 }} +spec: + ports: + - protocol: TCP + name: "{{ .Values.appConfig.name }}-service" + {{- if eq .Values.service.scheme "http" }} + port: 80 + targetPort: {{ .Values.service.targetPort }} + {{- end }} + {{- if eq .Values.service.scheme "https" }} + port: 443 + targetPort: {{ .Values.service.targetPort }} + {{- end }} + {{- if eq .Values.service.scheme "passthrough" }} + port: {{ .Values.service.targetPort }} + targetPort: {{ .Values.service.targetPort }} + {{- end }} + type: {{ .Values.service.type | default "ClusterIP" | quote }} + sessionAffinity: None + selector: + app: "{{ .Values.appConfig.name }}" \ No newline at end of file diff --git a/kubernetes/helm-chart/charts/mordred/values.yaml b/kubernetes/helm-chart/charts/mordred/values.yaml new file mode 100644 index 00000000..91971490 --- /dev/null +++ b/kubernetes/helm-chart/charts/mordred/values.yaml @@ -0,0 +1,37 @@ +global: + topologyConfig: {} + imagePullSecrets: [] + imageRegistry: "" + appName: "" + +enabled: true + +appConfig: + name: "mordred" + replicas: 1 + image: docker.io/grimoirelab/grimoirelab:latest + pullPolicy: "IfNotPresent" + metadata: {} + labels: {} + annotations: {} + resources: + cpu: + limits: "" + requests: "" + memory: + limits: "" + requests: "" + +dependencies: + storage: + enabled: false + volumes: [] + +service: + labels: {} + annotations: {} + targetPort: 8000 + scheme: "http" + type: "" # Default to "ClusterIP" + +extraEnvs: [] \ No newline at end of file diff --git a/kubernetes/helm-chart/charts/nginx/Chart.yaml b/kubernetes/helm-chart/charts/nginx/Chart.yaml new file mode 100644 index 00000000..aae0c16b --- /dev/null +++ b/kubernetes/helm-chart/charts/nginx/Chart.yaml @@ -0,0 +1,5 @@ +apiVersion: v2 +name: nginx +description: Nginx service for GrimoireLab +appVersion: 1.0 +version: 1.0 \ No newline at end of file diff --git a/kubernetes/helm-chart/charts/nginx/templates/_helper.tpl b/kubernetes/helm-chart/charts/nginx/templates/_helper.tpl new file mode 100644 index 00000000..4faa93d6 --- /dev/null +++ b/kubernetes/helm-chart/charts/nginx/templates/_helper.tpl @@ -0,0 +1,36 @@ +{/* +Mordred labels +*/}} +{{- define "nginx-pod-labels" -}} +{{- range $name, $value := .Values.appConfiglabels }} +{{ $name }}: {{ $value | quote }} +{{- end -}} +{{- end -}} + +{{/* +Mordred annotations +*/}} +{{- define "nginx-pod-annotations" -}} +{{- range $name, $value := .Values.appConfig.annotations }} +{{ $name }}: {{ $value | quote }} +{{- end -}} +{{- end -}} + + +{{/* +Mordred Service labels +*/}} +{{- define "nginx-service-labels" -}} +{{- range $name, $value := .Values.service.labels }} +{{ $name }}: {{ $value | quote }} +{{- end -}} +{{- end -}} + +{{/* +Mordred Service annotations +*/}} +{{- define "nginx-service-annotations" -}} +{{- range $name, $value := .Values.service.annotations }} +{{ $name }}: {{ $value | quote }} +{{- end -}} +{{- end -}} \ No newline at end of file diff --git a/kubernetes/helm-chart/charts/nginx/templates/_nginx-config.tpl b/kubernetes/helm-chart/charts/nginx/templates/_nginx-config.tpl new file mode 100644 index 00000000..cb8415ad --- /dev/null +++ b/kubernetes/helm-chart/charts/nginx/templates/_nginx-config.tpl @@ -0,0 +1,61 @@ +{{/* +uwsgi params config for nginx +*/}} +{{- define "uwsgi-params" -}} +uwsgi_param QUERY_STRING $query_string; +uwsgi_param REQUEST_METHOD $request_method; +uwsgi_param CONTENT_TYPE $content_type; +uwsgi_param CONTENT_LENGTH $content_length; +uwsgi_param REQUEST_URI $request_uri; +uwsgi_param PATH_INFO $document_uri; +uwsgi_param DOCUMENT_ROOT $document_root; +uwsgi_param SERVER_PROTOCOL $server_protocol; +uwsgi_param HTTPS $https if_not_empty; +uwsgi_param REMOTE_ADDR $remote_addr; +uwsgi_param REMOTE_PORT $remote_port; +uwsgi_param SERVER_PORT $server_port; +uwsgi_param SERVER_NAME $server_name; +{{- end }} + +{{/* +nginx config +*/}} +{{- define "nginx-conf-template" -}} +upstream sortinghat { + server sortinghat:9314; +} +server { + include mime.types; + sendfile on; + listen 8000; + + server_name localhost nginx; + + location / { + proxy_pass ${KIBANA_HOST}; + proxy_redirect ${KIBANA_HOST} /; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection 'upgrade'; + proxy_set_header Host $host; + proxy_cache_bypass $http_upgrade; + } + + location /identities { + rewrite ^/identities/(.*) /$1 break; + + include /etc/nginx/uwsgi_params; + uwsgi_pass sortinghat; + uwsgi_param Host $host; + uwsgi_param X-Real-IP $remote_addr; + uwsgi_param X-Forwarded-For $proxy_add_x_forwarded_for; + uwsgi_param X-Forwarded-Proto $http_x_forwarded_proto; + } + + location ~ ^/identities/(css|js|fonts)/ { + rewrite ^/identities/(.*) /$1 break; + + root /sortinghat; + } +} +{{- end }} \ No newline at end of file diff --git a/kubernetes/helm-chart/charts/nginx/templates/deployment.yaml b/kubernetes/helm-chart/charts/nginx/templates/deployment.yaml new file mode 100644 index 00000000..377bcba9 --- /dev/null +++ b/kubernetes/helm-chart/charts/nginx/templates/deployment.yaml @@ -0,0 +1,81 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: "{{ .Values.appConfig.name }}" + labels: + app: "{{ .Values.appConfig.name }}" + {{- include "nginx-pod-labels" . | nindent 4 }} + annotations: + {{- include "nginx-pod-annotations" . | nindent 4 }} + +spec: + replicas: {{ .Values.appConfig.replicas }} + selector: + matchLabels: + app: "{{ .Values.appConfig.name }}" + template: + metadata: + labels: + app: "{{ .Values.appConfig.name }}" + {{- include "nginx-pod-labels" . | nindent 8 }} + annotations: + {{- include "nginx-pod-annotations" . | nindent 8 }} + spec: + {{- with .Values.global.topologyConfig }} + {{- toYaml . | nindent 6 }} + {{- end }} + terminationGracePeriodSeconds: 10 + {{- with .Values.global.imagePullSecrets}} + imagePullSecrets: + {{- toYaml . | nindent 8}} + {{- end}} + containers: + - name: nginx + image: {{ .Values.appConfig.image }} + ports: + - containerPort: {{ .Values.service.targetPort }} + {{- if .Values.dependencies.storage.enabled }} + volumeMounts: + {{- range .Values.dependencies.storage.volumes }} + - name: {{ .name }} + mountPath: {{ .mountPath }} + {{- if and (eq .type "configmap") (hasKey . "subPath") .subPath }} + subPath: {{ .subPath }} + {{- end }} + {{- end }} + {{- end }} + resources: + limits: + cpu: {{ .Values.appConfig.resources.cpu.limits | quote }} + memory: {{ .Values.appConfig.resources.memory.limits | quote }} + requests: + cpu: {{ .Values.appConfig.resources.cpu.requests | quote }} + memory: {{ .Values.appConfig.resources.memory.requests | quote}} + env: + {{- with .Values.extraEnvs }} + {{- toYaml . | nindent 12 }} + {{- end }} + {{- if .Values.dependencies.storage.enabled }} + volumes: + {{- range .Values.dependencies.storage.volumes }} + - name: {{ .name }} + {{- if eq .type "pvc" }} + persistentVolumeClaim: + claimName: {{ .name }}-pvc + {{- else if eq .type "configmap" }} + configMap: + name: {{ $.Release.Name }}-configmap + {{- if and (hasKey . "configmapKey") (hasKey . "asFile" ) .confimapKey .asFile }} + items: + - key: {{ .configmapKey }} + path: {{ .asFile }} + {{- end }} + {{- else if eq .type "secret" }} + secret: + secretName: {{ .name }}-secret + {{- else }} + emptyDir: + sizeLimit: 100Mi + {{- end }} + {{- end }} + {{- end }} \ No newline at end of file diff --git a/kubernetes/helm-chart/charts/nginx/templates/service.yaml b/kubernetes/helm-chart/charts/nginx/templates/service.yaml new file mode 100644 index 00000000..09c5c547 --- /dev/null +++ b/kubernetes/helm-chart/charts/nginx/templates/service.yaml @@ -0,0 +1,29 @@ +apiVersion: v1 +kind: Service +metadata: + name: "{{ .Values.appConfig.name }}" + labels: + app: "{{ .Values.appConfig.name }}" + {{- include "nginx-service-labels" . | nindent 4 }} + annotations: + {{- include "nginx-service-annotations" . | nindent 4 }} +spec: + ports: + - protocol: TCP + name: "{{ .Values.appConfig.name }}-service" + {{- if eq .Values.service.scheme "http" }} + port: 80 + targetPort: {{ .Values.service.targetPort }} + {{- end }} + {{- if eq .Values.service.scheme "https" }} + port: 443 + targetPort: {{ .Values.service.targetPort }} + {{- end }} + {{- if eq .Values.service.scheme "passthrough" }} + port: {{ .Values.service.targetPort }} + targetPort: {{ .Values.service.targetPort }} + {{- end }} + type: {{ .Values.service.type | default "ClusterIP" | quote }} + sessionAffinity: None + selector: + app: "{{ .Values.appConfig.name }}" \ No newline at end of file diff --git a/kubernetes/helm-chart/charts/nginx/values.yaml b/kubernetes/helm-chart/charts/nginx/values.yaml new file mode 100644 index 00000000..37974ffa --- /dev/null +++ b/kubernetes/helm-chart/charts/nginx/values.yaml @@ -0,0 +1,47 @@ +global: + topologyConfig: {} + imagePullSecrets: [] + imageRegistry: "" + appName: "" + +enabled: true + +appConfig: + name: "nginx" + replicas: 1 + image: docker.io/nginx:latest + pullPolicy: IfNotPresent + metadata: {} + labels: {} + annotations: {} + resources: + cpu: + limits: "" + requests: "" + memory: + limits: "" + requests: "" + +dependencies: + storage: + enabled: true + volumes: + - name: "nginx-conf-template" + mountPath: "/etc/nginx/templates/default.conf.template" + type: configmap + subPath: "nginx-conf-template" + - name: "uwsgi-params" + mountPath: "/etc/nginx/uwsgi_params" + type: configmap + subPath: "uwsgi-params" + - name: "sortinghat-static" + mountPath: "/sortinghat" + type: pvc +service: + labels: {} + annotations: {} + targetPort: 8000 + scheme: "http" + type: "" # Default to "ClusterIP" + +extraEnvs: [] \ No newline at end of file diff --git a/kubernetes/helm-chart/charts/opensearch-dashboard/Chart.yaml b/kubernetes/helm-chart/charts/opensearch-dashboard/Chart.yaml new file mode 100644 index 00000000..dcb59e78 --- /dev/null +++ b/kubernetes/helm-chart/charts/opensearch-dashboard/Chart.yaml @@ -0,0 +1,5 @@ +apiVersion: v2 +name: opensearch-dashboard +description: Dashboard for Opensearch +appVersion: 1.0 +version: 1.0 \ No newline at end of file diff --git a/kubernetes/helm-chart/charts/opensearch-dashboard/templates/_helper.tpl b/kubernetes/helm-chart/charts/opensearch-dashboard/templates/_helper.tpl new file mode 100644 index 00000000..e7355ebc --- /dev/null +++ b/kubernetes/helm-chart/charts/opensearch-dashboard/templates/_helper.tpl @@ -0,0 +1,36 @@ +{{/* +Opensearch Dashboard labels +*/}} +{{- define "opensearch-dashboard-pod-labels" -}} +{{- range $name, $value := .Values.appConfiglabels }} +{{ $name }}: {{ $value | quote }} +{{- end -}} +{{- end -}} + +{{/* +Opensearch Dashboard annotations +*/}} +{{- define "opensearch-dashboard-pod-annotations" -}} +{{- range $name, $value := .Values.appConfig.annotations }} +{{ $name }}: {{ $value | quote }} +{{- end -}} +{{- end -}} + + +{{/* +Opensearch Dashboard Service labels +*/}} +{{- define "opensearch-dashboard-service-labels" -}} +{{- range $name, $value := .Values.service.labels }} +{{ $name }}: {{ $value | quote }} +{{- end -}} +{{- end -}} + +{{/* +Opensearch Dashboard Service annotations +*/}} +{{- define "opensearch-dashboard-service-annotations" -}} +{{- range $name, $value := .Values.service.annotations }} +{{ $name }}: {{ $value | quote }} +{{- end -}} +{{- end -}} \ No newline at end of file diff --git a/kubernetes/helm-chart/charts/opensearch-dashboard/templates/deployment.yaml b/kubernetes/helm-chart/charts/opensearch-dashboard/templates/deployment.yaml new file mode 100644 index 00000000..869a9f05 --- /dev/null +++ b/kubernetes/helm-chart/charts/opensearch-dashboard/templates/deployment.yaml @@ -0,0 +1,81 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: "{{ .Values.appConfig.name }}" + labels: + app: "{{ .Values.appConfig.name }}" + {{- include "opensearch-dashboard-pod-labels" . | nindent 4 }} + annotations: + {{- include "opensearch-dashboard-pod-annotations" . | nindent 4 }} + +spec: + replicas: {{ .Values.appConfig.replicas }} + selector: + matchLabels: + app: "{{ .Values.appConfig.name }}" + template: + metadata: + labels: + app: "{{ .Values.appConfig.name }}" + {{- include "opensearch-dashboard-pod-labels" . | nindent 8 }} + annotations: + {{- include "opensearch-dashboard-pod-annotations" . | nindent 8 }} + spec: + {{- with .Values.global.topologyConfig }} + {{- toYaml . | nindent 6 }} + {{- end }} + terminationGracePeriodSeconds: 10 + {{- with .Values.global.imagePullSecrets}} + imagePullSecrets: + {{- toYaml . | nindent 8}} + {{- end}} + containers: + - name: opensearch-dashboard + image: {{ .Values.appConfig.image }} + ports: + - containerPort: {{ .Values.service.targetPort }} + {{- if .Values.dependencies.storage.enabled }} + volumeMounts: + {{- range .Values.dependencies.storage.volumes }} + - name: {{ .name }} + mountPath: {{ .mountPath }} + {{- if and (eq .type "configmap") (hasKey . "subPath") .subPath }} + subPath: {{ .subPath }} + {{- end }} + {{- end }} + {{- end }} + resources: + limits: + cpu: {{ .Values.appConfig.resources.cpu.limits | quote }} + memory: {{ .Values.appConfig.resources.memory.limits | quote }} + requests: + cpu: {{ .Values.appConfig.resources.cpu.requests | quote }} + memory: {{ .Values.appConfig.resources.memory.requests | quote}} + env: + {{- with .Values.extraEnvs }} + {{- toYaml . | nindent 12 }} + {{- end }} + {{- if .Values.dependencies.storage.enabled }} + volumes: + {{- range .Values.dependencies.storage.volumes }} + - name: {{ .name }} + {{- if eq .type "pvc" }} + persistentVolumeClaim: + claimName: {{ .name }}-pvc + {{- else if eq .type "configmap" }} + configMap: + name: {{ $.Release.Name }}-configmap + {{- if and (hasKey . "configmapKey") (hasKey . "asFile" ) .confimapKey .asFile }} + items: + - key: {{ .configmapKey }} + path: {{ .asFile }} + {{- end }} + {{- else if eq .type "secret" }} + secret: + secretName: {{ .name }}-secret + {{- else }} + emptyDir: + sizeLimit: 100Mi + {{- end }} + {{- end }} + {{- end }} \ No newline at end of file diff --git a/kubernetes/helm-chart/charts/opensearch-dashboard/templates/pvc.yaml b/kubernetes/helm-chart/charts/opensearch-dashboard/templates/pvc.yaml new file mode 100644 index 00000000..da765b3b --- /dev/null +++ b/kubernetes/helm-chart/charts/opensearch-dashboard/templates/pvc.yaml @@ -0,0 +1,17 @@ +{{- range .Values.dependencies.storage.volumes }} + {{- if eq .type "pvc" }} +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: {{ .name }}-pvc + labels: + app: "{{ $.Release.Name }}" +spec: + storageClassName: "{{ .storageClass }}" + accessModes: + - ReadWriteMany + resources: + requests: + storage: {{ .size }} + {{- end }} +{{- end }} \ No newline at end of file diff --git a/kubernetes/helm-chart/charts/opensearch-dashboard/templates/service.yaml b/kubernetes/helm-chart/charts/opensearch-dashboard/templates/service.yaml new file mode 100644 index 00000000..caa21a3e --- /dev/null +++ b/kubernetes/helm-chart/charts/opensearch-dashboard/templates/service.yaml @@ -0,0 +1,29 @@ +apiVersion: v1 +kind: Service +metadata: + name: "{{ .Values.appConfig.name }}" + labels: + app: "{{ .Values.appConfig.name }}" + {{- include "opensearch-dashboard-service-labels" . | nindent 4 }} + annotations: + {{- include "opensearch-dashboard-service-annotations" . | nindent 4 }} +spec: + ports: + - protocol: TCP + name: "{{ .Values.appConfig.name }}-service" + {{- if eq .Values.service.scheme "http" }} + port: 80 + targetPort: {{ .Values.service.targetPort }} + {{- end }} + {{- if eq .Values.service.scheme "https" }} + port: 443 + targetPort: {{ .Values.service.targetPort }} + {{- end }} + {{- if eq .Values.service.scheme "passthrough" }} + port: {{ .Values.service.targetPort }} + targetPort: {{ .Values.service.targetPort }} + {{- end }} + type: {{ .Values.service.type | default "ClusterIP" | quote }} + sessionAffinity: None + selector: + app: "{{ .Values.appConfig.name }}" \ No newline at end of file diff --git a/kubernetes/helm-chart/charts/opensearch-dashboard/values.yaml b/kubernetes/helm-chart/charts/opensearch-dashboard/values.yaml new file mode 100644 index 00000000..efbbf8da --- /dev/null +++ b/kubernetes/helm-chart/charts/opensearch-dashboard/values.yaml @@ -0,0 +1,37 @@ +global: + topologyConfig: {} + imagePullSecrets: [] + imageRegistry: "" + appName: "" + +enabled: true + +appConfig: + name: "opensearch-dashboard" + replicas: 1 + image: docker.io/opensearchproject/opensearch-dashboards:2.11.1 + pullPolicy: IfNotPresent + metadata: {} + labels: {} + annotations: {} + resources: + cpu: + limits: "" + requests: "" + memory: + limits: "" + requests: "" + +dependencies: + storage: + enabled: false + volumes: [] + +service: + labels: {} + annotations: {} + targetPort: 5601 + scheme: "http" + type: "" # Default to "ClusterIP" + +extraEnvs: [] \ No newline at end of file diff --git a/kubernetes/helm-chart/charts/opensearch-node/Chart.yaml b/kubernetes/helm-chart/charts/opensearch-node/Chart.yaml new file mode 100644 index 00000000..c5ecbe2b --- /dev/null +++ b/kubernetes/helm-chart/charts/opensearch-node/Chart.yaml @@ -0,0 +1,5 @@ +apiVersion: v2 +name: opensearch-node +description: Opensearch for Grimoirelab +appVersion: 1.0 +version: 1.0 \ No newline at end of file diff --git a/kubernetes/helm-chart/charts/opensearch-node/templates/_helper.tpl b/kubernetes/helm-chart/charts/opensearch-node/templates/_helper.tpl new file mode 100644 index 00000000..167f6d3d --- /dev/null +++ b/kubernetes/helm-chart/charts/opensearch-node/templates/_helper.tpl @@ -0,0 +1,36 @@ +{{/* +Opensearch labels +*/}} +{{- define "opensearch-node-pod-labels" -}} +{{- range $name, $value := .Values.appConfiglabels }} +{{ $name }}: {{ $value | quote }} +{{- end -}} +{{- end -}} + +{{/* +Opensearch annotations +*/}} +{{- define "opensearch-node-pod-annotations" -}} +{{- range $name, $value := .Values.appConfig.annotations }} +{{ $name }}: {{ $value | quote }} +{{- end -}} +{{- end -}} + + +{{/* +Opensearch Service labels +*/}} +{{- define "opensearch-node-service-labels" -}} +{{- range $name, $value := .Values.service.labels }} +{{ $name }}: {{ $value | quote }} +{{- end -}} +{{- end -}} + +{{/* +Opensearch Service annotations +*/}} +{{- define "opensearch-node-service-annotations" -}} +{{- range $name, $value := .Values.service.annotations }} +{{ $name }}: {{ $value | quote }} +{{- end -}} +{{- end -}} \ No newline at end of file diff --git a/kubernetes/helm-chart/charts/opensearch-node/templates/deployment.yaml b/kubernetes/helm-chart/charts/opensearch-node/templates/deployment.yaml new file mode 100644 index 00000000..1bb7f8a7 --- /dev/null +++ b/kubernetes/helm-chart/charts/opensearch-node/templates/deployment.yaml @@ -0,0 +1,86 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: "{{ .Values.appConfig.name }}" + labels: + app: "{{ .Values.appConfig.name }}" + {{- include "opensearch-node-pod-labels" . | nindent 4 }} + annotations: + {{- include "opensearch-node-pod-annotations" . | nindent 4 }} + +spec: + replicas: {{ .Values.appConfig.replicas }} + selector: + matchLabels: + app: "{{ .Values.appConfig.name }}" + template: + metadata: + labels: + app: "{{ .Values.appConfig.name }}" + {{- include "opensearch-node-pod-labels" . | nindent 8 }} + annotations: + {{- include "opensearch-node-pod-annotations" . | nindent 8 }} + spec: + {{- with .Values.global.topologyConfig }} + {{- toYaml . | nindent 6 }} + {{- end }} + {{- if hasKey .Values.appConfig "security" }} + securityContext: + runAsUser: {{ .Values.appConfig.security.userID }} + runAsGroup: {{ .Values.appConfig.security.groupID }} + {{- end }} + terminationGracePeriodSeconds: 10 + {{- with .Values.global.imagePullSecrets}} + imagePullSecrets: + {{- toYaml . | nindent 8}} + {{- end}} + containers: + - name: opensearch-node + image: {{ .Values.appConfig.image }} + ports: + - containerPort: {{ .Values.service.targetPort }} + {{- if .Values.dependencies.storage.enabled }} + volumeMounts: + {{- range .Values.dependencies.storage.volumes }} + - name: {{ .name }} + mountPath: {{ .mountPath }} + {{- if and (eq .type "configmap") (hasKey . "subPath") .subPath }} + subPath: {{ .subPath }} + {{- end }} + {{- end }} + {{- end }} + resources: + limits: + cpu: {{ .Values.appConfig.resources.cpu.limits | quote }} + memory: {{ .Values.appConfig.resources.memory.limits | quote }} + requests: + cpu: {{ .Values.appConfig.resources.cpu.requests | quote }} + memory: {{ .Values.appConfig.resources.memory.requests | quote}} + env: + {{- with .Values.extraEnvs }} + {{- toYaml . | nindent 12 }} + {{- end }} + {{- if .Values.dependencies.storage.enabled }} + volumes: + {{- range .Values.dependencies.storage.volumes }} + - name: {{ .name }} + {{- if eq .type "pvc" }} + persistentVolumeClaim: + claimName: {{ .name }}-pvc + {{- else if eq .type "configmap" }} + configMap: + name: {{ $.Release.Name }}-configmap + {{- if and (hasKey . "configmapKey") (hasKey . "asFile" ) .confimapKey .asFile }} + items: + - key: {{ .configmapKey }} + path: {{ .asFile }} + {{- end }} + {{- else if eq .type "secret" }} + secret: + secretName: {{ .name }}-secret + {{- else }} + emptyDir: + sizeLimit: 100Mi + {{- end }} + {{- end }} + {{- end }} \ No newline at end of file diff --git a/kubernetes/helm-chart/charts/opensearch-node/templates/pvc.yaml b/kubernetes/helm-chart/charts/opensearch-node/templates/pvc.yaml new file mode 100644 index 00000000..da765b3b --- /dev/null +++ b/kubernetes/helm-chart/charts/opensearch-node/templates/pvc.yaml @@ -0,0 +1,17 @@ +{{- range .Values.dependencies.storage.volumes }} + {{- if eq .type "pvc" }} +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: {{ .name }}-pvc + labels: + app: "{{ $.Release.Name }}" +spec: + storageClassName: "{{ .storageClass }}" + accessModes: + - ReadWriteMany + resources: + requests: + storage: {{ .size }} + {{- end }} +{{- end }} \ No newline at end of file diff --git a/kubernetes/helm-chart/charts/opensearch-node/templates/service.yaml b/kubernetes/helm-chart/charts/opensearch-node/templates/service.yaml new file mode 100644 index 00000000..7157cb8e --- /dev/null +++ b/kubernetes/helm-chart/charts/opensearch-node/templates/service.yaml @@ -0,0 +1,29 @@ +apiVersion: v1 +kind: Service +metadata: + name: "{{ .Values.appConfig.name }}" + labels: + app: "{{ .Values.appConfig.name }}" + {{- include "opensearch-node-service-labels" . | nindent 4 }} + annotations: + {{- include "opensearch-node-service-annotations" . | nindent 4 }} +spec: + ports: + - protocol: TCP + name: "{{ .Values.appConfig.name }}-service" + {{- if eq .Values.service.scheme "http" }} + port: 80 + targetPort: {{ .Values.service.targetPort }} + {{- end }} + {{- if eq .Values.service.scheme "https" }} + port: 443 + targetPort: {{ .Values.service.targetPort }} + {{- end }} + {{- if eq .Values.service.scheme "passthrough" }} + port: {{ .Values.service.targetPort }} + targetPort: {{ .Values.service.targetPort }} + {{- end }} + type: {{ .Values.service.type | default "ClusterIP" | quote }} + sessionAffinity: None + selector: + app: "{{ .Values.appConfig.name }}" \ No newline at end of file diff --git a/kubernetes/helm-chart/charts/opensearch-node/values.yaml b/kubernetes/helm-chart/charts/opensearch-node/values.yaml new file mode 100644 index 00000000..b1edf50d --- /dev/null +++ b/kubernetes/helm-chart/charts/opensearch-node/values.yaml @@ -0,0 +1,47 @@ +global: + topologyConfig: {} + imagePullSecrets: [] + imageRegistry: "" + appName: "" + +enabled: true + +appConfig: + name: "opensearch-node" + replicas: 1 + image: docker.io/opensearchproject/opensearch:2.11.1 + pullPolicy: IfNotPresent + metadata: {} + labels: {} + annotations: {} + resources: + cpu: + limits: "" + requests: "" + memory: + limits: "" + requests: "" + security: + userID: 1000 + groupID: 1000 + + +dependencies: + storage: + enabled: true + volumes: + - name: "opensearch-data" + mountPath: "/usr/share/opensearch/data" + type: pvc + storageClass: efs-sc + size: 1Gi + + +service: + labels: {} + annotations: {} + targetPort: 9200 + scheme: "http" + type: "" # Default to "ClusterIP" + +extraEnvs: [] \ No newline at end of file diff --git a/kubernetes/helm-chart/charts/sortinghat-worker/Chart.yaml b/kubernetes/helm-chart/charts/sortinghat-worker/Chart.yaml new file mode 100644 index 00000000..50131c55 --- /dev/null +++ b/kubernetes/helm-chart/charts/sortinghat-worker/Chart.yaml @@ -0,0 +1,5 @@ +apiVersion: v2 +name: sortinghat-worker +description: Sortinghat worker for GrimoireLab +appVersion: 1.0 +version: 1.0 \ No newline at end of file diff --git a/kubernetes/helm-chart/charts/sortinghat-worker/templates/_helper.tpl b/kubernetes/helm-chart/charts/sortinghat-worker/templates/_helper.tpl new file mode 100644 index 00000000..f0ce44b1 --- /dev/null +++ b/kubernetes/helm-chart/charts/sortinghat-worker/templates/_helper.tpl @@ -0,0 +1,36 @@ +{{/* +Sortinghat labels +*/}} +{{- define "sortinghat-worker-pod-labels" -}} +{{- range $name, $value := .Values.appConfiglabels }} +{{ $name }}: {{ $value | quote }} +{{- end -}} +{{- end -}} + +{{/* +Sortinghat annotations +*/}} +{{- define "sortinghat-worker-pod-annotations" -}} +{{- range $name, $value := .Values.appConfig.annotations }} +{{ $name }}: {{ $value | quote }} +{{- end -}} +{{- end -}} + + +{{/* +Sortinghat Service labels +*/}} +{{- define "sortinghat-worker-service-labels" -}} +{{- range $name, $value := .Values.service.labels }} +{{ $name }}: {{ $value | quote }} +{{- end -}} +{{- end -}} + +{{/* +Sortinghat Service annotations +*/}} +{{- define "sortinghat-worker-service-annotations" -}} +{{- range $name, $value := .Values.service.annotations }} +{{ $name }}: {{ $value | quote }} +{{- end -}} +{{- end -}} \ No newline at end of file diff --git a/kubernetes/helm-chart/charts/sortinghat-worker/templates/deployment.yaml b/kubernetes/helm-chart/charts/sortinghat-worker/templates/deployment.yaml new file mode 100644 index 00000000..f7938dde --- /dev/null +++ b/kubernetes/helm-chart/charts/sortinghat-worker/templates/deployment.yaml @@ -0,0 +1,81 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: "{{ .Values.appConfig.name }}" + labels: + app: "{{ .Values.appConfig.name }}" + {{- include "sortinghat-worker-pod-labels" . | nindent 4 }} + annotations: + {{- include "sortinghat-worker-pod-annotations" . | nindent 4 }} + +spec: + replicas: {{ .Values.appConfig.replicas }} + selector: + matchLabels: + app: "{{ .Values.appConfig.name }}" + template: + metadata: + labels: + app: "{{ .Values.appConfig.name }}" + {{- include "sortinghat-worker-pod-labels" . | nindent 8 }} + annotations: + {{- include "sortinghat-worker-pod-annotations" . | nindent 8 }} + spec: + {{- with .Values.global.topologyConfig }} + {{- toYaml . | nindent 6 }} + {{- end }} + terminationGracePeriodSeconds: 10 + {{- with .Values.global.imagePullSecrets}} + imagePullSecrets: + {{- toYaml . | nindent 8}} + {{- end}} + containers: + - name: sortinghat + image: {{ .Values.appConfig.image }} + ports: + - containerPort: {{ .Values.service.targetPort }} + {{- if .Values.dependencies.storage.enabled }} + volumeMounts: + {{- range .Values.dependencies.storage.volumes }} + - name: {{ .name }} + mountPath: {{ .mountPath }} + {{- if and (eq .type "configmap") (hasKey . "subPath") .subPath }} + subPath: {{ .subPath }} + {{- end }} + {{- end }} + {{- end }} + resources: + limits: + cpu: {{ .Values.appConfig.resources.cpu.limits | quote }} + memory: {{ .Values.appConfig.resources.memory.limits | quote }} + requests: + cpu: {{ .Values.appConfig.resources.cpu.requests | quote }} + memory: {{ .Values.appConfig.resources.memory.requests | quote}} + env: + {{- with .Values.extraEnvs }} + {{- toYaml . | nindent 12 }} + {{- end }} + {{- if .Values.dependencies.storage.enabled }} + volumes: + {{- range .Values.dependencies.storage.volumes }} + - name: {{ .name }} + {{- if eq .type "pvc" }} + persistentVolumeClaim: + claimName: {{ .name }}-pvc + {{- else if eq .type "configmap" }} + configMap: + name: {{ $.Release.Name }}-configmap + {{- if and (hasKey . "configmapKey") (hasKey . "asFile" ) .confimapKey .asFile }} + items: + - key: {{ .configmapKey }} + path: {{ .asFile }} + {{- end }} + {{- else if eq .type "secret" }} + secret: + secretName: {{ .name }}-secret + {{- else }} + emptyDir: + sizeLimit: 100Mi + {{- end }} + {{- end }} + {{- end }} \ No newline at end of file diff --git a/kubernetes/helm-chart/charts/sortinghat-worker/templates/pvc.yaml b/kubernetes/helm-chart/charts/sortinghat-worker/templates/pvc.yaml new file mode 100644 index 00000000..da765b3b --- /dev/null +++ b/kubernetes/helm-chart/charts/sortinghat-worker/templates/pvc.yaml @@ -0,0 +1,17 @@ +{{- range .Values.dependencies.storage.volumes }} + {{- if eq .type "pvc" }} +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: {{ .name }}-pvc + labels: + app: "{{ $.Release.Name }}" +spec: + storageClassName: "{{ .storageClass }}" + accessModes: + - ReadWriteMany + resources: + requests: + storage: {{ .size }} + {{- end }} +{{- end }} \ No newline at end of file diff --git a/kubernetes/helm-chart/charts/sortinghat-worker/templates/service.yaml b/kubernetes/helm-chart/charts/sortinghat-worker/templates/service.yaml new file mode 100644 index 00000000..9d4d4dcb --- /dev/null +++ b/kubernetes/helm-chart/charts/sortinghat-worker/templates/service.yaml @@ -0,0 +1,29 @@ +apiVersion: v1 +kind: Service +metadata: + name: "{{ .Values.appConfig.name }}" + labels: + app: "{{ .Values.appConfig.name }}" + {{- include "sortinghat-worker-service-labels" . | nindent 4 }} + annotations: + {{- include "sortinghat-worker-service-annotations" . | nindent 4 }} +spec: + ports: + - protocol: TCP + name: "{{ .Values.appConfig.name }}-service" + {{- if eq .Values.service.scheme "http" }} + port: 80 + targetPort: {{ .Values.service.targetPort }} + {{- end }} + {{- if eq .Values.service.scheme "https" }} + port: 443 + targetPort: {{ .Values.service.targetPort }} + {{- end }} + {{- if eq .Values.service.scheme "passthrough" }} + port: {{ .Values.service.targetPort }} + targetPort: {{ .Values.service.targetPort }} + {{- end }} + type: {{ .Values.service.type | default "ClusterIP" | quote }} + sessionAffinity: None + selector: + app: "{{ .Values.appConfig.name }}" \ No newline at end of file diff --git a/kubernetes/helm-chart/charts/sortinghat-worker/values.yaml b/kubernetes/helm-chart/charts/sortinghat-worker/values.yaml new file mode 100644 index 00000000..4792c2aa --- /dev/null +++ b/kubernetes/helm-chart/charts/sortinghat-worker/values.yaml @@ -0,0 +1,37 @@ +global: + topologyConfig: {} + imagePullSecrets: [] + imageRegistry: "" + appName: "" + +enabled: true + +appConfig: + name: sortinghat-worker + replicas: 1 + image: docker.io/grimoirelab/sortinghat-worker:latest + pullPolicy: IfNotPresent + metadata: {} + labels: {} + annotations: {} + resources: + cpu: + limits: "" + requests: "" + memory: + limits: "" + requests: "" + +dependencies: + storage: + enabled: false + volumes: [] + +service: + labels: {} + annotations: {} + targetPort: 9314 + scheme: "http" + type: "" # Default to "ClusterIP" + +extraEnvs: [] \ No newline at end of file diff --git a/kubernetes/helm-chart/charts/sortinghat/Chart.yaml b/kubernetes/helm-chart/charts/sortinghat/Chart.yaml new file mode 100644 index 00000000..11576767 --- /dev/null +++ b/kubernetes/helm-chart/charts/sortinghat/Chart.yaml @@ -0,0 +1,5 @@ +apiVersion: v2 +name: sortinghat +description: Sortinghat service for GrimoireLab +appVersion: 1.0 +version: 1.0 \ No newline at end of file diff --git a/kubernetes/helm-chart/charts/sortinghat/templates/_helper.tpl b/kubernetes/helm-chart/charts/sortinghat/templates/_helper.tpl new file mode 100644 index 00000000..1f92e741 --- /dev/null +++ b/kubernetes/helm-chart/charts/sortinghat/templates/_helper.tpl @@ -0,0 +1,36 @@ +{{/* +Sortinghat labels +*/}} +{{- define "sortinghat-pod-labels" -}} +{{- range $name, $value := .Values.appConfig.labels }} +{{ $name }}: {{ $value | quote }} +{{- end -}} +{{- end -}} + +{{/* +Sortinghat annotations +*/}} +{{- define "sortinghat-pod-annotations" -}} +{{- range $name, $value := .Values.appConfig.annotations }} +{{ $name }}: {{ $value | quote }} +{{- end -}} +{{- end -}} + + +{{/* +Sortinghat Service labels +*/}} +{{- define "sortinghat-service-labels" -}} +{{- range $name, $value := .Values.service.labels }} +{{ $name }}: {{ $value | quote }} +{{- end -}} +{{- end -}} + +{{/* +Sortinghat Service annotations +*/}} +{{- define "sortinghat-service-annotations" -}} +{{- range $name, $value := .Values.service.annotations }} +{{ $name }}: {{ $value | quote }} +{{- end -}} +{{- end -}} \ No newline at end of file diff --git a/kubernetes/helm-chart/charts/sortinghat/templates/deployment.yaml b/kubernetes/helm-chart/charts/sortinghat/templates/deployment.yaml new file mode 100644 index 00000000..d555aa76 --- /dev/null +++ b/kubernetes/helm-chart/charts/sortinghat/templates/deployment.yaml @@ -0,0 +1,81 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ .Values.appConfig.name }} + labels: + app: "{{ .Values.appConfig.name }}" + {{- include "sortinghat-pod-labels" . | nindent 4 }} + annotations: + {{- include "sortinghat-pod-annotations" . | nindent 4 }} + +spec: + replicas: {{ .Values.appConfig.replicas }} + selector: + matchLabels: + app: "{{ .Values.appConfig.name }}" + template: + metadata: + labels: + app: "{{ .Values.appConfig.name }}" + {{- include "sortinghat-pod-labels" . | nindent 8 }} + annotations: + {{- include "sortinghat-pod-annotations" . | nindent 8 }} + spec: + {{- with .Values.global.topologyConfig }} + {{- toYaml . | nindent 6 }} + {{- end }} + terminationGracePeriodSeconds: 10 + {{- with .Values.global.imagePullSecrets}} + imagePullSecrets: + {{- toYaml . | nindent 8}} + {{- end}} + containers: + - name: sortinghat + image: {{ .Values.appConfig.image }} + ports: + - containerPort: {{ .Values.service.targetPort }} + {{- if .Values.dependencies.storage.enabled }} + volumeMounts: + {{- range .Values.dependencies.storage.volumes }} + - name: {{ .name }} + mountPath: {{ .mountPath }} + {{- if and (eq .type "configmap") (hasKey . "subPath") .subPath }} + subPath: {{ .subPath }} + {{- end }} + {{- end }} + {{- end }} + resources: + limits: + cpu: {{ .Values.appConfig.resources.cpu.limits | quote }} + memory: {{ .Values.appConfig.resources.memory.limits | quote }} + requests: + cpu: {{ .Values.appConfig.resources.cpu.requests | quote }} + memory: {{ .Values.appConfig.resources.memory.requests | quote}} + env: + {{- with .Values.extraEnvs }} + {{- toYaml . | nindent 12 }} + {{- end }} + {{- if .Values.dependencies.storage.enabled }} + volumes: + {{- range .Values.dependencies.storage.volumes }} + - name: {{ .name }} + {{- if eq .type "pvc" }} + persistentVolumeClaim: + claimName: {{ .name }}-pvc + {{- else if eq .type "configmap" }} + configMap: + name: {{ $.Release.Name }}-configmap + {{- if and (hasKey . "configmapKey") (hasKey . "asFile" ) .confimapKey .asFile }} + items: + - key: {{ .configmapKey }} + path: {{ .asFile }} + {{- end }} + {{- else if eq .type "secret" }} + secret: + secretName: {{ .name }}-secret + {{- else }} + emptyDir: + sizeLimit: 100Mi + {{- end }} + {{- end }} + {{- end }} diff --git a/kubernetes/helm-chart/charts/sortinghat/templates/pvc.yaml b/kubernetes/helm-chart/charts/sortinghat/templates/pvc.yaml new file mode 100644 index 00000000..da765b3b --- /dev/null +++ b/kubernetes/helm-chart/charts/sortinghat/templates/pvc.yaml @@ -0,0 +1,17 @@ +{{- range .Values.dependencies.storage.volumes }} + {{- if eq .type "pvc" }} +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: {{ .name }}-pvc + labels: + app: "{{ $.Release.Name }}" +spec: + storageClassName: "{{ .storageClass }}" + accessModes: + - ReadWriteMany + resources: + requests: + storage: {{ .size }} + {{- end }} +{{- end }} \ No newline at end of file diff --git a/kubernetes/helm-chart/charts/sortinghat/templates/service.yaml b/kubernetes/helm-chart/charts/sortinghat/templates/service.yaml new file mode 100644 index 00000000..46090584 --- /dev/null +++ b/kubernetes/helm-chart/charts/sortinghat/templates/service.yaml @@ -0,0 +1,29 @@ +apiVersion: v1 +kind: Service +metadata: + name: "{{ .Values.appConfig.name }}" + labels: + app: "{{ .Values.appConfig.name }}" + {{- include "sortinghat-service-labels" . | nindent 4 }} + annotations: + {{- include "sortinghat-service-annotations" . | nindent 4 }} +spec: + ports: + - protocol: TCP + name: "{{ .Values.appConfig.name }}-service" + {{- if eq .Values.service.scheme "http" }} + port: 80 + targetPort: {{ .Values.service.targetPort }} + {{- end }} + {{- if eq .Values.service.scheme "https" }} + port: 443 + targetPort: {{ .Values.service.targetPort }} + {{- end }} + {{- if eq .Values.service.scheme "passthrough" }} + port: {{ .Values.service.targetPort }} + targetPort: {{ .Values.service.targetPort }} + {{- end }} + type: {{ .Values.service.type | default "ClusterIP" | quote }} + sessionAffinity: None + selector: + app: "{{ .Values.appConfig.name }}" \ No newline at end of file diff --git a/kubernetes/helm-chart/charts/sortinghat/values.yaml b/kubernetes/helm-chart/charts/sortinghat/values.yaml new file mode 100644 index 00000000..b8b22c57 --- /dev/null +++ b/kubernetes/helm-chart/charts/sortinghat/values.yaml @@ -0,0 +1,42 @@ +global: + topologyConfig: {} + imagePullSecrets: [] + imageRegistry: "" + appName: "" + +enabled: true + +appConfig: + name: "sortinghat" + replicas: 1 + image: docker.io/grimoirelab/sortinghat:latest + pullPolicy: IfNotPresent + metadata: {} + labels: {} + annotations: {} + resources: + cpu: + limits: "" + requests: "" + memory: + limits: "" + requests: "" + +dependencies: + storage: + enabled: true + volumes: + - name: "sortinghat-static" + mountPath: "/opt/venv/lib/python3.9/site-packages/sortinghat/static" + type: pvc + storageClass: efs-sc + size: 1Gi + +service: + labels: {} + annotations: {} + targetPort: 9314 + scheme: "http" + type: "" # Default to "ClusterIP" + +extraEnvs: [] \ No newline at end of file diff --git a/kubernetes/helm-chart/templates/_image.tpl b/kubernetes/helm-chart/templates/_image.tpl new file mode 100644 index 00000000..7fd013c1 --- /dev/null +++ b/kubernetes/helm-chart/templates/_image.tpl @@ -0,0 +1,10 @@ +{{/* +Print the image +*/}} +{{- define "appConfig.image" -}} +{{- $image := printf "%s:%s" .repository .tag }} +{{- if .registry }} +{{- $image = printf "%s/%s" .registry $image }} +{{- end }} +{{- $image -}} +{{- end }} \ No newline at end of file diff --git a/kubernetes/helm-chart/templates/configmap.yaml b/kubernetes/helm-chart/templates/configmap.yaml new file mode 100644 index 00000000..708880d5 --- /dev/null +++ b/kubernetes/helm-chart/templates/configmap.yaml @@ -0,0 +1,16 @@ +kind: ConfigMap +apiVersion: v1 +metadata: + name: "{{ $.Release.Name }}-configmap" + labels: + app: "{{ $.Release.Name }}" + +data: + mordred-setup: |- + {{- include "mordred-setup-config" . | nindent 4 }} + mordred-projects: |- + {{- include "mordred-project-config" . | nindent 4 }} + uwsgi-params: |- + {{- include "uwsgi-params" . | nindent 4 }} + nginx-conf-template: |- + {{- include "nginx-conf-template" . | nindent 4 }} \ No newline at end of file diff --git a/kubernetes/helm-chart/values.yaml b/kubernetes/helm-chart/values.yaml new file mode 100644 index 00000000..f34d8923 --- /dev/null +++ b/kubernetes/helm-chart/values.yaml @@ -0,0 +1,250 @@ +global: + topologyConfig: {} + imagePullSecrets: [] + imageRegistry: "" + appName: grimoirelab + +opensearch-node: + enabled: true + + appConfig: + replicas: 1 + image: docker.io/opensearchproject/opensearch:2.11.1 + labels: {} + annotations: {} + resources: + cpu: + limits: "500m" + requests: "300m" + memory: + limits: "3000Mi" + requests: "2000Mi" + + dependencies: + storage: + enabled: true + volumes: + - name: "opensearch-data" + mountPath: "/usr/share/opensearch/data" + type: pvc + storageClass: efs-sc + size: 10Gi + + service: + scheme: passthrough + type: "" + + extraEnvs: + - name: cluster.name + value: "opensearch-cluster" + - name: node.name + value: "opensearch-node1" + - name: discovery.type + value: "single-node" + - name: bootstrap.memory_lock + value: "true" + - name: "OPENSEARCH_JAVA_OPTS" + value: "-Xms2g -Xmx2g" + +opensearch-dashboard: + enabled: true + + appConfig: + replicas: 1 + image: docker.io/opensearchproject/opensearch-dashboards:2.11.1 + labels: {} + annotations: {} + resources: + cpu: + limits: "200m" + requests: "100m" + memory: + limits: "512Mi" + requests: "256Mi" + + dependencies: + storage: + enabled: false + + service: + scheme: passthrough + type: "" + + extraEnvs: + - name: OPENSEARCH_HOSTS + value: '"[\"https://opensearch-node:9200\"]"' + +mordred: + enabled: true + appConfig: + replicas: 1 + image: docker.io/grimoirelab/grimoirelab:latest + labels: {} + annotations: {} + resources: + cpu: + limits: "500m" + requests: "200m" + memory: + limits: "1024Mi" + requests: "512Mi" + + dependencies: + storage: + enabled: true + volumes: + - name: "mordred-setup" + mountPath: "/home/grimoire/conf/setup.cfg" + type: configmap + subPath: "mordred-setup" + - name: "mordred-projects" + mountPath: "/home/grimoire/conf/projects.json" + type: configmap + subPath: "mordred-projects" + - name: "mordred-log" + mountPath: "/home/grimoire/logs" + type: emptyDir + + service: + scheme: passthrough + type: "" + + extraEnvs: [] + +nginx: + enabled: true + + appConfig: + replicas: 1 + image: docker.io/nginx:latest + labels: {} + annotations: {} + resources: + cpu: + limits: "100m" + requests: "50m" + memory: + limits: "256Mi" + requests: "128Mi" + + dependencies: + storage: + enabled: true + volumes: + - name: "nginx-conf-template" + mountPath: "/etc/nginx/templates/default.conf.template" + type: configmap + subPath: "nginx-conf-template" + - name: "uwsgi-params" + mountPath: "/etc/nginx/uwsgi_params" + type: configmap + subPath: "uwsgi-params" + - name: "sortinghat-static" + mountPath: "/sortinghat" + type: pvc + + service: + scheme: passthrough + type: "" + + extraEnvs: + - name: KIBANA_HOST + value: http://opensearch-dashboard:5601/ + +sortinghat: + enabled: true + + appConfig: + replicas: 1 + image: docker.io/grimoirelab/sortinghat:latest + labels: {} + annotations: {} + resources: + cpu: + limits: "200m" + requests: "100m" + memory: + limits: "512Mi" + requests: "256Mi" + + dependencies: + storage: + enabled: true + volumes: + - name: "sortinghat-static" + mountPath: "/opt/venv/lib/python3.9/site-packages/sortinghat/static" + type: pvc + storageClass: efs-sc + size: 1Gi + + service: + scheme: passthrough + type: "" + + extraEnvs: + - name: SORTINGHAT_SECRET_KEY + value: "secret" + - name: SORTINGHAT_DB_HOST + value: "mariadb" + - name: SORTINGHAT_DB_PORT + value: "3306" + - name: SORTINGHAT_DB_DATABASE + value: "sortinghat_db" + - name: SORTINGHAT_DB_USER + value: "root" + - name: SORTINGHAT_DB_PASSWORD + value: "mar1adb4Gr1m0ir3Lab" + - name: SORTINGHAT_REDIS_HOST + value: "redis-master" + - name: SORTINGHAT_REDIS_PASSWORD + value: "grimoirelab" + - name: SORTINGHAT_SUPERUSER_USERNAME + value: "root" + - name: SORTINGHAT_SUPERUSER_PASSWORD + value: "root" + - name: SORTINGHAT_ALLOWED_HOST + value: "sortinghat,nginx,localhost,127.0.0.1,0.0.0.0,nginx.grimoirelab.svc.cluster.local,[::1]" + - name: SORTINGHAT_CORS_ALLOWED_ORIGINS + value: "http://localhost:8000,http://127.0.0.1:8000,http://0.0.0.0:8000" + +sortinghat-worker: + enabled: true + + appConfig: + replicas: 1 + image: docker.io/grimoirelab/sortinghat-worker:latest + labels: {} + annotations: {} + resources: + cpu: + limits: "200m" + requests: "100m" + memory: + limits: "512Mi" + requests: "256Mi" + + dependencies: + storage: + enabled: false + + service: + scheme: passthrough + type: "" + + extraEnvs: + - name: SORTINGHAT_SECRET_KEY + value: "secret" + - name: SORTINGHAT_DB_HOST + value: "mariadb" + - name: SORTINGHAT_DB_PORT + value: "3306" + - name: SORTINGHAT_DB_DATABASE + value: "sortinghat_db" + - name: SORTINGHAT_DB_USER + value: "root" + - name: SORTINGHAT_DB_PASSWORD + value: "mar1adb4Gr1m0ir3Lab" + - name: SORTINGHAT_REDIS_HOST + value: "redis-master" + - name: SORTINGHAT_REDIS_PASSWORD + value: "grimoirelab" \ No newline at end of file From 8dc0dd7104c344caecf23f0c7bfc93195f03c383 Mon Sep 17 00:00:00 2001 From: Arie <44765750+Eroyi@users.noreply.github.com> Date: Tue, 5 Nov 2024 18:39:05 +0800 Subject: [PATCH 02/16] reconstruct the chart structures, and more - reconstruct the helm chart structures, now variables can be defined and referencing across all sub chart - add template file to handle variables - fix format issue, all files end with empty line. - (WIP) integrate with bitnami's redis and mariadb chart. - (TODO) README.md - (ISSUE) variables in templates/_ports.tpl cannot be obtain correctly from values.yaml. All variables are fixed for now. Signed-off-by: Arie <44765750+Eroyi@users.noreply.github.com> Signed-off-by: root <44765750+Eroyi@users.noreply.github.com> --- Chart.yaml | 43 ++++ charts/mordred/Chart.yaml | 10 + charts/mordred/templates/_helper.tpl | 36 +++ charts/mordred/templates/_mordred_config.tpl | 156 ++++++++++++ .../mordred/templates/_mordred_projects.tpl | 15 ++ charts/mordred/templates/deployment.yaml | 59 +++++ charts/mordred/templates/pvc.yaml | 3 + charts/mordred/templates/service.yaml | 11 + charts/mordred/values.yaml | 36 +++ charts/nginx/Chart.yaml | 10 + charts/nginx/templates/_helper.tpl | 36 +++ charts/nginx/templates/_nginx-config.tpl | 61 +++++ charts/nginx/templates/_ports.tpl | 6 + charts/nginx/templates/deployment.yaml | 59 +++++ charts/nginx/templates/pvc.yaml | 3 + charts/nginx/templates/service.yaml | 11 + charts/nginx/values.yaml | 47 ++++ charts/opensearch-dashboard/Chart.yaml | 10 + .../templates/_helper.tpl | 36 +++ .../opensearch-dashboard/templates/_ports.tpl | 6 + .../templates/deployment.yaml | 59 +++++ .../opensearch-dashboard/templates/pvc.yaml | 3 + .../templates/service.yaml | 11 + charts/opensearch-dashboard/values.yaml | 37 +++ charts/opensearch-node/Chart.yaml | 10 + charts/opensearch-node/templates/_helper.tpl | 36 +++ charts/opensearch-node/templates/_ports.tpl | 6 + .../opensearch-node/templates/deployment.yaml | 64 +++++ charts/opensearch-node/templates/pvc.yaml | 3 + charts/opensearch-node/templates/service.yaml | 11 + charts/opensearch-node/values.yaml | 45 ++++ charts/sortinghat-worker/Chart.yaml | 10 + .../sortinghat-worker/templates/_helper.tpl | 36 +++ charts/sortinghat-worker/templates/_ports.tpl | 6 + .../templates/deployment.yaml | 59 +++++ charts/sortinghat-worker/templates/pvc.yaml | 3 + .../sortinghat-worker/templates/service.yaml | 11 + charts/sortinghat-worker/values.yaml | 37 +++ charts/sortinghat/Chart.yaml | 10 + charts/sortinghat/templates/_helper.tpl | 36 +++ charts/sortinghat/templates/_ports.tpl | 6 + charts/sortinghat/templates/deployment.yaml | 59 +++++ charts/sortinghat/templates/pvc.yaml | 3 + charts/sortinghat/templates/service.yaml | 11 + charts/sortinghat/values.yaml | 42 ++++ templates/_credentials.tpl | 22 ++ templates/_env.tpl | 40 +++ templates/_envs.tpl | 40 +++ templates/_ports.tpl | 49 ++++ templates/_template.tpl | 85 +++++++ templates/_templates.tpl | 89 +++++++ templates/configmap.yaml | 16 ++ values.yaml | 228 ++++++++++++++++++ 53 files changed, 1837 insertions(+) create mode 100644 Chart.yaml create mode 100644 charts/mordred/Chart.yaml create mode 100644 charts/mordred/templates/_helper.tpl create mode 100644 charts/mordred/templates/_mordred_config.tpl create mode 100644 charts/mordred/templates/_mordred_projects.tpl create mode 100644 charts/mordred/templates/deployment.yaml create mode 100644 charts/mordred/templates/pvc.yaml create mode 100644 charts/mordred/templates/service.yaml create mode 100644 charts/mordred/values.yaml create mode 100644 charts/nginx/Chart.yaml create mode 100644 charts/nginx/templates/_helper.tpl create mode 100644 charts/nginx/templates/_nginx-config.tpl create mode 100644 charts/nginx/templates/_ports.tpl create mode 100644 charts/nginx/templates/deployment.yaml create mode 100644 charts/nginx/templates/pvc.yaml create mode 100644 charts/nginx/templates/service.yaml create mode 100644 charts/nginx/values.yaml create mode 100644 charts/opensearch-dashboard/Chart.yaml create mode 100644 charts/opensearch-dashboard/templates/_helper.tpl create mode 100644 charts/opensearch-dashboard/templates/_ports.tpl create mode 100644 charts/opensearch-dashboard/templates/deployment.yaml create mode 100644 charts/opensearch-dashboard/templates/pvc.yaml create mode 100644 charts/opensearch-dashboard/templates/service.yaml create mode 100644 charts/opensearch-dashboard/values.yaml create mode 100644 charts/opensearch-node/Chart.yaml create mode 100644 charts/opensearch-node/templates/_helper.tpl create mode 100644 charts/opensearch-node/templates/_ports.tpl create mode 100644 charts/opensearch-node/templates/deployment.yaml create mode 100644 charts/opensearch-node/templates/pvc.yaml create mode 100644 charts/opensearch-node/templates/service.yaml create mode 100644 charts/opensearch-node/values.yaml create mode 100644 charts/sortinghat-worker/Chart.yaml create mode 100644 charts/sortinghat-worker/templates/_helper.tpl create mode 100644 charts/sortinghat-worker/templates/_ports.tpl create mode 100644 charts/sortinghat-worker/templates/deployment.yaml create mode 100644 charts/sortinghat-worker/templates/pvc.yaml create mode 100644 charts/sortinghat-worker/templates/service.yaml create mode 100644 charts/sortinghat-worker/values.yaml create mode 100644 charts/sortinghat/Chart.yaml create mode 100644 charts/sortinghat/templates/_helper.tpl create mode 100644 charts/sortinghat/templates/_ports.tpl create mode 100644 charts/sortinghat/templates/deployment.yaml create mode 100644 charts/sortinghat/templates/pvc.yaml create mode 100644 charts/sortinghat/templates/service.yaml create mode 100644 charts/sortinghat/values.yaml create mode 100644 templates/_credentials.tpl create mode 100644 templates/_env.tpl create mode 100644 templates/_envs.tpl create mode 100644 templates/_ports.tpl create mode 100644 templates/_template.tpl create mode 100644 templates/_templates.tpl create mode 100644 templates/configmap.yaml create mode 100644 values.yaml diff --git a/Chart.yaml b/Chart.yaml new file mode 100644 index 00000000..d1602a0d --- /dev/null +++ b/Chart.yaml @@ -0,0 +1,43 @@ +apiVersion: v2 +name: grimoirelab +type: application +description: Nested Chart collection for all grimorelab services. +home: https://github.com/chaoss/grimoirelab +icon: https://www.gravatar.com/avatar/4154acefea56ed23bddaaa47a4850400 +maintainers: +- name: Arie + url: https://github.com/Eroyi +version: 1.7.0 #Based on the "Github Release" version (which is the docker image tag referring from), not the actual application version. +appVersion: 1.0 +dependencies: +- name: mordred + repository: file://charts/mordred + version: 1.7.0 +- name: nginx + repository: file://charts/nginx + versio: 1.27.2 +- name: sortinghat + repository: file://charts/sortinghat + version: 1.7.0 +- name: sortinghat-worker + repository: file://charts/sortinghat-worker + version: 1.7.0 + alias: sortinghatWorker +# External Dependencies +- name: opensearch-dashboard + version: 2.11.1 + repository: file://charts/opensearch-dashboard + alias: opensearchDashboard + condition: opensearchDashboard.install +- name: opensearch-node + repository: file://charts/opensearch-node + version: 2.11.1 + alias: opensearchNode + condition: opensearchNode.install +# - name: mariadb +# version: 19.1.0 +# condition: mariadb.install +# - name: redis +# version: 20.2.1 +# condition: redis.install + diff --git a/charts/mordred/Chart.yaml b/charts/mordred/Chart.yaml new file mode 100644 index 00000000..99fef44e --- /dev/null +++ b/charts/mordred/Chart.yaml @@ -0,0 +1,10 @@ +apiVersion: v2 +name: mordred +description: Mordred service for GrimoireLab. +home: https://github.com/chaoss/grimoirelab +icon: https://www.gravatar.com/avatar/4154acefea56ed23bddaaa47a4850400 +maintainers: +- name: Arie + url: https://github.com/Eroyi +appVersion: 1.7.0 #Based on the "Github Release" version (which is the docker image tag referring from), not the actual application version. +version: 1.0 diff --git a/charts/mordred/templates/_helper.tpl b/charts/mordred/templates/_helper.tpl new file mode 100644 index 00000000..cf7469aa --- /dev/null +++ b/charts/mordred/templates/_helper.tpl @@ -0,0 +1,36 @@ +{{/* +Mordred labels +*/}} +{{- define "metadata.mordred.pod.labels" -}} +{{- range $name, $value := .Values.appConfig.labels }} +{{ $name }}: {{ $value | quote }} +{{- end -}} +{{- end -}} + +{{/* +Mordred annotations +*/}} +{{- define "metadata.mordred.pod.annotations" -}} +{{- range $name, $value := .Values.appConfig.annotations }} +{{ $name }}: {{ $value | quote }} +{{- end -}} +{{- end -}} + + +{{/* +Mordred Service labels +*/}} +{{- define "metadata.mordred.service.labels" -}} +{{- range $name, $value := .Values.service.labels }} +{{ $name }}: {{ $value | quote }} +{{- end -}} +{{- end -}} + +{{/* +Mordred Service annotations +*/}} +{{- define "metadata.mordred.service.annotations" -}} +{{- range $name, $value := .Values.service.annotations }} +{{ $name }}: {{ $value | quote }} +{{- end -}} +{{- end -}} diff --git a/charts/mordred/templates/_mordred_config.tpl b/charts/mordred/templates/_mordred_config.tpl new file mode 100644 index 00000000..eda12d62 --- /dev/null +++ b/charts/mordred/templates/_mordred_config.tpl @@ -0,0 +1,156 @@ +{{/* + Mordred setup config +*/}} +{{- define "config.mordredSetup" -}} +[general] +short_name = GrimoireLab +update = true +min_update_delay = 60 +debug = false +logs_dir = /home/grimoire/logs +bulk_size = 100 +scroll_size = 100 +aliases_file = /home/grimoire/aliases.json + +[projects] +projects_file = /home/grimoire/conf/projects.json + +[es_collection] +url = https://admin:{{ include "cred.opensearchNode.password" . }}@opensearchNode:{{ include "port.opensearchNode" . }} + +[es_enrichment] +url = https://admin:{{ include "cred.opensearchNode.password" . }}@opensearchNode:{{ include "port.opensearchNode" . }} +autorefresh = true + +[sortinghat] +host = nginx +user = root +password = root +port = {{ include "port.nginxListen" . }} +path = /identities/api/ +ssl = false +database = sortinghat_db +autoprofile = [github, git] +matching = [email,name,username] +sleep_for = 100 +unaffiliated_group = Unknown +affiliate = true + +[panels] +kibiter_time_from = +kibiter_default_index = +kibiter_url = +kibiter_version = + +[phases] +collection = true +identities = true +enrichment = true +panels = false + +#[bugzillarest] +#raw_index = bugzillarest_demo_raw +#enriched_index = bugzillarest_demo_enriched +#no-archive = true + +#[confluence] +#no-archive = true +#raw_index = confluence_demo_raw +#enriched_index = confluence_demo_enriched + +#[discourse] +#raw_index = discourse_demo_raw +#enriched_index = discourse_demo_enriched +#no-archive = true + +[git] +raw_index = git_demo_raw +enriched_index = git_demo_enriched +latest-items = true +studies = [enrich_demography:git, enrich_areas_of_code:git, enrich_onion:git] + +#[github] +#api-token = +#enterprise-url = +#raw_index = github_demo_raw +#sleep-for-rate = true +#sleep-time = "300" +#enriched_index = github_demo_enriched + +#[gitlab:issues] +#api-token = +#raw_index = gitlab_issues_demo_raw +#enriched_index = gitlab_issues_demo_enriched +#no-archive = true +#enterprise-url = +#sleep-for-rate = true + +#[gitlab:merge] +#api-token = +#raw_index = gitlab_merges_demo_raw +#enriched_index = gitlab_merges_demo_enriched +#no-archive = true +#enterprise-url = +#category = merge_request +#sleep-for-rate = true + +#[jira] +#raw_index = jira_demo_raw +#enriched_index = jira_demo_enriched +#no-archive = true + +#[pipermail] +#raw_index = pipermail_demo_raw +#enriched_index = pipermail_demo_enriched +#no-verify = true + +#[mediawiki] +#raw_index = mediawiki_demo_raw +#enriched_index = mediawiki_demo_enriched +#no-archive = true + +#[meetup] +#raw_index = meetup_demo_raw +#enriched_index = meetup_demo_enriched +#api-token = +#no-archive = true +#sleep-for-rate = true +#sleep-time = "300" + +#[stackexchange] +#raw_index = stackexchange_demo_raw +#enriched_index = stackexchange_demo_enriched +#api-token = +#no-archive = true + +#[slack] +#raw_index = slack_demo_raw +#enriched_index = slack_demo_enriched +#api-token = +#no-archive = true + +#[supybot] +#raw_index = supybot_demo_raw +#enriched_index = supybot_demo_enriched + +#[twitter] +#raw_index = twitter_demo_raw +#enriched_index = twitter_demo_enriched +#api-token = +#no-archive = true +#sleep-for-rate = true +#sleep-time = 300 + +## studies based on enriched indexes + +[enrich_demography:git] + +[enrich_areas_of_code:git] +in_index = git_demo_raw +out_index = git-aoc_demo_enriched + +[enrich_onion:git] +in_index = git +out_index = git-onion_demo_enriched +contribs_field = hash +{{- end }} diff --git a/charts/mordred/templates/_mordred_projects.tpl b/charts/mordred/templates/_mordred_projects.tpl new file mode 100644 index 00000000..1f8b2785 --- /dev/null +++ b/charts/mordred/templates/_mordred_projects.tpl @@ -0,0 +1,15 @@ +{{/* + Mordred project config +*/}} +{{- define "config.mordredProject" -}} +{ + "grimoireLab": { + "meta": { + "title": "GrimoireLab" + }, + "git": [ + "https://github.com/chaoss/grimoirelab.git" + ] + } + } +{{- end }} diff --git a/charts/mordred/templates/deployment.yaml b/charts/mordred/templates/deployment.yaml new file mode 100644 index 00000000..f34fdce4 --- /dev/null +++ b/charts/mordred/templates/deployment.yaml @@ -0,0 +1,59 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: "{{ .Values.appConfig.name }}" + labels: + app: "{{ .Values.appConfig.name }}" + {{- include "metadata.mordred.pod.labels" . | nindent 4 }} + annotations: + {{- include "metadata.mordred.pod.annotations" . | nindent 4 }} + +spec: + replicas: {{ .Values.appConfig.replicas }} + selector: + matchLabels: + app: "{{ .Values.appConfig.name }}" + template: + metadata: + labels: + app: "{{ .Values.appConfig.name }}" + {{- include "metadata.mordred.pod.labels" . | nindent 8 }} + annotations: + {{- include "metadata.mordred.pod.annotations" . | nindent 8 }} + spec: + {{- with .Values.global.topologyConfig }} + {{- toYaml . | nindent 6 }} + {{- end }} + terminationGracePeriodSeconds: 10 + {{- with .Values.global.imagePullSecrets}} + imagePullSecrets: + {{- toYaml . | nindent 8}} + {{- end}} + containers: + - name: mordred + image: {{ .Values.appConfig.image }} + ports: + - containerPort: {{ .Values.service.targetPort }} + # v ---- Volume mount define ---- + {{- if .Values.dependencies.storage.enabled }} + volumeMounts: + {{- include "template.volumeMount" . | nindent 12 }} + {{- end }} + # ^ ---- Volume mount define ---- + # v ---- Resources define ---- + resources: + {{- include "template.resQuota" . | nindent 12 }} + # ^ ---- Resources define ---- + env: + {{- include "nativeEnv.mordred" . | nindent 12 }} + {{- with .Values.extraEnvs }} + {{- toYaml . | nindent 12 }} + {{- end }} + # v ---- Volumes define ---- + {{- if .Values.dependencies.storage.enabled }} + volumes: + {{- range .Values.dependencies.storage.volumes }} + {{- include "template.volumes" (dict "item" . "root" $ ) | nindent 8 }} + {{- end }} + {{- end }} + # ^ ---- Volumes define ---- diff --git a/charts/mordred/templates/pvc.yaml b/charts/mordred/templates/pvc.yaml new file mode 100644 index 00000000..babc5bee --- /dev/null +++ b/charts/mordred/templates/pvc.yaml @@ -0,0 +1,3 @@ +{{- range .Values.dependencies.storage.volumes }} +{{- include "template.pvc" ( dict "item" . "root" $ ) }} +{{- end }} diff --git a/charts/mordred/templates/service.yaml b/charts/mordred/templates/service.yaml new file mode 100644 index 00000000..8c003ae5 --- /dev/null +++ b/charts/mordred/templates/service.yaml @@ -0,0 +1,11 @@ +apiVersion: v1 +kind: Service +metadata: + name: "{{ .Values.appConfig.name }}" + labels: + app: "{{ .Values.appConfig.name }}" + {{- include "metadata.mordred.service.labels" . | nindent 4 }} + annotations: + {{- include "metadata.mordred.service.annotations" . | nindent 4 }} +spec: + {{- include "template.service" . | nindent 2 }} diff --git a/charts/mordred/values.yaml b/charts/mordred/values.yaml new file mode 100644 index 00000000..35834cb7 --- /dev/null +++ b/charts/mordred/values.yaml @@ -0,0 +1,36 @@ +global: + topologyConfig: {} + imagePullSecrets: [] + imageRegistry: "" + appName: "" + +install: true + +appConfig: + name: "mordred" + replicas: 1 + image: docker.io/grimoirelab/grimoirelab:latest + pullPolicy: "IfNotPresent" + labels: {} + annotations: {} + resources: + cpu: + limits: "" + requests: "" + memory: + limits: "" + requests: "" + +dependencies: + storage: + enabled: false + volumes: [] + +service: + labels: {} + annotations: {} + targetPort: 8000 + scheme: "http" + type: "" # Default to "ClusterIP" + +extraEnvs: [] diff --git a/charts/nginx/Chart.yaml b/charts/nginx/Chart.yaml new file mode 100644 index 00000000..62f91278 --- /dev/null +++ b/charts/nginx/Chart.yaml @@ -0,0 +1,10 @@ +apiVersion: v2 +name: nginx +description: Official Nginx build. +home: https://github.com/nginxinc/docker-nginx +icon: https://hub.docker.com/api/media/repos_logo/v1/library%2Fnginx +maintainers: +- name: Arie + url: https://github.com/Eroyi +appVersion: 1.27.2 +version: 1.0 diff --git a/charts/nginx/templates/_helper.tpl b/charts/nginx/templates/_helper.tpl new file mode 100644 index 00000000..f16f6202 --- /dev/null +++ b/charts/nginx/templates/_helper.tpl @@ -0,0 +1,36 @@ +{/* +Mordred labels +*/}} +{{- define "metadata.nginx.pod.labels" -}} +{{- range $name, $value := .Values.appConfig.labels }} +{{ $name }}: {{ $value | quote }} +{{- end -}} +{{- end -}} + +{{/* +Mordred annotations +*/}} +{{- define "metadata.nginx.pod.annotations" -}} +{{- range $name, $value := .Values.appConfig.annotations }} +{{ $name }}: {{ $value | quote }} +{{- end -}} +{{- end -}} + + +{{/* +Mordred Service labels +*/}} +{{- define "metadata.nginx.service.labels" -}} +{{- range $name, $value := .Values.service.labels }} +{{ $name }}: {{ $value | quote }} +{{- end -}} +{{- end -}} + +{{/* +Mordred Service annotations +*/}} +{{- define "metadata.nginx.service.annotations" -}} +{{- range $name, $value := .Values.service.annotations }} +{{ $name }}: {{ $value | quote }} +{{- end -}} +{{- end -}} diff --git a/charts/nginx/templates/_nginx-config.tpl b/charts/nginx/templates/_nginx-config.tpl new file mode 100644 index 00000000..abbf8221 --- /dev/null +++ b/charts/nginx/templates/_nginx-config.tpl @@ -0,0 +1,61 @@ +{{/* +uwsgi params config for nginx +*/}} +{{- define "config.uwsgiParams" -}} +uwsgi_param QUERY_STRING $query_string; +uwsgi_param REQUEST_METHOD $request_method; +uwsgi_param CONTENT_TYPE $content_type; +uwsgi_param CONTENT_LENGTH $content_length; +uwsgi_param REQUEST_URI $request_uri; +uwsgi_param PATH_INFO $document_uri; +uwsgi_param DOCUMENT_ROOT $document_root; +uwsgi_param SERVER_PROTOCOL $server_protocol; +uwsgi_param HTTPS $https if_not_empty; +uwsgi_param REMOTE_ADDR $remote_addr; +uwsgi_param REMOTE_PORT $remote_port; +uwsgi_param SERVER_PORT $server_port; +uwsgi_param SERVER_NAME $server_name; +{{- end }} + +{{/* +nginx config +*/}} +{{- define "config.nginxConf" -}} +upstream sortinghat { + server sortinghat:{{ include "port.sortinghat" . }}; +} +server { + include mime.types; + sendfile on; + listen {{ include "port.nginxListen" . }}; + + server_name localhost nginx; + + location / { + proxy_pass ${KIBANA_HOST}; + proxy_redirect ${KIBANA_HOST} /; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection 'upgrade'; + proxy_set_header Host $host; + proxy_cache_bypass $http_upgrade; + } + + location /identities { + rewrite ^/identities/(.*) /$1 break; + + include /etc/nginx/uwsgi_params; + uwsgi_pass sortinghat; + uwsgi_param Host $host; + uwsgi_param X-Real-IP $remote_addr; + uwsgi_param X-Forwarded-For $proxy_add_x_forwarded_for; + uwsgi_param X-Forwarded-Proto $http_x_forwarded_proto; + } + + location ~ ^/identities/(css|js|fonts)/ { + rewrite ^/identities/(.*) /$1 break; + + root /sortinghat; + } +} +{{- end }} diff --git a/charts/nginx/templates/_ports.tpl b/charts/nginx/templates/_ports.tpl new file mode 100644 index 00000000..59e46fbd --- /dev/null +++ b/charts/nginx/templates/_ports.tpl @@ -0,0 +1,6 @@ +{{/* +Port catalogs for all services +*/}} +{{- define "nginx-listen.port" -}} +{{ ".Values.nginx.service.targetPort" | default "8000" }} +{{- end }} diff --git a/charts/nginx/templates/deployment.yaml b/charts/nginx/templates/deployment.yaml new file mode 100644 index 00000000..57e0c1c7 --- /dev/null +++ b/charts/nginx/templates/deployment.yaml @@ -0,0 +1,59 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: "{{ .Values.appConfig.name }}" + labels: + app: "{{ .Values.appConfig.name }}" + {{- include "metadata.nginx.pod.labels" . | nindent 4 }} + annotations: + {{- include "metadata.nginx.pod.annotations" . | nindent 4 }} + +spec: + replicas: {{ .Values.appConfig.replicas }} + selector: + matchLabels: + app: "{{ .Values.appConfig.name }}" + template: + metadata: + labels: + app: "{{ .Values.appConfig.name }}" + {{- include "metadata.nginx.pod.labels" . | nindent 8 }} + annotations: + {{- include "metadata.nginx.pod.annotations" . | nindent 8 }} + spec: + {{- with .Values.global.topologyConfig }} + {{- toYaml . | nindent 6 }} + {{- end }} + terminationGracePeriodSeconds: 10 + {{- with .Values.global.imagePullSecrets}} + imagePullSecrets: + {{- toYaml . | nindent 8}} + {{- end}} + containers: + - name: nginx + image: {{ .Values.appConfig.image }} + ports: + - containerPort: {{ .Values.service.targetPort }} + # v ---- Volume mount define ---- + {{- if .Values.dependencies.storage.enabled }} + volumeMounts: + {{- include "template.volumeMount" . | nindent 12 }} + {{- end }} + # ^ ---- Volume mount define ---- + # v ---- Resources define ---- + resources: + {{- include "template.resQuota" . | nindent 12 }} + # ^ ---- Resources define ---- + env: + {{- include "nativeEnv.nginx" . | nindent 12 }} + {{- with .Values.extraEnvs }} + {{- toYaml . | nindent 12 }} + {{- end }} + # v ---- Volumes define ---- + {{- if .Values.dependencies.storage.enabled }} + volumes: + {{- range .Values.dependencies.storage.volumes }} + {{- include "template.volumes" (dict "item" . "root" $ ) | nindent 8 }} + {{- end }} + {{- end }} + # ^ ---- Volumes define ---- diff --git a/charts/nginx/templates/pvc.yaml b/charts/nginx/templates/pvc.yaml new file mode 100644 index 00000000..babc5bee --- /dev/null +++ b/charts/nginx/templates/pvc.yaml @@ -0,0 +1,3 @@ +{{- range .Values.dependencies.storage.volumes }} +{{- include "template.pvc" ( dict "item" . "root" $ ) }} +{{- end }} diff --git a/charts/nginx/templates/service.yaml b/charts/nginx/templates/service.yaml new file mode 100644 index 00000000..f765af6a --- /dev/null +++ b/charts/nginx/templates/service.yaml @@ -0,0 +1,11 @@ +apiVersion: v1 +kind: Service +metadata: + name: "{{ .Values.appConfig.name }}" + labels: + app: "{{ .Values.appConfig.name }}" + {{- include "metadata.nginx.service.labels" . | nindent 4 }} + annotations: + {{- include "metadata.nginx.service.annotations" . | nindent 4 }} +spec: + {{- include "template.service" . | nindent 2 }} diff --git a/charts/nginx/values.yaml b/charts/nginx/values.yaml new file mode 100644 index 00000000..4153126e --- /dev/null +++ b/charts/nginx/values.yaml @@ -0,0 +1,47 @@ +global: + topologyConfig: {} + imagePullSecrets: [] + imageRegistry: "" + appName: "" + +install: true + +appConfig: + name: "nginx" + replicas: 1 + image: docker.io/nginx:1.27.2 + pullPolicy: IfNotPresent + + labels: {} + annotations: {} + resources: + cpu: + limits: "" + requests: "" + memory: + limits: "" + requests: "" + +dependencies: + storage: + enabled: true + volumes: + - name: "nginx-conf-template" + mountPath: "/etc/nginx/templates/default.conf.template" + type: configmap + subPath: "nginx-conf-template" + - name: "uwsgi-params" + mountPath: "/etc/nginx/uwsgi_params" + type: configmap + subPath: "uwsgi-params" + - name: "sortinghat-static" + mountPath: "/sortinghat" + type: pvc +service: + labels: {} + annotations: {} + targetPort: 8000 + scheme: "http" + type: "" # Default to "ClusterIP" + +extraEnvs: [] \ No newline at end of file diff --git a/charts/opensearch-dashboard/Chart.yaml b/charts/opensearch-dashboard/Chart.yaml new file mode 100644 index 00000000..da2cd644 --- /dev/null +++ b/charts/opensearch-dashboard/Chart.yaml @@ -0,0 +1,10 @@ +apiVersion: v2 +name: opensearch-dashboard +description: OpenSearch is a scalable, flexible, and extensible open-source software suite for search, analytics, and observability applications derived from Elasticsearch 7.10.2 and Kibana 7.10.2 and licensed under Apache 2.0. +home: https://opensearch.org/ +icon: https://www.gravatar.com/avatar/28cb77e720377dcf01e9fee30967c128 +maintainers: +- name: Arie + url: https://github.com/Eroyi +appVersion: 2.11.1 +version: 1.0 diff --git a/charts/opensearch-dashboard/templates/_helper.tpl b/charts/opensearch-dashboard/templates/_helper.tpl new file mode 100644 index 00000000..0e6d3556 --- /dev/null +++ b/charts/opensearch-dashboard/templates/_helper.tpl @@ -0,0 +1,36 @@ +{{/* +Opensearch Dashboard labels +*/}} +{{- define "metadata.opensearchDashboard.pod.labels" -}} +{{- range $name, $value := .Values.appConfig.labels }} +{{ $name }}: {{ $value | quote }} +{{- end -}} +{{- end -}} + +{{/* +Opensearch Dashboard annotations +*/}} +{{- define "metadata.opensearchDashboard.pod.annotations" -}} +{{- range $name, $value := .Values.appConfig.annotations }} +{{ $name }}: {{ $value | quote }} +{{- end -}} +{{- end -}} + + +{{/* +Opensearch Dashboard Service labels +*/}} +{{- define "metadata.opensearchDashboard.service.labels" -}} +{{- range $name, $value := .Values.service.labels }} +{{ $name }}: {{ $value | quote }} +{{- end -}} +{{- end -}} + +{{/* +Opensearch Dashboard Service annotations +*/}} +{{- define "metadata.opensearchDashboard.service.annotations" -}} +{{- range $name, $value := .Values.service.annotations }} +{{ $name }}: {{ $value | quote }} +{{- end -}} +{{- end -}} diff --git a/charts/opensearch-dashboard/templates/_ports.tpl b/charts/opensearch-dashboard/templates/_ports.tpl new file mode 100644 index 00000000..9feace61 --- /dev/null +++ b/charts/opensearch-dashboard/templates/_ports.tpl @@ -0,0 +1,6 @@ +{{/* +Port catalogs for all services +*/}} +{{- define "opensearch-dashboard.port" -}} +{{ ".Values.opensearch-dashboard.service.targetPort" | default "5601" }} +{{- end }} diff --git a/charts/opensearch-dashboard/templates/deployment.yaml b/charts/opensearch-dashboard/templates/deployment.yaml new file mode 100644 index 00000000..2f1080f4 --- /dev/null +++ b/charts/opensearch-dashboard/templates/deployment.yaml @@ -0,0 +1,59 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: "{{ .Values.appConfig.name }}" + labels: + app: "{{ .Values.appConfig.name }}" + {{- include "metadata.opensearchDashboard.pod.labels" . | nindent 4 }} + annotations: + {{- include "metadata.opensearchDashboard.pod.annotations" . | nindent 4 }} + +spec: + replicas: {{ .Values.appConfig.replicas }} + selector: + matchLabels: + app: "{{ .Values.appConfig.name }}" + template: + metadata: + labels: + app: "{{ .Values.appConfig.name }}" + {{- include "metadata.opensearchDashboard.pod.labels" . | nindent 8 }} + annotations: + {{- include "metadata.opensearchDashboard.pod.annotations" . | nindent 8 }} + spec: + {{- with .Values.global.topologyConfig }} + {{- toYaml . | nindent 6 }} + {{- end }} + terminationGracePeriodSeconds: 10 + {{- with .Values.global.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end}} + containers: + - name: opensearch-dashboard + image: {{ .Values.appConfig.image }} + ports: + - containerPort: {{ .Values.service.targetPort }} + # v ---- Volume mount define ---- + {{- if .Values.dependencies.storage.enabled }} + volumeMounts: + {{- include "template.volumeMount" . | nindent 12 }} + {{- end }} + # ^ ---- Volume mount define ---- + # v ---- Resources define ---- + resources: + {{- include "template.resQuota" . | nindent 12 }} + # ^ ---- Resources define ---- + env: + {{- include "nativeEnv.opensearchDashboard" . | nindent 12 }} + {{- with .Values.extraEnvs }} + {{- toYaml . | nindent 12 }} + {{- end }} + # v ---- Volumes define ---- + {{- if .Values.dependencies.storage.enabled }} + volumes: + {{- range .Values.dependencies.storage.volumes }} + {{- include "template.volumes" (dict "item" . "root" $ ) | nindent 8 }} + {{- end }} + {{- end }} + # ^ ---- Volumes define ---- diff --git a/charts/opensearch-dashboard/templates/pvc.yaml b/charts/opensearch-dashboard/templates/pvc.yaml new file mode 100644 index 00000000..babc5bee --- /dev/null +++ b/charts/opensearch-dashboard/templates/pvc.yaml @@ -0,0 +1,3 @@ +{{- range .Values.dependencies.storage.volumes }} +{{- include "template.pvc" ( dict "item" . "root" $ ) }} +{{- end }} diff --git a/charts/opensearch-dashboard/templates/service.yaml b/charts/opensearch-dashboard/templates/service.yaml new file mode 100644 index 00000000..4eec6ab7 --- /dev/null +++ b/charts/opensearch-dashboard/templates/service.yaml @@ -0,0 +1,11 @@ +apiVersion: v1 +kind: Service +metadata: + name: "{{ .Values.appConfig.name }}" + labels: + app: "{{ .Values.appConfig.name }}" + {{- include "metadata.opensearchDashboard.service.labels" . | nindent 4 }} + annotations: + {{- include "metadata.opensearchDashboard.service.annotations" . | nindent 4 }} +spec: + {{- include "template.service" . | nindent 2 }} diff --git a/charts/opensearch-dashboard/values.yaml b/charts/opensearch-dashboard/values.yaml new file mode 100644 index 00000000..8418d561 --- /dev/null +++ b/charts/opensearch-dashboard/values.yaml @@ -0,0 +1,37 @@ +global: + topologyConfig: {} + imagePullSecrets: [] + imageRegistry: "" + appName: "" + +install: true + +appConfig: + name: "opensearch-dashboard" + replicas: 1 + image: docker.io/opensearchproject/opensearch-dashboards:2.11.1 + pullPolicy: IfNotPresent + + labels: {} + annotations: {} + resources: + cpu: + limits: "" + requests: "" + memory: + limits: "" + requests: "" + +dependencies: + storage: + enabled: false + volumes: [] + +service: + labels: {} + annotations: {} + targetPort: 5601 + scheme: "http" + type: "" # Default to "ClusterIP" + +extraEnvs: [] diff --git a/charts/opensearch-node/Chart.yaml b/charts/opensearch-node/Chart.yaml new file mode 100644 index 00000000..91520c08 --- /dev/null +++ b/charts/opensearch-node/Chart.yaml @@ -0,0 +1,10 @@ +apiVersion: v2 +name: opensearch-node +description: OpenSearch is a scalable, flexible, and extensible open-source software suite for search, analytics, and observability applications derived from Elasticsearch 7.10.2 and Kibana 7.10.2 and licensed under Apache 2.0. +home: https://opensearch.org/ +icon: https://www.gravatar.com/avatar/28cb77e720377dcf01e9fee30967c128 +maintainers: +- name: Arie + url: https://github.com/Eroyi +appVersion: 2.11.1 +version: 1.0 diff --git a/charts/opensearch-node/templates/_helper.tpl b/charts/opensearch-node/templates/_helper.tpl new file mode 100644 index 00000000..de292dd6 --- /dev/null +++ b/charts/opensearch-node/templates/_helper.tpl @@ -0,0 +1,36 @@ +{{/* +Opensearch labels +*/}} +{{- define "metadata.opensearchNode.pod.labels" -}} +{{- range $name, $value := .Values.appConfig.labels }} +{{ $name }}: {{ $value | quote }} +{{- end -}} +{{- end -}} + +{{/* +Opensearch annotations +*/}} +{{- define "metadata.opensearchNode.pod.annotations" -}} +{{- range $name, $value := .Values.appConfig.annotations }} +{{ $name }}: {{ $value | quote }} +{{- end -}} +{{- end -}} + + +{{/* +Opensearch Service labels +*/}} +{{- define "metadata.opensearchNode.service.labels" -}} +{{- range $name, $value := .Values.service.labels }} +{{ $name }}: {{ $value | quote }} +{{- end -}} +{{- end -}} + +{{/* +Opensearch Service annotations +*/}} +{{- define "metadata.opensearchNode.service.annotations" -}} +{{- range $name, $value := .Values.service.annotations }} +{{ $name }}: {{ $value | quote }} +{{- end -}} +{{- end -}} diff --git a/charts/opensearch-node/templates/_ports.tpl b/charts/opensearch-node/templates/_ports.tpl new file mode 100644 index 00000000..552c5c37 --- /dev/null +++ b/charts/opensearch-node/templates/_ports.tpl @@ -0,0 +1,6 @@ +{{/* +Port catalogs for all services +*/}} +{{- define "opensearch-node.port" -}} +{{ ".Values.opensearch-node.service.targetPort" | default "9200" }} +{{- end }} diff --git a/charts/opensearch-node/templates/deployment.yaml b/charts/opensearch-node/templates/deployment.yaml new file mode 100644 index 00000000..7fb7d403 --- /dev/null +++ b/charts/opensearch-node/templates/deployment.yaml @@ -0,0 +1,64 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: "{{ .Values.appConfig.name }}" + labels: + app: "{{ .Values.appConfig.name }}" + {{- include "metadata.opensearchNode.pod.labels" . | nindent 4 }} + annotations: + {{- include "metadata.opensearchNode.pod.annotations" . | nindent 4 }} + +spec: + replicas: {{ .Values.appConfig.replicas }} + selector: + matchLabels: + app: "{{ .Values.appConfig.name }}" + template: + metadata: + labels: + app: "{{ .Values.appConfig.name }}" + {{- include "metadata.opensearchNode.pod.labels" . | nindent 8 }} + annotations: + {{- include "metadata.opensearchNode.pod.annotations" . | nindent 8 }} + spec: + {{- with .Values.global.topologyConfig }} + {{- toYaml . | nindent 6 }} + {{- end }} + {{- if hasKey .Values.appConfig "security" }} + securityContext: + runAsUser: {{ .Values.appConfig.security.userID }} + runAsGroup: {{ .Values.appConfig.security.groupID }} + {{- end }} + terminationGracePeriodSeconds: 10 + {{- with .Values.global.imagePullSecrets}} + imagePullSecrets: + {{- toYaml . | nindent 8}} + {{- end}} + containers: + - name: opensearch-node + image: {{ .Values.appConfig.image }} + ports: + - containerPort: {{ .Values.service.targetPort }} + # v ---- Volume mount define ---- + {{- if .Values.dependencies.storage.enabled }} + volumeMounts: + {{- include "template.volumeMount" . | nindent 12 }} + {{- end }} + # ^ ---- Volume mount define ---- + # v ---- Resources define ---- + resources: + {{- include "template.resQuota" . | nindent 12 }} + # ^ ---- Resources define ---- + env: + {{- include "nativeEnv.opensearchNode" . | nindent 12 }} + {{- with .Values.extraEnvs }} + {{- toYaml . | nindent 12 }} + {{- end }} + # v ---- Volumes define ---- + {{- if .Values.dependencies.storage.enabled }} + volumes: + {{- range .Values.dependencies.storage.volumes }} + {{- include "template.volumes" (dict "item" . "root" $ ) | nindent 8 }} + {{- end }} + {{- end }} + # ^ ---- Volumes define ---- diff --git a/charts/opensearch-node/templates/pvc.yaml b/charts/opensearch-node/templates/pvc.yaml new file mode 100644 index 00000000..babc5bee --- /dev/null +++ b/charts/opensearch-node/templates/pvc.yaml @@ -0,0 +1,3 @@ +{{- range .Values.dependencies.storage.volumes }} +{{- include "template.pvc" ( dict "item" . "root" $ ) }} +{{- end }} diff --git a/charts/opensearch-node/templates/service.yaml b/charts/opensearch-node/templates/service.yaml new file mode 100644 index 00000000..4c94d5a2 --- /dev/null +++ b/charts/opensearch-node/templates/service.yaml @@ -0,0 +1,11 @@ +apiVersion: v1 +kind: Service +metadata: + name: "{{ .Values.appConfig.name }}" + labels: + app: "{{ .Values.appConfig.name }}" + {{- include "metadata.opensearchNode.service.labels" . | nindent 4 }} + annotations: + {{- include "metadata.opensearchNode.service.annotations" . | nindent 4 }} +spec: + {{- include "template.service" . | nindent 2 }} diff --git a/charts/opensearch-node/values.yaml b/charts/opensearch-node/values.yaml new file mode 100644 index 00000000..3da1b34a --- /dev/null +++ b/charts/opensearch-node/values.yaml @@ -0,0 +1,45 @@ +global: + topologyConfig: {} + imagePullSecrets: [] + imageRegistry: "" + appName: "" + +install: true + +appConfig: + name: "opensearch-node" + replicas: 1 + image: docker.io/opensearchproject/opensearch:2.11.1 + pullPolicy: IfNotPresent + + labels: {} + annotations: {} + resources: + cpu: + limits: "" + requests: "" + memory: + limits: "" + requests: "" + security: + userID: 1000 + groupID: 1000 + +dependencies: + storage: + enabled: true + volumes: + - name: "opensearch-data" + mountPath: "/usr/share/opensearch/data" + type: pvc + storageClass: efs-sc + size: 1Gi + +service: + labels: {} + annotations: {} + targetPort: 9200 + scheme: "http" + type: "" # Default to "ClusterIP" + +extraEnvs: [] diff --git a/charts/sortinghat-worker/Chart.yaml b/charts/sortinghat-worker/Chart.yaml new file mode 100644 index 00000000..3575d5b8 --- /dev/null +++ b/charts/sortinghat-worker/Chart.yaml @@ -0,0 +1,10 @@ +apiVersion: v2 +name: sortinghat-worker +description: Sortinghat worker for GrimoireLab. +home: https://github.com/chaoss/grimoirelab +icon: https://www.gravatar.com/avatar/4154acefea56ed23bddaaa47a4850400 +maintainers: +- name: Arie + url: https://github.com/Eroyi +appVersion: 1.7.0 #Based on the "Github Release" version (which is the docker image tag referring from), not the actual application version. +version: 1.0 diff --git a/charts/sortinghat-worker/templates/_helper.tpl b/charts/sortinghat-worker/templates/_helper.tpl new file mode 100644 index 00000000..b0bbc1de --- /dev/null +++ b/charts/sortinghat-worker/templates/_helper.tpl @@ -0,0 +1,36 @@ +{{/* +Sortinghat labels +*/}} +{{- define "metadata.sortinghatWorker.pod.labels" -}} +{{- range $name, $value := .Values.appConfig.labels }} +{{ $name }}: {{ $value | quote }} +{{- end -}} +{{- end -}} + +{{/* +Sortinghat annotations +*/}} +{{- define "metadata.sortinghatWorker.pod.annotations" -}} +{{- range $name, $value := .Values.appConfig.annotations }} +{{ $name }}: {{ $value | quote }} +{{- end -}} +{{- end -}} + + +{{/* +Sortinghat Service labels +*/}} +{{- define "metadata.sortinghatWorker.service.labels" -}} +{{- range $name, $value := .Values.service.labels }} +{{ $name }}: {{ $value | quote }} +{{- end -}} +{{- end -}} + +{{/* +Sortinghat Service annotations +*/}} +{{- define "metadata.sortinghatWorker.service.annotations" -}} +{{- range $name, $value := .Values.service.annotations }} +{{ $name }}: {{ $value | quote }} +{{- end -}} +{{- end -}} diff --git a/charts/sortinghat-worker/templates/_ports.tpl b/charts/sortinghat-worker/templates/_ports.tpl new file mode 100644 index 00000000..4625205d --- /dev/null +++ b/charts/sortinghat-worker/templates/_ports.tpl @@ -0,0 +1,6 @@ +{{/* +Port catalogs for all services +*/}} +{{- define "sortinghat-worker.port" -}} +{{ ".Values.sortinghat-worker.service.targetPort" | default "9314" }} +{{- end }} diff --git a/charts/sortinghat-worker/templates/deployment.yaml b/charts/sortinghat-worker/templates/deployment.yaml new file mode 100644 index 00000000..f829644e --- /dev/null +++ b/charts/sortinghat-worker/templates/deployment.yaml @@ -0,0 +1,59 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: "{{ .Values.appConfig.name }}" + labels: + app: "{{ .Values.appConfig.name }}" + {{- include "metadata.sortinghatWorker.pod.labels" . | nindent 4 }} + annotations: + {{- include "metadata.sortinghatWorker.pod.annotations" . | nindent 4 }} + +spec: + replicas: {{ .Values.appConfig.replicas }} + selector: + matchLabels: + app: "{{ .Values.appConfig.name }}" + template: + metadata: + labels: + app: "{{ .Values.appConfig.name }}" + {{- include "metadata.sortinghatWorker.pod.labels" . | nindent 8 }} + annotations: + {{- include "metadata.sortinghatWorker.pod.annotations" . | nindent 8 }} + spec: + {{- with .Values.global.topologyConfig }} + {{- toYaml . | nindent 6 }} + {{- end }} + terminationGracePeriodSeconds: 10 + {{- with .Values.global.imagePullSecrets}} + imagePullSecrets: + {{- toYaml . | nindent 8}} + {{- end}} + containers: + - name: sortinghat + image: {{ .Values.appConfig.image }} + ports: + - containerPort: {{ .Values.service.targetPort }} + # v ---- Volume mount define ---- + {{- if .Values.dependencies.storage.enabled }} + volumeMounts: + {{- include "template.volumeMount" . | nindent 12 }} + {{- end }} + # ^ ---- Volume mount define ---- + # v ---- Resources define ---- + resources: + {{- include "template.resQuota" . | nindent 12 }} + # ^ ---- Resources define ---- + env: + {{- include "nativeEnv.sortinghatWorker" . | nindent 12 }} + {{- with .Values.extraEnvs }} + {{- toYaml . | nindent 12 }} + {{- end }} + # v ---- Volumes define ---- + {{- if .Values.dependencies.storage.enabled }} + volumes: + {{- range .Values.dependencies.storage.volumes }} + {{- include "template.volumes" (dict "item" . "root" $ ) | nindent 8 }} + {{- end }} + {{- end }} + # ^ ---- Volumes define ---- diff --git a/charts/sortinghat-worker/templates/pvc.yaml b/charts/sortinghat-worker/templates/pvc.yaml new file mode 100644 index 00000000..babc5bee --- /dev/null +++ b/charts/sortinghat-worker/templates/pvc.yaml @@ -0,0 +1,3 @@ +{{- range .Values.dependencies.storage.volumes }} +{{- include "template.pvc" ( dict "item" . "root" $ ) }} +{{- end }} diff --git a/charts/sortinghat-worker/templates/service.yaml b/charts/sortinghat-worker/templates/service.yaml new file mode 100644 index 00000000..33ad470c --- /dev/null +++ b/charts/sortinghat-worker/templates/service.yaml @@ -0,0 +1,11 @@ +apiVersion: v1 +kind: Service +metadata: + name: "{{ .Values.appConfig.name }}" + labels: + app: "{{ .Values.appConfig.name }}" + {{- include "metadata.sortinghatWorker.service.labels" . | nindent 4 }} + annotations: + {{- include "metadata.sortinghatWorker.service.annotations" . | nindent 4 }} +spec: + {{- include "template.service" . | nindent 2 }} diff --git a/charts/sortinghat-worker/values.yaml b/charts/sortinghat-worker/values.yaml new file mode 100644 index 00000000..b391cbc2 --- /dev/null +++ b/charts/sortinghat-worker/values.yaml @@ -0,0 +1,37 @@ +global: + topologyConfig: {} + imagePullSecrets: [] + imageRegistry: "" + appName: "" + +install: true + +appConfig: + name: sortinghat-worker + replicas: 1 + image: docker.io/grimoirelab/sortinghat-worker:latest + pullPolicy: IfNotPresent + + labels: {} + annotations: {} + resources: + cpu: + limits: "" + requests: "" + memory: + limits: "" + requests: "" + +dependencies: + storage: + enabled: false + volumes: [] + +service: + labels: {} + annotations: {} + targetPort: 9314 + scheme: "http" + type: "" # Default to "ClusterIP" + +extraEnvs: [] diff --git a/charts/sortinghat/Chart.yaml b/charts/sortinghat/Chart.yaml new file mode 100644 index 00000000..364f9a6a --- /dev/null +++ b/charts/sortinghat/Chart.yaml @@ -0,0 +1,10 @@ +apiVersion: v2 +name: sortinghat +description: Sortinghat service for GrimoireLab, a tool to manage identities. +home: https://github.com/chaoss/grimoirelab +icon: https://www.gravatar.com/avatar/4154acefea56ed23bddaaa47a4850400 +maintainers: +- name: Arie + url: https://github.com/Eroyi +appVersion: 1.7.0 #Based on the "Github Release" version (which is the docker image tag referring from), not the actual application version. +version: 1.0 diff --git a/charts/sortinghat/templates/_helper.tpl b/charts/sortinghat/templates/_helper.tpl new file mode 100644 index 00000000..b6cb2b6c --- /dev/null +++ b/charts/sortinghat/templates/_helper.tpl @@ -0,0 +1,36 @@ +{{/* +Sortinghat labels +*/}} +{{- define "metadata.sortinghat.pod.labels" -}} +{{- range $name, $value := .Values.appConfig.labels }} +{{ $name }}: {{ $value | quote }} +{{- end -}} +{{- end -}} + +{{/* +Sortinghat annotations +*/}} +{{- define "metadata.sortinghat.pod.annotations" -}} +{{- range $name, $value := .Values.appConfig.annotations }} +{{ $name }}: {{ $value | quote }} +{{- end -}} +{{- end -}} + + +{{/* +Sortinghat Service labels +*/}} +{{- define "metadata.sortinghat.service.labels" -}} +{{- range $name, $value := .Values.service.labels }} +{{ $name }}: {{ $value | quote }} +{{- end -}} +{{- end -}} + +{{/* +Sortinghat Service annotations +*/}} +{{- define "metadata.sortinghat.service.annotations" -}} +{{- range $name, $value := .Values.service.annotations }} +{{ $name }}: {{ $value | quote }} +{{- end -}} +{{- end -}} diff --git a/charts/sortinghat/templates/_ports.tpl b/charts/sortinghat/templates/_ports.tpl new file mode 100644 index 00000000..5662d608 --- /dev/null +++ b/charts/sortinghat/templates/_ports.tpl @@ -0,0 +1,6 @@ +{{/* +Port catalogs for all services +*/}} +{{- define "sortinghat.port" -}} +{{ ".Values.sortinghat.service.targetPort" | default "9314" }} +{{- end }} diff --git a/charts/sortinghat/templates/deployment.yaml b/charts/sortinghat/templates/deployment.yaml new file mode 100644 index 00000000..1214a228 --- /dev/null +++ b/charts/sortinghat/templates/deployment.yaml @@ -0,0 +1,59 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ .Values.appConfig.name }} + labels: + app: "{{ .Values.appConfig.name }}" + {{- include "metadata.sortinghat.pod.labels" . | nindent 4 }} + annotations: + {{- include "metadata.sortinghat.pod.annotations" . | nindent 4 }} + +spec: + replicas: {{ .Values.appConfig.replicas }} + selector: + matchLabels: + app: "{{ .Values.appConfig.name }}" + template: + metadata: + labels: + app: "{{ .Values.appConfig.name }}" + {{- include "metadata.sortinghat.pod.labels" . | nindent 8 }} + annotations: + {{- include "metadata.sortinghat.pod.annotations" . | nindent 8 }} + spec: + {{- with .Values.global.topologyConfig }} + {{- toYaml . | nindent 6 }} + {{- end }} + terminationGracePeriodSeconds: 10 + {{- with .Values.global.imagePullSecrets}} + imagePullSecrets: + {{- toYaml . | nindent 8}} + {{- end}} + containers: + - name: sortinghat + image: {{ .Values.appConfig.image }} + ports: + - containerPort: {{ .Values.service.targetPort }} + # v ---- Volume mount define ---- + {{- if .Values.dependencies.storage.enabled }} + volumeMounts: + {{- include "template.volumeMount" . | nindent 12 }} + {{- end }} + # ^ ---- Volume mount define ---- + # v ---- Resources define ---- + resources: + {{- include "template.resQuota" . | nindent 12 }} + # ^ ---- Resources define ---- + env: + {{- include "nativeEnv.sortinghat" . | nindent 12 }} + {{- with .Values.extraEnvs }} + {{- toYaml . | nindent 12 }} + {{- end }} + # v ---- Volumes define ---- + {{- if .Values.dependencies.storage.enabled }} + volumes: + {{- range .Values.dependencies.storage.volumes }} + {{- include "template.volumes" (dict "item" . "root" $ ) | nindent 8 }} + {{- end }} + {{- end }} + # ^ ---- Volumes define ---- diff --git a/charts/sortinghat/templates/pvc.yaml b/charts/sortinghat/templates/pvc.yaml new file mode 100644 index 00000000..babc5bee --- /dev/null +++ b/charts/sortinghat/templates/pvc.yaml @@ -0,0 +1,3 @@ +{{- range .Values.dependencies.storage.volumes }} +{{- include "template.pvc" ( dict "item" . "root" $ ) }} +{{- end }} diff --git a/charts/sortinghat/templates/service.yaml b/charts/sortinghat/templates/service.yaml new file mode 100644 index 00000000..2dda92ee --- /dev/null +++ b/charts/sortinghat/templates/service.yaml @@ -0,0 +1,11 @@ +apiVersion: v1 +kind: Service +metadata: + name: "{{ .Values.appConfig.name }}" + labels: + app: "{{ .Values.appConfig.name }}" + {{- include "metadata.sortinghat.service.labels" . | nindent 4 }} + annotations: + {{- include "metadata.sortinghat.service.annotations" . | nindent 4 }} +spec: + {{- include "template.service" . | nindent 2 }} diff --git a/charts/sortinghat/values.yaml b/charts/sortinghat/values.yaml new file mode 100644 index 00000000..382efe11 --- /dev/null +++ b/charts/sortinghat/values.yaml @@ -0,0 +1,42 @@ +global: + topologyConfig: {} + imagePullSecrets: [] + imageRegistry: "" + appName: "" + +install: true + +appConfig: + name: "sortinghat" + replicas: 1 + image: docker.io/grimoirelab/sortinghat:latest + pullPolicy: IfNotPresent + + labels: {} + annotations: {} + resources: + cpu: + limits: "" + requests: "" + memory: + limits: "" + requests: "" + +dependencies: + storage: + enabled: true + volumes: + - name: "sortinghat-static" + mountPath: "/opt/venv/lib/python3.9/site-packages/sortinghat/static" + type: pvc + storageClass: efs-sc + size: 1Gi + +service: + labels: {} + annotations: {} + targetPort: 9314 + scheme: "http" + type: "" # Default to "ClusterIP" + +extraEnvs: [] diff --git a/templates/_credentials.tpl b/templates/_credentials.tpl new file mode 100644 index 00000000..ac24affa --- /dev/null +++ b/templates/_credentials.tpl @@ -0,0 +1,22 @@ +{{/* +Define various credentials recources +*/}} +{{- define "cred.database.username" -}} + {{- $username := default "root" .Values.global.credentials.database.username -}} + {{- $username -}} +{{- end }} + +{{- define "cred.database.password" -}} + {{- $password := default "mar1adb4Grim0ir3Lab" .Values.global.credentials.database.password -}} + {{- $password -}} +{{- end }} + +{{- define "cred.opensearchNode.password" -}} + {{- $password := default "O54Grim0ir3Lab" .Values.global.credentials.opensearchNode.password -}} + {{- $password -}} +{{- end }} + +{{- define "cred.redis.password" -}} + {{- $password := default "red1s4Grim0ir3Lab" .Values.global.credentials.redis.password -}} + {{- $password -}} +{{- end }} diff --git a/templates/_env.tpl b/templates/_env.tpl new file mode 100644 index 00000000..696388ec --- /dev/null +++ b/templates/_env.tpl @@ -0,0 +1,40 @@ +{{/* +Define various environment that referring from other values +*/}} +{{- define "nginx-extraEnvs.env" -}} +- name: KIBANA_HOST + value: http://opensearch-dashboard:{{ include "opensearch-dashboard.port" . }}/ +{{- end }} + +{{- define "sortinghat-extraEnvs.env" -}} +- name: SORTINGHAT_DB_USER + value: "{{ include "database-username.cred" . }}" +- name: SORTINGHAT_DB_PASSWORD + value: "{{ include "database-password.cred" . }}" +- name: SORTINGHAT_REDIS_PASSWORD + value: "{{ include "redis-password.cred" . }}" +- name: SORTINGHAT_CORS_ALLOWED_ORIGINS + value: "http://localhost:{{ include "nginx-listen.port" . }},http://127.0.0.1:{{ include "nginx-listen.port" . }},http://0.0.0.0:{{ include "nginx-listen.port" . }} +{{- end }} + +{{- define "sortinghat-worker-extraEnvs.env" -}} +- name: SORTINGHAT_DB_USER + value: "{{ include "database-username.cred" . }}" +- name: SORTINGHAT_DB_PASSWORD + value: "{{ include "database-password.cred" . }}" +- name: SORTINGHAT_REDIS_PASSWORD + value: "{{ include "redis-password.cred" . }}" +{{- end }} + +{{- define "opensearch-dashboard-extraEnvs.env" -}} +- name: OPENSEARCH_HOSTS + value: "[\"https://opensearch-node:{{ include "opensearch-node.port" . }}\"]" +{{- end }} + +{{- define "opensearch-node-extraEnvs.env" -}} +- name: OPENSEARCH_INITIAL_ADMIN_PASSWORD + value: "{{ include "opensearch-node-password.cred" . }}" +{{- end }} + +{{- define "mordred-extraEnvs.env" }} +{{- end }} \ No newline at end of file diff --git a/templates/_envs.tpl b/templates/_envs.tpl new file mode 100644 index 00000000..71cf245d --- /dev/null +++ b/templates/_envs.tpl @@ -0,0 +1,40 @@ +{{/* +Define various environment that referring from other values +*/}} +{{- define "nativeEnv.nginx" -}} +- name: KIBANA_HOST + value: "http://opensearch-dashboard:{{ include "port.opensearchDashboard" . }}/" +{{- end }} + +{{- define "nativeEnv.sortinghat" -}} +- name: SORTINGHAT_DB_USER + value: "{{ include "cred.database.username" . }}" +- name: SORTINGHAT_DB_PASSWORD + value: "{{ include "cred.database.password" . }}" +- name: SORTINGHAT_REDIS_PASSWORD + value: "{{ include "cred.redis.password" . }}" +- name: SORTINGHAT_CORS_ALLOWED_ORIGINS + value: "http://localhost:{{ include "port.nginxListen" . }},http://127.0.0.1:{{ include "port.nginxListen" . }},http://0.0.0.0:{{ include "port.nginxListen" . }}" +{{- end }} + +{{- define "nativeEnv.sortinghatWorker" -}} +- name: SORTINGHAT_DB_USER + value: "{{ include "cred.database.username" . }}" +- name: SORTINGHAT_DB_PASSWORD + value: "{{ include "cred.database.password" . }}" +- name: SORTINGHAT_REDIS_PASSWORD + value: "{{ include "cred.redis.password" . }}" +{{- end }} + +{{- define "nativeEnv.opensearchDashboard" -}} +- name: OPENSEARCH_HOSTS + value: "[\"https://opensearch-node:{{ include "port.opensearchNode" . }}\"]" +{{- end }} + +{{- define "nativeEnv.opensearchNode" -}} +- name: OPENSEARCH_INITIAL_ADMIN_PASSWORD + value: "{{ include "cred.opensearchNode.password" . }}" +{{- end }} + +{{- define "nativeEnv.mordred" }} +{{- end }} diff --git a/templates/_ports.tpl b/templates/_ports.tpl new file mode 100644 index 00000000..24c88e01 --- /dev/null +++ b/templates/_ports.tpl @@ -0,0 +1,49 @@ +{{/* +Port catalogs for all services + +{{- define "port.sortinghat" -}} +{{- printf .Values.sortinghat.service.targetPort | default "9314" }} +{{- end }} + +{{- define "port.sortinghatWorker" -}} +{{- printf .Values.sortinghatWorker.service.targetPort | default "9314" }} +{{- end }} + +{{- define "port.nginxListen" -}} +{{- printf .Values.nginx.service.targetPort | default "8000" }} +{{- end }} + +{{- define "port.opensearchNode" -}} +{{- printf .Values.opensearchNode.service.targetPort | default "9200" }} +{{- end }} + +{{- define "port.opensearchDashboard" -}} +{{- printf .Values.opensearchDashboard.service.targetPort | default "5601" }} +{{- end }} +*/}} + +{{- define "port.sortinghat" -}} + {{- $sortinghat := default 9314 -}} + {{- $sortinghat -}} +{{- end }} + +{{- define "port.sortinghatWorker" -}} + {{- $sortinghatWorker := default 9314 -}} + {{- $sortinghatWorker -}} +{{- end }} + +{{- define "port.nginxListen" -}} + {{- $nginxListen := default 8000 -}} + {{- $nginxListen -}} +{{- end }} + +{{- define "port.opensearchNode" -}} + {{- $opensearchNode := default 9200 -}} + {{- $opensearchNode -}} +{{- end }} + +{{- define "port.opensearchDashboard" -}} + {{- $opensearchDashboard := default 5601 -}} + {{- $opensearchDashboard -}} +{{- end }} + diff --git a/templates/_template.tpl b/templates/_template.tpl new file mode 100644 index 00000000..f02742f5 --- /dev/null +++ b/templates/_template.tpl @@ -0,0 +1,85 @@ +{{/* +Helm chart templates +*/}} +{{- define "volume-mount.template" -}} +{{- range .Values.dependencies.storage.volumes }} + - name: {{ .name }} + mountPath: {{ .mountPath }} + {{- if and (eq .type "configmap") (hasKey . "subPath") .subPath }} + subPath: {{ .subPath }} + {{- end }} +{{- end }} +{{- end }} + +{{- define "volumes.template" -}} +- name: {{ .name }} + {{- if eq .type "pvc" }} + persistentVolumeClaim: + claimName: {{ .name }}-pvc + {{- else if eq .type "configmap" }} + configMap: + name: {{ $.Release.Name }}-configmap + {{- if and (hasKey . "configmapKey") (hasKey . "asFile") .configmapKey .asFile }} + items: + - key: {{ .configmapKey }} + path: {{ .asFile }} + {{- end }} + {{- else if eq .type "secret" }} + secret: + secretName: {{ .name }}-secret + {{- else }} + emptyDir: + sizeLimit: 100Mi + {{- end }} +{{- end }} + +{{- define "resources.template" -}} +limits: + cpu: {{ .Values.appConfig.resources.cpu.limits | quote }} + memory: {{ .Values.appConfig.resources.memory.limits | quote }} +requests: + cpu: {{ .Values.appConfig.resources.cpu.requests | quote }} + memory: {{ .Values.appConfig.resources.memory.requests | quote }} +{{- end }} + +{{- define "pvc.template" -}} +{{- range .Values.dependencies.storage.volumes }} + {{- if eq .type "pvc" }} +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: {{ .name }}-pvc + labels: + app: "{{ $.Release.Name }}" +spec: + storageClassName: "{{ .storageClass }}" + accessModes: + - ReadWriteMany + resources: + requests: + storage: {{ .size }} + {{- end }} +{{- end }} +{{- end }} + +{{- define "service.template" -}} +ports: + - protocol: TCP + name: "{{ .Values.appConfig.name }}-service" + {{- if eq .Values.service.scheme "http" }} + port: 80 + targetPort: {{ .Values.service.targetPort }} + {{- end }} + {{- if eq .Values.service.scheme "https" }} + port: 443 + targetPort: {{ .Values.service.targetPort }} + {{- end }} + {{- if eq .Values.service.scheme "passthrough" }} + port: {{ .Values.service.targetPort }} + targetPort: {{ .Values.service.targetPort }} + {{- end }} +type: {{ .Values.service.type | default "ClusterIP" | quote }} +sessionAffinity: None +selector: + app: "{{ .Values.appConfig.name }}" +{{- end }} diff --git a/templates/_templates.tpl b/templates/_templates.tpl new file mode 100644 index 00000000..605652cb --- /dev/null +++ b/templates/_templates.tpl @@ -0,0 +1,89 @@ +{{/* +Common Helm chart templates abstract +*/}} + + +{{- define "template.volumeMount" -}} +{{- range .Values.dependencies.storage.volumes }} +- name: {{ .name }} + mountPath: {{ .mountPath }} + {{- if and (eq .type "configmap") (hasKey . "subPath") .subPath }} + subPath: {{ .subPath }} + {{- end }} +{{- end }} +{{- end }} + + +{{- define "template.volumes" -}} +- name: {{ .item.name }} + {{- if eq .item.type "pvc" }} + persistentVolumeClaim: + claimName: {{ .item.name }}-pvc + {{- else if eq .item.type "configmap" }} + configMap: + name: {{ .root.Release.Name }}-configmap + {{- if and (hasKey .item "configmapKey") (hasKey .item "asFile") }} + items: + - key: {{ .item.configmapKey }} + path: {{ .item.asFile }} + {{- end }} + {{- else if eq .item.type "secret" }} + secret: + secretName: {{ .item.name }}-secret + {{- else }} + emptyDir: + sizeLimit: 100Mi + {{- end }} +{{- end }} + + +{{- define "template.resQuota" -}} +limits: + cpu: {{ .Values.appConfig.resources.cpu.limits | quote }} + memory: {{ .Values.appConfig.resources.memory.limits | quote }} +requests: + cpu: {{ .Values.appConfig.resources.cpu.requests | quote }} + memory: {{ .Values.appConfig.resources.memory.requests | quote }} +{{- end }} + + +{{- define "template.pvc" -}} + {{- if and (eq .item.type "pvc") (hasKey .item "size" ) }} +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: {{ .item.name }}-pvc + labels: + app: "{{ .root.Release.Name }}" +spec: + storageClassName: "{{ .item.storageClass }}" + accessModes: + - ReadWriteMany + resources: + requests: + storage: {{ .item.size }} + {{- end }} +{{- end }} + + +{{- define "template.service" -}} +ports: + - protocol: TCP + name: "{{ .Values.appConfig.name }}-service" + {{- if eq .Values.service.scheme "http" }} + port: 80 + targetPort: {{ .Values.service.targetPort }} + {{- end }} + {{- if eq .Values.service.scheme "https" }} + port: 443 + targetPort: {{ .Values.service.targetPort }} + {{- end }} + {{- if eq .Values.service.scheme "passthrough" }} + port: {{ .Values.service.targetPort }} + targetPort: {{ .Values.service.targetPort }} + {{- end }} +type: {{ .Values.service.type | default "ClusterIP" | quote }} +sessionAffinity: None +selector: + app: "{{ .Values.appConfig.name }}" +{{- end }} diff --git a/templates/configmap.yaml b/templates/configmap.yaml new file mode 100644 index 00000000..1892752b --- /dev/null +++ b/templates/configmap.yaml @@ -0,0 +1,16 @@ +kind: ConfigMap +apiVersion: v1 +metadata: + name: "{{ $.Release.Name }}-configmap" + labels: + app: "{{ $.Release.Name }}" + +data: + mordred-setup: |- + {{- include "config.mordredSetup" . | nindent 4 }} + mordred-projects: |- + {{- include "config.mordredProject" . | nindent 4 }} + uwsgi-params: |- + {{- include "config.uwsgiParams" . | nindent 4 }} + nginx-conf-template: |- + {{- include "config.nginxConf" . | nindent 4 }} diff --git a/values.yaml b/values.yaml new file mode 100644 index 00000000..179ade69 --- /dev/null +++ b/values.yaml @@ -0,0 +1,228 @@ +global: + topologyConfig: {} + imagePullSecrets: [] + imageRegistry: "" + appName: grimoirelab + credentials: + database: + username: "root" + password: "mar1adb4Gr1m0ir3Lab" + opensearchNode: + password: "admin" + redis: + password: "grimoirelab" + +opensearch-node: + install: true + appConfig: + replicas: 1 + image: docker.io/opensearchproject/opensearch:2.11.1 + labels: {} + annotations: {} + resources: + cpu: + limits: "500m" + requests: "300m" + memory: + limits: "3000Mi" + requests: "2000Mi" + dependencies: + storage: + enabled: true + volumes: + - name: "opensearch-data" + mountPath: "/usr/share/opensearch/data" + type: pvc + storageClass: efs-sc + size: 10Gi + service: + targetPort: 9200 + scheme: passthrough + type: "" + extraEnvs: + - name: cluster.name + value: "opensearch-cluster" + - name: node.name + value: "opensearch-node1" + - name: discovery.type + value: "single-node" + - name: bootstrap.memory_lock + value: "true" + - name: OPENSEARCH_JAVA_OPTS + value: "-Xms2g -Xmx2g" + +opensearch-dashboard: + install: true + appConfig: + replicas: 1 + image: docker.io/opensearchproject/opensearch-dashboards:2.11.1 + labels: {} + annotations: {} + resources: + cpu: + limits: "200m" + requests: "100m" + memory: + limits: "512Mi" + requests: "256Mi" + dependencies: + storage: + enabled: false + service: + targetPort: 5601 + scheme: passthrough + type: "" + extraEnvs: [] + +mordred: + install: true + appConfig: + replicas: 1 + image: docker.io/grimoirelab/grimoirelab:1.7.0 + labels: {} + annotations: {} + resources: + cpu: + limits: "500m" + requests: "200m" + memory: + limits: "1024Mi" + requests: "512Mi" + dependencies: + storage: + enabled: true + volumes: + - name: "mordred-setup" + mountPath: "/home/grimoire/conf/setup.cfg" + type: configmap + subPath: "mordred-setup" + - name: "mordred-projects" + mountPath: "/home/grimoire/conf/projects.json" + type: configmap + subPath: "mordred-projects" + - name: "mordred-log" + mountPath: "/home/grimoire/logs" + type: emptyDir + service: + targetPort: 8000 + scheme: passthrough + type: "" + extraEnvs: [] + +nginx: + install: true + appConfig: + replicas: 1 + image: docker.io/nginx:1.27.2 + labels: {} + annotations: {} + resources: + cpu: + limits: "100m" + requests: "50m" + memory: + limits: "256Mi" + requests: "128Mi" + dependencies: + storage: + enabled: true + volumes: + - name: "nginx-conf-template" + mountPath: "/etc/nginx/templates/default.conf.template" + type: configmap + subPath: "nginx-conf-template" + - name: "uwsgi-params" + mountPath: "/etc/nginx/uwsgi_params" + type: configmap + subPath: "uwsgi-params" + - name: "sortinghat-static" + mountPath: "/sortinghat" + type: pvc + service: + targetPort: 8000 + scheme: passthrough + type: "" + extraEnvs: [] + +sortinghat: + install: true + appConfig: + replicas: 1 + image: docker.io/grimoirelab/sortinghat:1.7.0 + labels: {} + annotations: {} + resources: + cpu: + limits: "200m" + requests: "100m" + memory: + limits: "512Mi" + requests: "256Mi" + dependencies: + storage: + enabled: true + volumes: + - name: "sortinghat-static" + mountPath: "/opt/venv/lib/python3.9/site-packages/sortinghat/static" + type: pvc + storageClass: efs-sc + size: 1Gi + service: + targetPort: 9314 + scheme: passthrough + type: "" + extraEnvs: + - name: SORTINGHAT_SECRET_KEY + value: "secret" + - name: SORTINGHAT_DB_HOST + value: "mariadb" + - name: SORTINGHAT_DB_PORT + value: "3306" + - name: SORTINGHAT_DB_DATABASE + value: "sortinghat_db" + - name: SORTINGHAT_REDIS_HOST + value: "redis-master" + - name: SORTINGHAT_SUPERUSER_USERNAME + value: "root" + - name: SORTINGHAT_SUPERUSER_PASSWORD + value: "root" + - name: SORTINGHAT_ALLOWED_HOST + value: "sortinghat,nginx,localhost,127.0.0.1,0.0.0.0,[::1]" + +sortinghat-worker: + install: true + appConfig: + replicas: 1 + image: docker.io/grimoirelab/sortinghat-worker:1.7.0 + labels: {} + annotations: {} + resources: + cpu: + limits: "200m" + requests: "100m" + memory: + limits: "512Mi" + requests: "256Mi" + dependencies: + storage: + enabled: false + service: + scheme: passthrough + type: "" + extraEnvs: + - name: SORTINGHAT_SECRET_KEY + value: "secret" + - name: SORTINGHAT_DB_HOST + value: "mariadb" + - name: SORTINGHAT_DB_PORT + value: "3306" + - name: SORTINGHAT_DB_DATABASE + value: "sortinghat_db" + - name: SORTINGHAT_REDIS_HOST + value: "redis-master" + +mariadb: + install: false + +redis: + install: false From bbf3bb061ef17b37e09b28e5ca55109758d08730 Mon Sep 17 00:00:00 2001 From: Arie <44765750+Eroyi@users.noreply.github.com> Date: Thu, 7 Nov 2024 16:05:55 +0800 Subject: [PATCH 03/16] Delete charts directory Signed-off-by: Arie <44765750+Eroyi@users.noreply.github.com> Signed-off-by: root <44765750+Eroyi@users.noreply.github.com> --- charts/mordred/Chart.yaml | 10 -- charts/mordred/templates/_helper.tpl | 36 ---- charts/mordred/templates/_mordred_config.tpl | 156 ------------------ .../mordred/templates/_mordred_projects.tpl | 15 -- charts/mordred/templates/deployment.yaml | 59 ------- charts/mordred/templates/pvc.yaml | 3 - charts/mordred/templates/service.yaml | 11 -- charts/mordred/values.yaml | 36 ---- charts/nginx/Chart.yaml | 10 -- charts/nginx/templates/_helper.tpl | 36 ---- charts/nginx/templates/_nginx-config.tpl | 61 ------- charts/nginx/templates/_ports.tpl | 6 - charts/nginx/templates/deployment.yaml | 59 ------- charts/nginx/templates/pvc.yaml | 3 - charts/nginx/templates/service.yaml | 11 -- charts/nginx/values.yaml | 47 ------ charts/opensearch-dashboard/Chart.yaml | 10 -- .../templates/_helper.tpl | 36 ---- .../opensearch-dashboard/templates/_ports.tpl | 6 - .../templates/deployment.yaml | 59 ------- .../opensearch-dashboard/templates/pvc.yaml | 3 - .../templates/service.yaml | 11 -- charts/opensearch-dashboard/values.yaml | 37 ----- charts/opensearch-node/Chart.yaml | 10 -- charts/opensearch-node/templates/_helper.tpl | 36 ---- charts/opensearch-node/templates/_ports.tpl | 6 - .../opensearch-node/templates/deployment.yaml | 64 ------- charts/opensearch-node/templates/pvc.yaml | 3 - charts/opensearch-node/templates/service.yaml | 11 -- charts/opensearch-node/values.yaml | 45 ----- charts/sortinghat-worker/Chart.yaml | 10 -- .../sortinghat-worker/templates/_helper.tpl | 36 ---- charts/sortinghat-worker/templates/_ports.tpl | 6 - .../templates/deployment.yaml | 59 ------- charts/sortinghat-worker/templates/pvc.yaml | 3 - .../sortinghat-worker/templates/service.yaml | 11 -- charts/sortinghat-worker/values.yaml | 37 ----- charts/sortinghat/Chart.yaml | 10 -- charts/sortinghat/templates/_helper.tpl | 36 ---- charts/sortinghat/templates/_ports.tpl | 6 - charts/sortinghat/templates/deployment.yaml | 59 ------- charts/sortinghat/templates/pvc.yaml | 3 - charts/sortinghat/templates/service.yaml | 11 -- charts/sortinghat/values.yaml | 42 ----- 44 files changed, 1225 deletions(-) delete mode 100644 charts/mordred/Chart.yaml delete mode 100644 charts/mordred/templates/_helper.tpl delete mode 100644 charts/mordred/templates/_mordred_config.tpl delete mode 100644 charts/mordred/templates/_mordred_projects.tpl delete mode 100644 charts/mordred/templates/deployment.yaml delete mode 100644 charts/mordred/templates/pvc.yaml delete mode 100644 charts/mordred/templates/service.yaml delete mode 100644 charts/mordred/values.yaml delete mode 100644 charts/nginx/Chart.yaml delete mode 100644 charts/nginx/templates/_helper.tpl delete mode 100644 charts/nginx/templates/_nginx-config.tpl delete mode 100644 charts/nginx/templates/_ports.tpl delete mode 100644 charts/nginx/templates/deployment.yaml delete mode 100644 charts/nginx/templates/pvc.yaml delete mode 100644 charts/nginx/templates/service.yaml delete mode 100644 charts/nginx/values.yaml delete mode 100644 charts/opensearch-dashboard/Chart.yaml delete mode 100644 charts/opensearch-dashboard/templates/_helper.tpl delete mode 100644 charts/opensearch-dashboard/templates/_ports.tpl delete mode 100644 charts/opensearch-dashboard/templates/deployment.yaml delete mode 100644 charts/opensearch-dashboard/templates/pvc.yaml delete mode 100644 charts/opensearch-dashboard/templates/service.yaml delete mode 100644 charts/opensearch-dashboard/values.yaml delete mode 100644 charts/opensearch-node/Chart.yaml delete mode 100644 charts/opensearch-node/templates/_helper.tpl delete mode 100644 charts/opensearch-node/templates/_ports.tpl delete mode 100644 charts/opensearch-node/templates/deployment.yaml delete mode 100644 charts/opensearch-node/templates/pvc.yaml delete mode 100644 charts/opensearch-node/templates/service.yaml delete mode 100644 charts/opensearch-node/values.yaml delete mode 100644 charts/sortinghat-worker/Chart.yaml delete mode 100644 charts/sortinghat-worker/templates/_helper.tpl delete mode 100644 charts/sortinghat-worker/templates/_ports.tpl delete mode 100644 charts/sortinghat-worker/templates/deployment.yaml delete mode 100644 charts/sortinghat-worker/templates/pvc.yaml delete mode 100644 charts/sortinghat-worker/templates/service.yaml delete mode 100644 charts/sortinghat-worker/values.yaml delete mode 100644 charts/sortinghat/Chart.yaml delete mode 100644 charts/sortinghat/templates/_helper.tpl delete mode 100644 charts/sortinghat/templates/_ports.tpl delete mode 100644 charts/sortinghat/templates/deployment.yaml delete mode 100644 charts/sortinghat/templates/pvc.yaml delete mode 100644 charts/sortinghat/templates/service.yaml delete mode 100644 charts/sortinghat/values.yaml diff --git a/charts/mordred/Chart.yaml b/charts/mordred/Chart.yaml deleted file mode 100644 index 99fef44e..00000000 --- a/charts/mordred/Chart.yaml +++ /dev/null @@ -1,10 +0,0 @@ -apiVersion: v2 -name: mordred -description: Mordred service for GrimoireLab. -home: https://github.com/chaoss/grimoirelab -icon: https://www.gravatar.com/avatar/4154acefea56ed23bddaaa47a4850400 -maintainers: -- name: Arie - url: https://github.com/Eroyi -appVersion: 1.7.0 #Based on the "Github Release" version (which is the docker image tag referring from), not the actual application version. -version: 1.0 diff --git a/charts/mordred/templates/_helper.tpl b/charts/mordred/templates/_helper.tpl deleted file mode 100644 index cf7469aa..00000000 --- a/charts/mordred/templates/_helper.tpl +++ /dev/null @@ -1,36 +0,0 @@ -{{/* -Mordred labels -*/}} -{{- define "metadata.mordred.pod.labels" -}} -{{- range $name, $value := .Values.appConfig.labels }} -{{ $name }}: {{ $value | quote }} -{{- end -}} -{{- end -}} - -{{/* -Mordred annotations -*/}} -{{- define "metadata.mordred.pod.annotations" -}} -{{- range $name, $value := .Values.appConfig.annotations }} -{{ $name }}: {{ $value | quote }} -{{- end -}} -{{- end -}} - - -{{/* -Mordred Service labels -*/}} -{{- define "metadata.mordred.service.labels" -}} -{{- range $name, $value := .Values.service.labels }} -{{ $name }}: {{ $value | quote }} -{{- end -}} -{{- end -}} - -{{/* -Mordred Service annotations -*/}} -{{- define "metadata.mordred.service.annotations" -}} -{{- range $name, $value := .Values.service.annotations }} -{{ $name }}: {{ $value | quote }} -{{- end -}} -{{- end -}} diff --git a/charts/mordred/templates/_mordred_config.tpl b/charts/mordred/templates/_mordred_config.tpl deleted file mode 100644 index eda12d62..00000000 --- a/charts/mordred/templates/_mordred_config.tpl +++ /dev/null @@ -1,156 +0,0 @@ -{{/* - Mordred setup config -*/}} -{{- define "config.mordredSetup" -}} -[general] -short_name = GrimoireLab -update = true -min_update_delay = 60 -debug = false -logs_dir = /home/grimoire/logs -bulk_size = 100 -scroll_size = 100 -aliases_file = /home/grimoire/aliases.json - -[projects] -projects_file = /home/grimoire/conf/projects.json - -[es_collection] -url = https://admin:{{ include "cred.opensearchNode.password" . }}@opensearchNode:{{ include "port.opensearchNode" . }} - -[es_enrichment] -url = https://admin:{{ include "cred.opensearchNode.password" . }}@opensearchNode:{{ include "port.opensearchNode" . }} -autorefresh = true - -[sortinghat] -host = nginx -user = root -password = root -port = {{ include "port.nginxListen" . }} -path = /identities/api/ -ssl = false -database = sortinghat_db -autoprofile = [github, git] -matching = [email,name,username] -sleep_for = 100 -unaffiliated_group = Unknown -affiliate = true - -[panels] -kibiter_time_from = -kibiter_default_index = -kibiter_url = -kibiter_version = - -[phases] -collection = true -identities = true -enrichment = true -panels = false - -#[bugzillarest] -#raw_index = bugzillarest_demo_raw -#enriched_index = bugzillarest_demo_enriched -#no-archive = true - -#[confluence] -#no-archive = true -#raw_index = confluence_demo_raw -#enriched_index = confluence_demo_enriched - -#[discourse] -#raw_index = discourse_demo_raw -#enriched_index = discourse_demo_enriched -#no-archive = true - -[git] -raw_index = git_demo_raw -enriched_index = git_demo_enriched -latest-items = true -studies = [enrich_demography:git, enrich_areas_of_code:git, enrich_onion:git] - -#[github] -#api-token = -#enterprise-url = -#raw_index = github_demo_raw -#sleep-for-rate = true -#sleep-time = "300" -#enriched_index = github_demo_enriched - -#[gitlab:issues] -#api-token = -#raw_index = gitlab_issues_demo_raw -#enriched_index = gitlab_issues_demo_enriched -#no-archive = true -#enterprise-url = -#sleep-for-rate = true - -#[gitlab:merge] -#api-token = -#raw_index = gitlab_merges_demo_raw -#enriched_index = gitlab_merges_demo_enriched -#no-archive = true -#enterprise-url = -#category = merge_request -#sleep-for-rate = true - -#[jira] -#raw_index = jira_demo_raw -#enriched_index = jira_demo_enriched -#no-archive = true - -#[pipermail] -#raw_index = pipermail_demo_raw -#enriched_index = pipermail_demo_enriched -#no-verify = true - -#[mediawiki] -#raw_index = mediawiki_demo_raw -#enriched_index = mediawiki_demo_enriched -#no-archive = true - -#[meetup] -#raw_index = meetup_demo_raw -#enriched_index = meetup_demo_enriched -#api-token = -#no-archive = true -#sleep-for-rate = true -#sleep-time = "300" - -#[stackexchange] -#raw_index = stackexchange_demo_raw -#enriched_index = stackexchange_demo_enriched -#api-token = -#no-archive = true - -#[slack] -#raw_index = slack_demo_raw -#enriched_index = slack_demo_enriched -#api-token = -#no-archive = true - -#[supybot] -#raw_index = supybot_demo_raw -#enriched_index = supybot_demo_enriched - -#[twitter] -#raw_index = twitter_demo_raw -#enriched_index = twitter_demo_enriched -#api-token = -#no-archive = true -#sleep-for-rate = true -#sleep-time = 300 - -## studies based on enriched indexes - -[enrich_demography:git] - -[enrich_areas_of_code:git] -in_index = git_demo_raw -out_index = git-aoc_demo_enriched - -[enrich_onion:git] -in_index = git -out_index = git-onion_demo_enriched -contribs_field = hash -{{- end }} diff --git a/charts/mordred/templates/_mordred_projects.tpl b/charts/mordred/templates/_mordred_projects.tpl deleted file mode 100644 index 1f8b2785..00000000 --- a/charts/mordred/templates/_mordred_projects.tpl +++ /dev/null @@ -1,15 +0,0 @@ -{{/* - Mordred project config -*/}} -{{- define "config.mordredProject" -}} -{ - "grimoireLab": { - "meta": { - "title": "GrimoireLab" - }, - "git": [ - "https://github.com/chaoss/grimoirelab.git" - ] - } - } -{{- end }} diff --git a/charts/mordred/templates/deployment.yaml b/charts/mordred/templates/deployment.yaml deleted file mode 100644 index f34fdce4..00000000 --- a/charts/mordred/templates/deployment.yaml +++ /dev/null @@ -1,59 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: "{{ .Values.appConfig.name }}" - labels: - app: "{{ .Values.appConfig.name }}" - {{- include "metadata.mordred.pod.labels" . | nindent 4 }} - annotations: - {{- include "metadata.mordred.pod.annotations" . | nindent 4 }} - -spec: - replicas: {{ .Values.appConfig.replicas }} - selector: - matchLabels: - app: "{{ .Values.appConfig.name }}" - template: - metadata: - labels: - app: "{{ .Values.appConfig.name }}" - {{- include "metadata.mordred.pod.labels" . | nindent 8 }} - annotations: - {{- include "metadata.mordred.pod.annotations" . | nindent 8 }} - spec: - {{- with .Values.global.topologyConfig }} - {{- toYaml . | nindent 6 }} - {{- end }} - terminationGracePeriodSeconds: 10 - {{- with .Values.global.imagePullSecrets}} - imagePullSecrets: - {{- toYaml . | nindent 8}} - {{- end}} - containers: - - name: mordred - image: {{ .Values.appConfig.image }} - ports: - - containerPort: {{ .Values.service.targetPort }} - # v ---- Volume mount define ---- - {{- if .Values.dependencies.storage.enabled }} - volumeMounts: - {{- include "template.volumeMount" . | nindent 12 }} - {{- end }} - # ^ ---- Volume mount define ---- - # v ---- Resources define ---- - resources: - {{- include "template.resQuota" . | nindent 12 }} - # ^ ---- Resources define ---- - env: - {{- include "nativeEnv.mordred" . | nindent 12 }} - {{- with .Values.extraEnvs }} - {{- toYaml . | nindent 12 }} - {{- end }} - # v ---- Volumes define ---- - {{- if .Values.dependencies.storage.enabled }} - volumes: - {{- range .Values.dependencies.storage.volumes }} - {{- include "template.volumes" (dict "item" . "root" $ ) | nindent 8 }} - {{- end }} - {{- end }} - # ^ ---- Volumes define ---- diff --git a/charts/mordred/templates/pvc.yaml b/charts/mordred/templates/pvc.yaml deleted file mode 100644 index babc5bee..00000000 --- a/charts/mordred/templates/pvc.yaml +++ /dev/null @@ -1,3 +0,0 @@ -{{- range .Values.dependencies.storage.volumes }} -{{- include "template.pvc" ( dict "item" . "root" $ ) }} -{{- end }} diff --git a/charts/mordred/templates/service.yaml b/charts/mordred/templates/service.yaml deleted file mode 100644 index 8c003ae5..00000000 --- a/charts/mordred/templates/service.yaml +++ /dev/null @@ -1,11 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: "{{ .Values.appConfig.name }}" - labels: - app: "{{ .Values.appConfig.name }}" - {{- include "metadata.mordred.service.labels" . | nindent 4 }} - annotations: - {{- include "metadata.mordred.service.annotations" . | nindent 4 }} -spec: - {{- include "template.service" . | nindent 2 }} diff --git a/charts/mordred/values.yaml b/charts/mordred/values.yaml deleted file mode 100644 index 35834cb7..00000000 --- a/charts/mordred/values.yaml +++ /dev/null @@ -1,36 +0,0 @@ -global: - topologyConfig: {} - imagePullSecrets: [] - imageRegistry: "" - appName: "" - -install: true - -appConfig: - name: "mordred" - replicas: 1 - image: docker.io/grimoirelab/grimoirelab:latest - pullPolicy: "IfNotPresent" - labels: {} - annotations: {} - resources: - cpu: - limits: "" - requests: "" - memory: - limits: "" - requests: "" - -dependencies: - storage: - enabled: false - volumes: [] - -service: - labels: {} - annotations: {} - targetPort: 8000 - scheme: "http" - type: "" # Default to "ClusterIP" - -extraEnvs: [] diff --git a/charts/nginx/Chart.yaml b/charts/nginx/Chart.yaml deleted file mode 100644 index 62f91278..00000000 --- a/charts/nginx/Chart.yaml +++ /dev/null @@ -1,10 +0,0 @@ -apiVersion: v2 -name: nginx -description: Official Nginx build. -home: https://github.com/nginxinc/docker-nginx -icon: https://hub.docker.com/api/media/repos_logo/v1/library%2Fnginx -maintainers: -- name: Arie - url: https://github.com/Eroyi -appVersion: 1.27.2 -version: 1.0 diff --git a/charts/nginx/templates/_helper.tpl b/charts/nginx/templates/_helper.tpl deleted file mode 100644 index f16f6202..00000000 --- a/charts/nginx/templates/_helper.tpl +++ /dev/null @@ -1,36 +0,0 @@ -{/* -Mordred labels -*/}} -{{- define "metadata.nginx.pod.labels" -}} -{{- range $name, $value := .Values.appConfig.labels }} -{{ $name }}: {{ $value | quote }} -{{- end -}} -{{- end -}} - -{{/* -Mordred annotations -*/}} -{{- define "metadata.nginx.pod.annotations" -}} -{{- range $name, $value := .Values.appConfig.annotations }} -{{ $name }}: {{ $value | quote }} -{{- end -}} -{{- end -}} - - -{{/* -Mordred Service labels -*/}} -{{- define "metadata.nginx.service.labels" -}} -{{- range $name, $value := .Values.service.labels }} -{{ $name }}: {{ $value | quote }} -{{- end -}} -{{- end -}} - -{{/* -Mordred Service annotations -*/}} -{{- define "metadata.nginx.service.annotations" -}} -{{- range $name, $value := .Values.service.annotations }} -{{ $name }}: {{ $value | quote }} -{{- end -}} -{{- end -}} diff --git a/charts/nginx/templates/_nginx-config.tpl b/charts/nginx/templates/_nginx-config.tpl deleted file mode 100644 index abbf8221..00000000 --- a/charts/nginx/templates/_nginx-config.tpl +++ /dev/null @@ -1,61 +0,0 @@ -{{/* -uwsgi params config for nginx -*/}} -{{- define "config.uwsgiParams" -}} -uwsgi_param QUERY_STRING $query_string; -uwsgi_param REQUEST_METHOD $request_method; -uwsgi_param CONTENT_TYPE $content_type; -uwsgi_param CONTENT_LENGTH $content_length; -uwsgi_param REQUEST_URI $request_uri; -uwsgi_param PATH_INFO $document_uri; -uwsgi_param DOCUMENT_ROOT $document_root; -uwsgi_param SERVER_PROTOCOL $server_protocol; -uwsgi_param HTTPS $https if_not_empty; -uwsgi_param REMOTE_ADDR $remote_addr; -uwsgi_param REMOTE_PORT $remote_port; -uwsgi_param SERVER_PORT $server_port; -uwsgi_param SERVER_NAME $server_name; -{{- end }} - -{{/* -nginx config -*/}} -{{- define "config.nginxConf" -}} -upstream sortinghat { - server sortinghat:{{ include "port.sortinghat" . }}; -} -server { - include mime.types; - sendfile on; - listen {{ include "port.nginxListen" . }}; - - server_name localhost nginx; - - location / { - proxy_pass ${KIBANA_HOST}; - proxy_redirect ${KIBANA_HOST} /; - proxy_http_version 1.1; - proxy_set_header Upgrade $http_upgrade; - proxy_set_header Connection 'upgrade'; - proxy_set_header Host $host; - proxy_cache_bypass $http_upgrade; - } - - location /identities { - rewrite ^/identities/(.*) /$1 break; - - include /etc/nginx/uwsgi_params; - uwsgi_pass sortinghat; - uwsgi_param Host $host; - uwsgi_param X-Real-IP $remote_addr; - uwsgi_param X-Forwarded-For $proxy_add_x_forwarded_for; - uwsgi_param X-Forwarded-Proto $http_x_forwarded_proto; - } - - location ~ ^/identities/(css|js|fonts)/ { - rewrite ^/identities/(.*) /$1 break; - - root /sortinghat; - } -} -{{- end }} diff --git a/charts/nginx/templates/_ports.tpl b/charts/nginx/templates/_ports.tpl deleted file mode 100644 index 59e46fbd..00000000 --- a/charts/nginx/templates/_ports.tpl +++ /dev/null @@ -1,6 +0,0 @@ -{{/* -Port catalogs for all services -*/}} -{{- define "nginx-listen.port" -}} -{{ ".Values.nginx.service.targetPort" | default "8000" }} -{{- end }} diff --git a/charts/nginx/templates/deployment.yaml b/charts/nginx/templates/deployment.yaml deleted file mode 100644 index 57e0c1c7..00000000 --- a/charts/nginx/templates/deployment.yaml +++ /dev/null @@ -1,59 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: "{{ .Values.appConfig.name }}" - labels: - app: "{{ .Values.appConfig.name }}" - {{- include "metadata.nginx.pod.labels" . | nindent 4 }} - annotations: - {{- include "metadata.nginx.pod.annotations" . | nindent 4 }} - -spec: - replicas: {{ .Values.appConfig.replicas }} - selector: - matchLabels: - app: "{{ .Values.appConfig.name }}" - template: - metadata: - labels: - app: "{{ .Values.appConfig.name }}" - {{- include "metadata.nginx.pod.labels" . | nindent 8 }} - annotations: - {{- include "metadata.nginx.pod.annotations" . | nindent 8 }} - spec: - {{- with .Values.global.topologyConfig }} - {{- toYaml . | nindent 6 }} - {{- end }} - terminationGracePeriodSeconds: 10 - {{- with .Values.global.imagePullSecrets}} - imagePullSecrets: - {{- toYaml . | nindent 8}} - {{- end}} - containers: - - name: nginx - image: {{ .Values.appConfig.image }} - ports: - - containerPort: {{ .Values.service.targetPort }} - # v ---- Volume mount define ---- - {{- if .Values.dependencies.storage.enabled }} - volumeMounts: - {{- include "template.volumeMount" . | nindent 12 }} - {{- end }} - # ^ ---- Volume mount define ---- - # v ---- Resources define ---- - resources: - {{- include "template.resQuota" . | nindent 12 }} - # ^ ---- Resources define ---- - env: - {{- include "nativeEnv.nginx" . | nindent 12 }} - {{- with .Values.extraEnvs }} - {{- toYaml . | nindent 12 }} - {{- end }} - # v ---- Volumes define ---- - {{- if .Values.dependencies.storage.enabled }} - volumes: - {{- range .Values.dependencies.storage.volumes }} - {{- include "template.volumes" (dict "item" . "root" $ ) | nindent 8 }} - {{- end }} - {{- end }} - # ^ ---- Volumes define ---- diff --git a/charts/nginx/templates/pvc.yaml b/charts/nginx/templates/pvc.yaml deleted file mode 100644 index babc5bee..00000000 --- a/charts/nginx/templates/pvc.yaml +++ /dev/null @@ -1,3 +0,0 @@ -{{- range .Values.dependencies.storage.volumes }} -{{- include "template.pvc" ( dict "item" . "root" $ ) }} -{{- end }} diff --git a/charts/nginx/templates/service.yaml b/charts/nginx/templates/service.yaml deleted file mode 100644 index f765af6a..00000000 --- a/charts/nginx/templates/service.yaml +++ /dev/null @@ -1,11 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: "{{ .Values.appConfig.name }}" - labels: - app: "{{ .Values.appConfig.name }}" - {{- include "metadata.nginx.service.labels" . | nindent 4 }} - annotations: - {{- include "metadata.nginx.service.annotations" . | nindent 4 }} -spec: - {{- include "template.service" . | nindent 2 }} diff --git a/charts/nginx/values.yaml b/charts/nginx/values.yaml deleted file mode 100644 index 4153126e..00000000 --- a/charts/nginx/values.yaml +++ /dev/null @@ -1,47 +0,0 @@ -global: - topologyConfig: {} - imagePullSecrets: [] - imageRegistry: "" - appName: "" - -install: true - -appConfig: - name: "nginx" - replicas: 1 - image: docker.io/nginx:1.27.2 - pullPolicy: IfNotPresent - - labels: {} - annotations: {} - resources: - cpu: - limits: "" - requests: "" - memory: - limits: "" - requests: "" - -dependencies: - storage: - enabled: true - volumes: - - name: "nginx-conf-template" - mountPath: "/etc/nginx/templates/default.conf.template" - type: configmap - subPath: "nginx-conf-template" - - name: "uwsgi-params" - mountPath: "/etc/nginx/uwsgi_params" - type: configmap - subPath: "uwsgi-params" - - name: "sortinghat-static" - mountPath: "/sortinghat" - type: pvc -service: - labels: {} - annotations: {} - targetPort: 8000 - scheme: "http" - type: "" # Default to "ClusterIP" - -extraEnvs: [] \ No newline at end of file diff --git a/charts/opensearch-dashboard/Chart.yaml b/charts/opensearch-dashboard/Chart.yaml deleted file mode 100644 index da2cd644..00000000 --- a/charts/opensearch-dashboard/Chart.yaml +++ /dev/null @@ -1,10 +0,0 @@ -apiVersion: v2 -name: opensearch-dashboard -description: OpenSearch is a scalable, flexible, and extensible open-source software suite for search, analytics, and observability applications derived from Elasticsearch 7.10.2 and Kibana 7.10.2 and licensed under Apache 2.0. -home: https://opensearch.org/ -icon: https://www.gravatar.com/avatar/28cb77e720377dcf01e9fee30967c128 -maintainers: -- name: Arie - url: https://github.com/Eroyi -appVersion: 2.11.1 -version: 1.0 diff --git a/charts/opensearch-dashboard/templates/_helper.tpl b/charts/opensearch-dashboard/templates/_helper.tpl deleted file mode 100644 index 0e6d3556..00000000 --- a/charts/opensearch-dashboard/templates/_helper.tpl +++ /dev/null @@ -1,36 +0,0 @@ -{{/* -Opensearch Dashboard labels -*/}} -{{- define "metadata.opensearchDashboard.pod.labels" -}} -{{- range $name, $value := .Values.appConfig.labels }} -{{ $name }}: {{ $value | quote }} -{{- end -}} -{{- end -}} - -{{/* -Opensearch Dashboard annotations -*/}} -{{- define "metadata.opensearchDashboard.pod.annotations" -}} -{{- range $name, $value := .Values.appConfig.annotations }} -{{ $name }}: {{ $value | quote }} -{{- end -}} -{{- end -}} - - -{{/* -Opensearch Dashboard Service labels -*/}} -{{- define "metadata.opensearchDashboard.service.labels" -}} -{{- range $name, $value := .Values.service.labels }} -{{ $name }}: {{ $value | quote }} -{{- end -}} -{{- end -}} - -{{/* -Opensearch Dashboard Service annotations -*/}} -{{- define "metadata.opensearchDashboard.service.annotations" -}} -{{- range $name, $value := .Values.service.annotations }} -{{ $name }}: {{ $value | quote }} -{{- end -}} -{{- end -}} diff --git a/charts/opensearch-dashboard/templates/_ports.tpl b/charts/opensearch-dashboard/templates/_ports.tpl deleted file mode 100644 index 9feace61..00000000 --- a/charts/opensearch-dashboard/templates/_ports.tpl +++ /dev/null @@ -1,6 +0,0 @@ -{{/* -Port catalogs for all services -*/}} -{{- define "opensearch-dashboard.port" -}} -{{ ".Values.opensearch-dashboard.service.targetPort" | default "5601" }} -{{- end }} diff --git a/charts/opensearch-dashboard/templates/deployment.yaml b/charts/opensearch-dashboard/templates/deployment.yaml deleted file mode 100644 index 2f1080f4..00000000 --- a/charts/opensearch-dashboard/templates/deployment.yaml +++ /dev/null @@ -1,59 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: "{{ .Values.appConfig.name }}" - labels: - app: "{{ .Values.appConfig.name }}" - {{- include "metadata.opensearchDashboard.pod.labels" . | nindent 4 }} - annotations: - {{- include "metadata.opensearchDashboard.pod.annotations" . | nindent 4 }} - -spec: - replicas: {{ .Values.appConfig.replicas }} - selector: - matchLabels: - app: "{{ .Values.appConfig.name }}" - template: - metadata: - labels: - app: "{{ .Values.appConfig.name }}" - {{- include "metadata.opensearchDashboard.pod.labels" . | nindent 8 }} - annotations: - {{- include "metadata.opensearchDashboard.pod.annotations" . | nindent 8 }} - spec: - {{- with .Values.global.topologyConfig }} - {{- toYaml . | nindent 6 }} - {{- end }} - terminationGracePeriodSeconds: 10 - {{- with .Values.global.imagePullSecrets }} - imagePullSecrets: - {{- toYaml . | nindent 8 }} - {{- end}} - containers: - - name: opensearch-dashboard - image: {{ .Values.appConfig.image }} - ports: - - containerPort: {{ .Values.service.targetPort }} - # v ---- Volume mount define ---- - {{- if .Values.dependencies.storage.enabled }} - volumeMounts: - {{- include "template.volumeMount" . | nindent 12 }} - {{- end }} - # ^ ---- Volume mount define ---- - # v ---- Resources define ---- - resources: - {{- include "template.resQuota" . | nindent 12 }} - # ^ ---- Resources define ---- - env: - {{- include "nativeEnv.opensearchDashboard" . | nindent 12 }} - {{- with .Values.extraEnvs }} - {{- toYaml . | nindent 12 }} - {{- end }} - # v ---- Volumes define ---- - {{- if .Values.dependencies.storage.enabled }} - volumes: - {{- range .Values.dependencies.storage.volumes }} - {{- include "template.volumes" (dict "item" . "root" $ ) | nindent 8 }} - {{- end }} - {{- end }} - # ^ ---- Volumes define ---- diff --git a/charts/opensearch-dashboard/templates/pvc.yaml b/charts/opensearch-dashboard/templates/pvc.yaml deleted file mode 100644 index babc5bee..00000000 --- a/charts/opensearch-dashboard/templates/pvc.yaml +++ /dev/null @@ -1,3 +0,0 @@ -{{- range .Values.dependencies.storage.volumes }} -{{- include "template.pvc" ( dict "item" . "root" $ ) }} -{{- end }} diff --git a/charts/opensearch-dashboard/templates/service.yaml b/charts/opensearch-dashboard/templates/service.yaml deleted file mode 100644 index 4eec6ab7..00000000 --- a/charts/opensearch-dashboard/templates/service.yaml +++ /dev/null @@ -1,11 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: "{{ .Values.appConfig.name }}" - labels: - app: "{{ .Values.appConfig.name }}" - {{- include "metadata.opensearchDashboard.service.labels" . | nindent 4 }} - annotations: - {{- include "metadata.opensearchDashboard.service.annotations" . | nindent 4 }} -spec: - {{- include "template.service" . | nindent 2 }} diff --git a/charts/opensearch-dashboard/values.yaml b/charts/opensearch-dashboard/values.yaml deleted file mode 100644 index 8418d561..00000000 --- a/charts/opensearch-dashboard/values.yaml +++ /dev/null @@ -1,37 +0,0 @@ -global: - topologyConfig: {} - imagePullSecrets: [] - imageRegistry: "" - appName: "" - -install: true - -appConfig: - name: "opensearch-dashboard" - replicas: 1 - image: docker.io/opensearchproject/opensearch-dashboards:2.11.1 - pullPolicy: IfNotPresent - - labels: {} - annotations: {} - resources: - cpu: - limits: "" - requests: "" - memory: - limits: "" - requests: "" - -dependencies: - storage: - enabled: false - volumes: [] - -service: - labels: {} - annotations: {} - targetPort: 5601 - scheme: "http" - type: "" # Default to "ClusterIP" - -extraEnvs: [] diff --git a/charts/opensearch-node/Chart.yaml b/charts/opensearch-node/Chart.yaml deleted file mode 100644 index 91520c08..00000000 --- a/charts/opensearch-node/Chart.yaml +++ /dev/null @@ -1,10 +0,0 @@ -apiVersion: v2 -name: opensearch-node -description: OpenSearch is a scalable, flexible, and extensible open-source software suite for search, analytics, and observability applications derived from Elasticsearch 7.10.2 and Kibana 7.10.2 and licensed under Apache 2.0. -home: https://opensearch.org/ -icon: https://www.gravatar.com/avatar/28cb77e720377dcf01e9fee30967c128 -maintainers: -- name: Arie - url: https://github.com/Eroyi -appVersion: 2.11.1 -version: 1.0 diff --git a/charts/opensearch-node/templates/_helper.tpl b/charts/opensearch-node/templates/_helper.tpl deleted file mode 100644 index de292dd6..00000000 --- a/charts/opensearch-node/templates/_helper.tpl +++ /dev/null @@ -1,36 +0,0 @@ -{{/* -Opensearch labels -*/}} -{{- define "metadata.opensearchNode.pod.labels" -}} -{{- range $name, $value := .Values.appConfig.labels }} -{{ $name }}: {{ $value | quote }} -{{- end -}} -{{- end -}} - -{{/* -Opensearch annotations -*/}} -{{- define "metadata.opensearchNode.pod.annotations" -}} -{{- range $name, $value := .Values.appConfig.annotations }} -{{ $name }}: {{ $value | quote }} -{{- end -}} -{{- end -}} - - -{{/* -Opensearch Service labels -*/}} -{{- define "metadata.opensearchNode.service.labels" -}} -{{- range $name, $value := .Values.service.labels }} -{{ $name }}: {{ $value | quote }} -{{- end -}} -{{- end -}} - -{{/* -Opensearch Service annotations -*/}} -{{- define "metadata.opensearchNode.service.annotations" -}} -{{- range $name, $value := .Values.service.annotations }} -{{ $name }}: {{ $value | quote }} -{{- end -}} -{{- end -}} diff --git a/charts/opensearch-node/templates/_ports.tpl b/charts/opensearch-node/templates/_ports.tpl deleted file mode 100644 index 552c5c37..00000000 --- a/charts/opensearch-node/templates/_ports.tpl +++ /dev/null @@ -1,6 +0,0 @@ -{{/* -Port catalogs for all services -*/}} -{{- define "opensearch-node.port" -}} -{{ ".Values.opensearch-node.service.targetPort" | default "9200" }} -{{- end }} diff --git a/charts/opensearch-node/templates/deployment.yaml b/charts/opensearch-node/templates/deployment.yaml deleted file mode 100644 index 7fb7d403..00000000 --- a/charts/opensearch-node/templates/deployment.yaml +++ /dev/null @@ -1,64 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: "{{ .Values.appConfig.name }}" - labels: - app: "{{ .Values.appConfig.name }}" - {{- include "metadata.opensearchNode.pod.labels" . | nindent 4 }} - annotations: - {{- include "metadata.opensearchNode.pod.annotations" . | nindent 4 }} - -spec: - replicas: {{ .Values.appConfig.replicas }} - selector: - matchLabels: - app: "{{ .Values.appConfig.name }}" - template: - metadata: - labels: - app: "{{ .Values.appConfig.name }}" - {{- include "metadata.opensearchNode.pod.labels" . | nindent 8 }} - annotations: - {{- include "metadata.opensearchNode.pod.annotations" . | nindent 8 }} - spec: - {{- with .Values.global.topologyConfig }} - {{- toYaml . | nindent 6 }} - {{- end }} - {{- if hasKey .Values.appConfig "security" }} - securityContext: - runAsUser: {{ .Values.appConfig.security.userID }} - runAsGroup: {{ .Values.appConfig.security.groupID }} - {{- end }} - terminationGracePeriodSeconds: 10 - {{- with .Values.global.imagePullSecrets}} - imagePullSecrets: - {{- toYaml . | nindent 8}} - {{- end}} - containers: - - name: opensearch-node - image: {{ .Values.appConfig.image }} - ports: - - containerPort: {{ .Values.service.targetPort }} - # v ---- Volume mount define ---- - {{- if .Values.dependencies.storage.enabled }} - volumeMounts: - {{- include "template.volumeMount" . | nindent 12 }} - {{- end }} - # ^ ---- Volume mount define ---- - # v ---- Resources define ---- - resources: - {{- include "template.resQuota" . | nindent 12 }} - # ^ ---- Resources define ---- - env: - {{- include "nativeEnv.opensearchNode" . | nindent 12 }} - {{- with .Values.extraEnvs }} - {{- toYaml . | nindent 12 }} - {{- end }} - # v ---- Volumes define ---- - {{- if .Values.dependencies.storage.enabled }} - volumes: - {{- range .Values.dependencies.storage.volumes }} - {{- include "template.volumes" (dict "item" . "root" $ ) | nindent 8 }} - {{- end }} - {{- end }} - # ^ ---- Volumes define ---- diff --git a/charts/opensearch-node/templates/pvc.yaml b/charts/opensearch-node/templates/pvc.yaml deleted file mode 100644 index babc5bee..00000000 --- a/charts/opensearch-node/templates/pvc.yaml +++ /dev/null @@ -1,3 +0,0 @@ -{{- range .Values.dependencies.storage.volumes }} -{{- include "template.pvc" ( dict "item" . "root" $ ) }} -{{- end }} diff --git a/charts/opensearch-node/templates/service.yaml b/charts/opensearch-node/templates/service.yaml deleted file mode 100644 index 4c94d5a2..00000000 --- a/charts/opensearch-node/templates/service.yaml +++ /dev/null @@ -1,11 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: "{{ .Values.appConfig.name }}" - labels: - app: "{{ .Values.appConfig.name }}" - {{- include "metadata.opensearchNode.service.labels" . | nindent 4 }} - annotations: - {{- include "metadata.opensearchNode.service.annotations" . | nindent 4 }} -spec: - {{- include "template.service" . | nindent 2 }} diff --git a/charts/opensearch-node/values.yaml b/charts/opensearch-node/values.yaml deleted file mode 100644 index 3da1b34a..00000000 --- a/charts/opensearch-node/values.yaml +++ /dev/null @@ -1,45 +0,0 @@ -global: - topologyConfig: {} - imagePullSecrets: [] - imageRegistry: "" - appName: "" - -install: true - -appConfig: - name: "opensearch-node" - replicas: 1 - image: docker.io/opensearchproject/opensearch:2.11.1 - pullPolicy: IfNotPresent - - labels: {} - annotations: {} - resources: - cpu: - limits: "" - requests: "" - memory: - limits: "" - requests: "" - security: - userID: 1000 - groupID: 1000 - -dependencies: - storage: - enabled: true - volumes: - - name: "opensearch-data" - mountPath: "/usr/share/opensearch/data" - type: pvc - storageClass: efs-sc - size: 1Gi - -service: - labels: {} - annotations: {} - targetPort: 9200 - scheme: "http" - type: "" # Default to "ClusterIP" - -extraEnvs: [] diff --git a/charts/sortinghat-worker/Chart.yaml b/charts/sortinghat-worker/Chart.yaml deleted file mode 100644 index 3575d5b8..00000000 --- a/charts/sortinghat-worker/Chart.yaml +++ /dev/null @@ -1,10 +0,0 @@ -apiVersion: v2 -name: sortinghat-worker -description: Sortinghat worker for GrimoireLab. -home: https://github.com/chaoss/grimoirelab -icon: https://www.gravatar.com/avatar/4154acefea56ed23bddaaa47a4850400 -maintainers: -- name: Arie - url: https://github.com/Eroyi -appVersion: 1.7.0 #Based on the "Github Release" version (which is the docker image tag referring from), not the actual application version. -version: 1.0 diff --git a/charts/sortinghat-worker/templates/_helper.tpl b/charts/sortinghat-worker/templates/_helper.tpl deleted file mode 100644 index b0bbc1de..00000000 --- a/charts/sortinghat-worker/templates/_helper.tpl +++ /dev/null @@ -1,36 +0,0 @@ -{{/* -Sortinghat labels -*/}} -{{- define "metadata.sortinghatWorker.pod.labels" -}} -{{- range $name, $value := .Values.appConfig.labels }} -{{ $name }}: {{ $value | quote }} -{{- end -}} -{{- end -}} - -{{/* -Sortinghat annotations -*/}} -{{- define "metadata.sortinghatWorker.pod.annotations" -}} -{{- range $name, $value := .Values.appConfig.annotations }} -{{ $name }}: {{ $value | quote }} -{{- end -}} -{{- end -}} - - -{{/* -Sortinghat Service labels -*/}} -{{- define "metadata.sortinghatWorker.service.labels" -}} -{{- range $name, $value := .Values.service.labels }} -{{ $name }}: {{ $value | quote }} -{{- end -}} -{{- end -}} - -{{/* -Sortinghat Service annotations -*/}} -{{- define "metadata.sortinghatWorker.service.annotations" -}} -{{- range $name, $value := .Values.service.annotations }} -{{ $name }}: {{ $value | quote }} -{{- end -}} -{{- end -}} diff --git a/charts/sortinghat-worker/templates/_ports.tpl b/charts/sortinghat-worker/templates/_ports.tpl deleted file mode 100644 index 4625205d..00000000 --- a/charts/sortinghat-worker/templates/_ports.tpl +++ /dev/null @@ -1,6 +0,0 @@ -{{/* -Port catalogs for all services -*/}} -{{- define "sortinghat-worker.port" -}} -{{ ".Values.sortinghat-worker.service.targetPort" | default "9314" }} -{{- end }} diff --git a/charts/sortinghat-worker/templates/deployment.yaml b/charts/sortinghat-worker/templates/deployment.yaml deleted file mode 100644 index f829644e..00000000 --- a/charts/sortinghat-worker/templates/deployment.yaml +++ /dev/null @@ -1,59 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: "{{ .Values.appConfig.name }}" - labels: - app: "{{ .Values.appConfig.name }}" - {{- include "metadata.sortinghatWorker.pod.labels" . | nindent 4 }} - annotations: - {{- include "metadata.sortinghatWorker.pod.annotations" . | nindent 4 }} - -spec: - replicas: {{ .Values.appConfig.replicas }} - selector: - matchLabels: - app: "{{ .Values.appConfig.name }}" - template: - metadata: - labels: - app: "{{ .Values.appConfig.name }}" - {{- include "metadata.sortinghatWorker.pod.labels" . | nindent 8 }} - annotations: - {{- include "metadata.sortinghatWorker.pod.annotations" . | nindent 8 }} - spec: - {{- with .Values.global.topologyConfig }} - {{- toYaml . | nindent 6 }} - {{- end }} - terminationGracePeriodSeconds: 10 - {{- with .Values.global.imagePullSecrets}} - imagePullSecrets: - {{- toYaml . | nindent 8}} - {{- end}} - containers: - - name: sortinghat - image: {{ .Values.appConfig.image }} - ports: - - containerPort: {{ .Values.service.targetPort }} - # v ---- Volume mount define ---- - {{- if .Values.dependencies.storage.enabled }} - volumeMounts: - {{- include "template.volumeMount" . | nindent 12 }} - {{- end }} - # ^ ---- Volume mount define ---- - # v ---- Resources define ---- - resources: - {{- include "template.resQuota" . | nindent 12 }} - # ^ ---- Resources define ---- - env: - {{- include "nativeEnv.sortinghatWorker" . | nindent 12 }} - {{- with .Values.extraEnvs }} - {{- toYaml . | nindent 12 }} - {{- end }} - # v ---- Volumes define ---- - {{- if .Values.dependencies.storage.enabled }} - volumes: - {{- range .Values.dependencies.storage.volumes }} - {{- include "template.volumes" (dict "item" . "root" $ ) | nindent 8 }} - {{- end }} - {{- end }} - # ^ ---- Volumes define ---- diff --git a/charts/sortinghat-worker/templates/pvc.yaml b/charts/sortinghat-worker/templates/pvc.yaml deleted file mode 100644 index babc5bee..00000000 --- a/charts/sortinghat-worker/templates/pvc.yaml +++ /dev/null @@ -1,3 +0,0 @@ -{{- range .Values.dependencies.storage.volumes }} -{{- include "template.pvc" ( dict "item" . "root" $ ) }} -{{- end }} diff --git a/charts/sortinghat-worker/templates/service.yaml b/charts/sortinghat-worker/templates/service.yaml deleted file mode 100644 index 33ad470c..00000000 --- a/charts/sortinghat-worker/templates/service.yaml +++ /dev/null @@ -1,11 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: "{{ .Values.appConfig.name }}" - labels: - app: "{{ .Values.appConfig.name }}" - {{- include "metadata.sortinghatWorker.service.labels" . | nindent 4 }} - annotations: - {{- include "metadata.sortinghatWorker.service.annotations" . | nindent 4 }} -spec: - {{- include "template.service" . | nindent 2 }} diff --git a/charts/sortinghat-worker/values.yaml b/charts/sortinghat-worker/values.yaml deleted file mode 100644 index b391cbc2..00000000 --- a/charts/sortinghat-worker/values.yaml +++ /dev/null @@ -1,37 +0,0 @@ -global: - topologyConfig: {} - imagePullSecrets: [] - imageRegistry: "" - appName: "" - -install: true - -appConfig: - name: sortinghat-worker - replicas: 1 - image: docker.io/grimoirelab/sortinghat-worker:latest - pullPolicy: IfNotPresent - - labels: {} - annotations: {} - resources: - cpu: - limits: "" - requests: "" - memory: - limits: "" - requests: "" - -dependencies: - storage: - enabled: false - volumes: [] - -service: - labels: {} - annotations: {} - targetPort: 9314 - scheme: "http" - type: "" # Default to "ClusterIP" - -extraEnvs: [] diff --git a/charts/sortinghat/Chart.yaml b/charts/sortinghat/Chart.yaml deleted file mode 100644 index 364f9a6a..00000000 --- a/charts/sortinghat/Chart.yaml +++ /dev/null @@ -1,10 +0,0 @@ -apiVersion: v2 -name: sortinghat -description: Sortinghat service for GrimoireLab, a tool to manage identities. -home: https://github.com/chaoss/grimoirelab -icon: https://www.gravatar.com/avatar/4154acefea56ed23bddaaa47a4850400 -maintainers: -- name: Arie - url: https://github.com/Eroyi -appVersion: 1.7.0 #Based on the "Github Release" version (which is the docker image tag referring from), not the actual application version. -version: 1.0 diff --git a/charts/sortinghat/templates/_helper.tpl b/charts/sortinghat/templates/_helper.tpl deleted file mode 100644 index b6cb2b6c..00000000 --- a/charts/sortinghat/templates/_helper.tpl +++ /dev/null @@ -1,36 +0,0 @@ -{{/* -Sortinghat labels -*/}} -{{- define "metadata.sortinghat.pod.labels" -}} -{{- range $name, $value := .Values.appConfig.labels }} -{{ $name }}: {{ $value | quote }} -{{- end -}} -{{- end -}} - -{{/* -Sortinghat annotations -*/}} -{{- define "metadata.sortinghat.pod.annotations" -}} -{{- range $name, $value := .Values.appConfig.annotations }} -{{ $name }}: {{ $value | quote }} -{{- end -}} -{{- end -}} - - -{{/* -Sortinghat Service labels -*/}} -{{- define "metadata.sortinghat.service.labels" -}} -{{- range $name, $value := .Values.service.labels }} -{{ $name }}: {{ $value | quote }} -{{- end -}} -{{- end -}} - -{{/* -Sortinghat Service annotations -*/}} -{{- define "metadata.sortinghat.service.annotations" -}} -{{- range $name, $value := .Values.service.annotations }} -{{ $name }}: {{ $value | quote }} -{{- end -}} -{{- end -}} diff --git a/charts/sortinghat/templates/_ports.tpl b/charts/sortinghat/templates/_ports.tpl deleted file mode 100644 index 5662d608..00000000 --- a/charts/sortinghat/templates/_ports.tpl +++ /dev/null @@ -1,6 +0,0 @@ -{{/* -Port catalogs for all services -*/}} -{{- define "sortinghat.port" -}} -{{ ".Values.sortinghat.service.targetPort" | default "9314" }} -{{- end }} diff --git a/charts/sortinghat/templates/deployment.yaml b/charts/sortinghat/templates/deployment.yaml deleted file mode 100644 index 1214a228..00000000 --- a/charts/sortinghat/templates/deployment.yaml +++ /dev/null @@ -1,59 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: {{ .Values.appConfig.name }} - labels: - app: "{{ .Values.appConfig.name }}" - {{- include "metadata.sortinghat.pod.labels" . | nindent 4 }} - annotations: - {{- include "metadata.sortinghat.pod.annotations" . | nindent 4 }} - -spec: - replicas: {{ .Values.appConfig.replicas }} - selector: - matchLabels: - app: "{{ .Values.appConfig.name }}" - template: - metadata: - labels: - app: "{{ .Values.appConfig.name }}" - {{- include "metadata.sortinghat.pod.labels" . | nindent 8 }} - annotations: - {{- include "metadata.sortinghat.pod.annotations" . | nindent 8 }} - spec: - {{- with .Values.global.topologyConfig }} - {{- toYaml . | nindent 6 }} - {{- end }} - terminationGracePeriodSeconds: 10 - {{- with .Values.global.imagePullSecrets}} - imagePullSecrets: - {{- toYaml . | nindent 8}} - {{- end}} - containers: - - name: sortinghat - image: {{ .Values.appConfig.image }} - ports: - - containerPort: {{ .Values.service.targetPort }} - # v ---- Volume mount define ---- - {{- if .Values.dependencies.storage.enabled }} - volumeMounts: - {{- include "template.volumeMount" . | nindent 12 }} - {{- end }} - # ^ ---- Volume mount define ---- - # v ---- Resources define ---- - resources: - {{- include "template.resQuota" . | nindent 12 }} - # ^ ---- Resources define ---- - env: - {{- include "nativeEnv.sortinghat" . | nindent 12 }} - {{- with .Values.extraEnvs }} - {{- toYaml . | nindent 12 }} - {{- end }} - # v ---- Volumes define ---- - {{- if .Values.dependencies.storage.enabled }} - volumes: - {{- range .Values.dependencies.storage.volumes }} - {{- include "template.volumes" (dict "item" . "root" $ ) | nindent 8 }} - {{- end }} - {{- end }} - # ^ ---- Volumes define ---- diff --git a/charts/sortinghat/templates/pvc.yaml b/charts/sortinghat/templates/pvc.yaml deleted file mode 100644 index babc5bee..00000000 --- a/charts/sortinghat/templates/pvc.yaml +++ /dev/null @@ -1,3 +0,0 @@ -{{- range .Values.dependencies.storage.volumes }} -{{- include "template.pvc" ( dict "item" . "root" $ ) }} -{{- end }} diff --git a/charts/sortinghat/templates/service.yaml b/charts/sortinghat/templates/service.yaml deleted file mode 100644 index 2dda92ee..00000000 --- a/charts/sortinghat/templates/service.yaml +++ /dev/null @@ -1,11 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: "{{ .Values.appConfig.name }}" - labels: - app: "{{ .Values.appConfig.name }}" - {{- include "metadata.sortinghat.service.labels" . | nindent 4 }} - annotations: - {{- include "metadata.sortinghat.service.annotations" . | nindent 4 }} -spec: - {{- include "template.service" . | nindent 2 }} diff --git a/charts/sortinghat/values.yaml b/charts/sortinghat/values.yaml deleted file mode 100644 index 382efe11..00000000 --- a/charts/sortinghat/values.yaml +++ /dev/null @@ -1,42 +0,0 @@ -global: - topologyConfig: {} - imagePullSecrets: [] - imageRegistry: "" - appName: "" - -install: true - -appConfig: - name: "sortinghat" - replicas: 1 - image: docker.io/grimoirelab/sortinghat:latest - pullPolicy: IfNotPresent - - labels: {} - annotations: {} - resources: - cpu: - limits: "" - requests: "" - memory: - limits: "" - requests: "" - -dependencies: - storage: - enabled: true - volumes: - - name: "sortinghat-static" - mountPath: "/opt/venv/lib/python3.9/site-packages/sortinghat/static" - type: pvc - storageClass: efs-sc - size: 1Gi - -service: - labels: {} - annotations: {} - targetPort: 9314 - scheme: "http" - type: "" # Default to "ClusterIP" - -extraEnvs: [] From ac2220f6429decad0b632898d797c4c83279df85 Mon Sep 17 00:00:00 2001 From: Arie <44765750+Eroyi@users.noreply.github.com> Date: Thu, 7 Nov 2024 16:17:06 +0800 Subject: [PATCH 04/16] reconstruct the chart structures, and more - reconstruct the helm chart structures, now variables can be defined and referencing across all sub chart - add template file to handle variables - fix format issue, all files end with empty line. - (WIP) integrate with bitnami's redis and mariadb chart. - (ISSUE) variables in templates/_ports.tpl cannot be obtained correctly from values.yaml. All variables are fixed for now. Signed-off-by: Arie <44765750+Eroyi@users.noreply.github.com> Signed-off-by: root <44765750+Eroyi@users.noreply.github.com> --- kubernetes/NOTES.txt | 12 + kubernetes/README.md | 232 +++++++++++++----- kubernetes/helm-chart/Chart.yaml | 42 +++- .../helm-chart/charts/mordred/Chart.yaml | 11 +- .../charts/mordred/templates/_helper.tpl | 12 +- .../mordred/templates/_mordred_config.tpl | 10 +- .../mordred/templates/_mordred_projects.tpl | 8 +- .../charts/mordred/templates/deployment.yaml | 54 ++-- .../charts/mordred/templates/pvc.yaml | 18 +- .../charts/mordred/templates/service.yaml | 24 +- .../helm-chart/charts/mordred/values.yaml | 5 +- kubernetes/helm-chart/charts/nginx/Chart.yaml | 11 +- .../charts/nginx/templates/_helper.tpl | 12 +- .../charts/nginx/templates/_nginx-config.tpl | 10 +- .../charts/nginx/templates/_ports.tpl | 6 + .../charts/nginx/templates/deployment.yaml | 54 ++-- .../charts/nginx/templates/pvc.yaml | 3 + .../charts/nginx/templates/service.yaml | 24 +- .../helm-chart/charts/nginx/values.yaml | 8 +- .../charts/opensearch-dashboard/Chart.yaml | 11 +- .../templates/_helper.tpl | 12 +- .../opensearch-dashboard/templates/_ports.tpl | 6 + .../templates/deployment.yaml | 58 ++--- .../opensearch-dashboard/templates/pvc.yaml | 18 +- .../templates/service.yaml | 24 +- .../charts/opensearch-dashboard/values.yaml | 6 +- .../charts/opensearch-node/Chart.yaml | 11 +- .../opensearch-node/templates/_helper.tpl | 12 +- .../opensearch-node/templates/_ports.tpl | 6 + .../opensearch-node/templates/deployment.yaml | 54 ++-- .../charts/opensearch-node/templates/pvc.yaml | 18 +- .../opensearch-node/templates/service.yaml | 24 +- .../charts/opensearch-node/values.yaml | 8 +- .../charts/sortinghat-worker/Chart.yaml | 11 +- .../sortinghat-worker/templates/_helper.tpl | 12 +- .../sortinghat-worker/templates/_ports.tpl | 6 + .../templates/deployment.yaml | 54 ++-- .../sortinghat-worker/templates/pvc.yaml | 18 +- .../sortinghat-worker/templates/service.yaml | 24 +- .../charts/sortinghat-worker/values.yaml | 6 +- .../helm-chart/charts/sortinghat/Chart.yaml | 11 +- .../charts/sortinghat/templates/_helper.tpl | 10 +- .../charts/sortinghat/templates/_ports.tpl | 6 + .../sortinghat/templates/deployment.yaml | 52 ++-- .../charts/sortinghat/templates/pvc.yaml | 18 +- .../charts/sortinghat/templates/service.yaml | 24 +- .../helm-chart/charts/sortinghat/values.yaml | 5 +- .../helm-chart/templates/_credentials.tpl | 22 ++ kubernetes/helm-chart/templates/_env.tpl | 40 +++ kubernetes/helm-chart/templates/_envs.tpl | 40 +++ kubernetes/helm-chart/templates/_ports.tpl | 49 ++++ kubernetes/helm-chart/templates/_template.tpl | 85 +++++++ .../helm-chart/templates/_templates.tpl | 89 +++++++ .../helm-chart/templates/configmap.yaml | 8 +- kubernetes/helm-chart/values.yaml | 116 ++++----- 55 files changed, 867 insertions(+), 663 deletions(-) create mode 100644 kubernetes/NOTES.txt create mode 100644 kubernetes/helm-chart/charts/nginx/templates/_ports.tpl create mode 100644 kubernetes/helm-chart/charts/nginx/templates/pvc.yaml create mode 100644 kubernetes/helm-chart/charts/opensearch-dashboard/templates/_ports.tpl create mode 100644 kubernetes/helm-chart/charts/opensearch-node/templates/_ports.tpl create mode 100644 kubernetes/helm-chart/charts/sortinghat-worker/templates/_ports.tpl create mode 100644 kubernetes/helm-chart/charts/sortinghat/templates/_ports.tpl create mode 100644 kubernetes/helm-chart/templates/_credentials.tpl create mode 100644 kubernetes/helm-chart/templates/_env.tpl create mode 100644 kubernetes/helm-chart/templates/_envs.tpl create mode 100644 kubernetes/helm-chart/templates/_ports.tpl create mode 100644 kubernetes/helm-chart/templates/_template.tpl create mode 100644 kubernetes/helm-chart/templates/_templates.tpl diff --git a/kubernetes/NOTES.txt b/kubernetes/NOTES.txt new file mode 100644 index 00000000..9ecc9ce7 --- /dev/null +++ b/kubernetes/NOTES.txt @@ -0,0 +1,12 @@ +Thank you for installing {{ .Chart.Name }}. + +To visualise data, you need to import dashboards into opensearch-dashboard. + + 1. Visit https://github.com/chaoss/grimoirelab-sigils/tree/master/panels/json/opensearch_dashboards + 2. Download the dashboard you are interested + 3. Open opensearch-dashboard console in your browser, login. + 4. [If its the first install] Click "Explore on my own". + 5. Click "Menu" on the top left corner, then go to "Management" - "Dashboard Management" + 6. [If its the first install] Click "Index patterns" on the left to create the index patterns. + 7. Click "Saved objects" on the left to import "ndjson" dashboard file you downloaded. + 8. Drag or browser the dashboard file, select, then click "Import" - "Done" to import the dashboard. \ No newline at end of file diff --git a/kubernetes/README.md b/kubernetes/README.md index b3dfcf9d..2e15e1fd 100644 --- a/kubernetes/README.md +++ b/kubernetes/README.md @@ -1,64 +1,168 @@ -# Running GrimoireLab with Kubernetes - -In this folder are configuration manifests for deploying GrimoireLab using [Kubernetes](https://kubernetes.io). You will need a functional Kubernetes cluster, and you should be able to deploy both versions on k8s, kind, or minikube. There are certainly other options out there as well. - -# Requirements - -* [Git](https://git-scm.com/) client -* Kubernetes 1.17+ (managed or local, including kind, minikube, or k3s) -* [kubectl client](https://kubernetes.io/docs/tasks/tools/install-kubectl/) and admin credentials to aforementioned Kubernetes cluster - -# Getting Started - -1. Clone this project: -```console -git clone https://github.com/chaoss/grimoirelab -``` - -2. Since it's impossible to reference external files from within yaml, the configuration templates provided in [`default-grimoirelab-settings`](../default-grimoirelab-settings) are copied to various config/secret maps. - -* [`30-hatstall-config.yml`] - Contains [`apache-hatstall.conf`](../default-grimoirelab-settings/apache-hatstall.conf) -* [`31-hatstall-secret.yml`] - Contains [`shdb.cfg`](../default-grimoirelab-settings/shdb.cfg) -* [`50-mordred-config.yml`] - Contains [`projects.json`](../default-grimoirelab-settings/projects.json) and [`identities.yml`](../default-grimoirelab-settings/identities.yml) -* [`51-mordred-config-aliases.yml`] - Contains [`aliases.json`](../default-grimoirelab-settings/aliases.json) -* [`52-mordred-config-identities.yml`] - Contains [`identities.yml`](../default-grimoirelab-settings/identities.yml) -* [`53-mordred-secret.yml`] - Contains [`setup.cfg`](../default-grimoirelab-settings/setup.cfg) - -The two files you'll likely want to modify at first are `50-mordred-config.yml`, which includes the relevant project locations in `projects.json` in addition to `53-mordred-secret.yml`, which contains all the configuration settings for collecting the data for your projects. This includes api keys, passwords, and other important artifacts. - -See [below](#more-information) more information about these files format. - -3. Launch the project and use `port-forward` as shown in this example to access the dashboard. - -```console -cd grimoirelab/kubernetes/secure -kubectl apply -f . -kubectl port-forward service/kibiter 5601 -n grimoire -``` - -Launch your browser and navigate to `http://localhost:5601`, and login with the user name `admin` and password `admin`. - -To manage the contributors identities, you may port-forward the [Hatstall](https://github.com/chaoss/grimoirelab-hatstall) application as well. - -```console -kubectl port-forward service/hatstall 8000:80 -n grimoire -``` - -Once forwarded, access your browser at `http://localhost:8000`, and login using the user name `admin`, and password `admin` - ---- - -## Using an insecure environment - -Follow the same steps as above, but use the manifests in the `insecure` folder. - - -# More information - -* [The `projects.json` file format](https://github.com/chaoss/grimoirelab-sirmordred#projectsjson) -* [The `setup.cfg` file format](https://github.com/chaoss/grimoirelab-sirmordred#setupcfg) -* Getting API tokens for different services: - * [GitHub](https://help.github.com/en/articles/creating-a-personal-access-token-for-the-command-line) - * [GitLab](https://docs.gitlab.com/ee/user/profile/personal_access_tokens.html) - * [Meetup](https://secure.meetup.com/es-ES/meetup_api/oauth_consumers/) - * [Slack](https://get.slack.help/hc/en-us/articles/215770388-Create-and-regenerate-API-tokens) \ No newline at end of file +# Introduction +This chart launches a grimoirelab deployment on a Kubernetes cluster using the helm package manager. + + +# Prerequisites Component +- Mariadb +- Redis +- Opensearch **(!)** +- Opensearch Dashboard **(!)** + + +**(!)**: A component with this mark means this chart is already integrated with that component. + +You can deploy and configure the **(!)** component within this chart via `Values.yaml`. + +If you like to bring your own components, you can disable the installation of the built-in chart, with `install: false` option *(see detail below)*. + + + +# Installing the Chart + +To install the chart with the release name `grimoirelab` +```console +helm install grimoirelab /path/to/chart --values /path/to/chart/values.yaml -n grimoirelab +``` +`-n`: The namespace you would like to put this release in. + + + + +# Configure the chart + +Tips: Use `Ctrl+F / Command+F` search the keywords in `Values.yaml` for quick navigation. + + + + +## Global + +Global values are meant to override the specific values across all sub-charts. +| Name | Description | Type | Default value | +| ---- | ----------- | ---- | ------------- | +| `topologyConfig` | The topology configuration for this chart, affect all components | map | {} | +| `imagePullSecrets` | Only required when you are pulling image from private registry | list | [] | +| `appName` | Name of this chart | string | "" | +| `credentials.database.username` | Plaintext. Username for database connection | string | "root" | +| `credentials.database.password` | Plaintext. Password for the database connection | "mar1adb4Gr1m0ir3Lab" | +| `credentials.opensearchNode.password` | Plaintext. Password for the opensearch connection | string | "admin" | +| `credentials.redis.password` | Plaintext. Password for the redis connection | string | "grimoirelab" | + + +## Component + +### Grimoirelab components + +> 1. Components' names will be omitted. +> 2. Resource value has been set to a minimum running quota. +> 3. You can disable these components: `opensearch-node`, `opensearch-dashboard`, `mariadb`, `redis` + +| Name | Description | Type | Default value | +| ---- | ----------- | ---- | ------------- | +| `install` | Installation toggle for this component. | boolean | true / false | +| `appConfig.replicas` | Replica count for this deployment | int | 1 | +| `appConfig.image` | Image for this deployment | string | --- | +| `appConfig.labels` | Labels for this deployment | map | {} | +| `appConfig.annotations` | Annotations for this deployment | map | {} | +| `appConfig.resources` | Resources quota for this deployment | map | --- | + + + + +## Dependencies + +### Storage + +| Name | Description | Type | Default value | +| ---- | ----------- | ---- | ------------- | +| `enabled` | Enable or disable persistent storage. | boolean | true / false | +| `volumes.name` | Name of this volumes when referencing in yaml | string | --- | +| `volumes.mountPath` | Path of this volumes to be mount into container | string | --- | +| `volumes.type` | Type of this volumes. `pvc`, `configmap` or `emptyDir` | string | --- | +| `volumes.storageClass` | The strorage class that will be used when creating PVC | string | gp3 | +| `volumes.size` | Size of this volume | string | --- | +| `volumes.subPath` | Declair the `subPath` while mounting in `configmap` type | string | --- | + + + `volumes` have 3 types of schemas, here are the example: + +#### 1. Persistent Volume +```yaml +- name: "volume-name" + mountPath: "/path/to/mount/in/container" + type: pvc + storageClass: your-storageClass + size: 1Gi +``` +This will result: +- A Persistence Volume Claim + - With 1 Gigabyte storage + - with the storageClass you assigned +- Mounted as Volumes with the name "volume-name" + - in /path/to/mount/in/container + + + +```yaml +- name: "volume-name" +mountPath: "/path/to/mount/in/container" +type: pvc +``` +This will result: +- Mounted as Volumes with the name "volume-name". (If these volumes are not created, the mounting attempt will fail.) + - in /path/to/mount/in/container +> If you did NOT declare the size, PVC will not be created. If these volumes have not been created, the mounting attempt will fail. + + + +### 2. Configmap as file +```yaml +- name: "config-name" + mountPath: "/path/to/file/in/container/file-name.txt" + type: configmap + subPath: "configmap-key-name" +``` + +This will result: +- Mounting file from Configmap with name "config-name". +- in /path/to/mount/in/container +> If the configmap has NOT been created, or the key declared in "subPath" is not found in the configmap, the mounting attempt will fail. + + + +### 3. Empty directory +```yaml +- name: "volume-name" + mountPath: "path/to/mount/in/container" + type: emptyDir +``` + +This will result: +- Mounted as an empty directory with the name "volume-name" +- in /path/to/mount/in/container +> Data in this volume type will be lost when the pod is restarted. + + + + +## Service + +| Name | Description | Type | Default value | +| ---- | ----------- | ---- | ------------- | +| `targetPort` | The port to expose for this deployment | int | --- | +| `schema` | The method when proxy the `targetPort`. `passthrough` will remain the original port, `http` will use 80 and `https` as 443 | string | passthrough | +| `type` | The type of the services for this deployment, default (empty) is `ClusterIP` | string | "" | + +**Attention:** If you would like to change the service port in here, please make sure you have changed them in `templates/_ports.tpl` as well. + + + +## Extra environments + +You can put an extra environments list in here to inject into the container. +```yaml +- name: key + value: "value" +- name: foo + value: "bar" +``` diff --git a/kubernetes/helm-chart/Chart.yaml b/kubernetes/helm-chart/Chart.yaml index a9923534..32c21cf1 100644 --- a/kubernetes/helm-chart/Chart.yaml +++ b/kubernetes/helm-chart/Chart.yaml @@ -1,6 +1,42 @@ apiVersion: v2 -description: Nested Chart collection for all grimorelab services. name: grimoirelab type: application -version: 1.1.2 -appVersion: 1.2 \ No newline at end of file +description: Nested Chart collection for all grimorelab services. +home: https://github.com/chaoss/grimoirelab +icon: https://www.gravatar.com/avatar/4154acefea56ed23bddaaa47a4850400 +maintainers: +- name: Arie + url: https://github.com/Eroyi +version: 1.7.0 #Based on the "Github Release" version (which is the docker image tag referring from), not the actual application version. +appVersion: 1.0 +dependencies: +- name: mordred + repository: file://charts/mordred + version: 1.7.0 +- name: nginx + repository: file://charts/nginx + versio: 1.27.2 +- name: sortinghat + repository: file://charts/sortinghat + version: 1.7.0 +- name: sortinghat-worker + repository: file://charts/sortinghat-worker + version: 1.7.0 + alias: sortinghatWorker +# External Dependencies +- name: opensearch-dashboard + version: 2.11.1 + repository: file://charts/opensearch-dashboard + alias: opensearchDashboard + condition: opensearchDashboard.install +- name: opensearch-node + repository: file://charts/opensearch-node + version: 2.11.1 + alias: opensearchNode + condition: opensearchNode.install +# - name: mariadb +# version: 19.1.0 +# condition: mariadb.install +# - name: redis +# version: 20.2.1 +# condition: redis.install diff --git a/kubernetes/helm-chart/charts/mordred/Chart.yaml b/kubernetes/helm-chart/charts/mordred/Chart.yaml index 3a15bf2d..99fef44e 100644 --- a/kubernetes/helm-chart/charts/mordred/Chart.yaml +++ b/kubernetes/helm-chart/charts/mordred/Chart.yaml @@ -1,5 +1,10 @@ apiVersion: v2 name: mordred -description: Mordred service for GrimoireLab -appVersion: 1.0 -version: 1.0 \ No newline at end of file +description: Mordred service for GrimoireLab. +home: https://github.com/chaoss/grimoirelab +icon: https://www.gravatar.com/avatar/4154acefea56ed23bddaaa47a4850400 +maintainers: +- name: Arie + url: https://github.com/Eroyi +appVersion: 1.7.0 #Based on the "Github Release" version (which is the docker image tag referring from), not the actual application version. +version: 1.0 diff --git a/kubernetes/helm-chart/charts/mordred/templates/_helper.tpl b/kubernetes/helm-chart/charts/mordred/templates/_helper.tpl index 686d5085..cf7469aa 100644 --- a/kubernetes/helm-chart/charts/mordred/templates/_helper.tpl +++ b/kubernetes/helm-chart/charts/mordred/templates/_helper.tpl @@ -1,8 +1,8 @@ {{/* Mordred labels */}} -{{- define "mordred-pod-labels" -}} -{{- range $name, $value := .Values.appConfiglabels }} +{{- define "metadata.mordred.pod.labels" -}} +{{- range $name, $value := .Values.appConfig.labels }} {{ $name }}: {{ $value | quote }} {{- end -}} {{- end -}} @@ -10,7 +10,7 @@ Mordred labels {{/* Mordred annotations */}} -{{- define "mordred-pod-annotations" -}} +{{- define "metadata.mordred.pod.annotations" -}} {{- range $name, $value := .Values.appConfig.annotations }} {{ $name }}: {{ $value | quote }} {{- end -}} @@ -20,7 +20,7 @@ Mordred annotations {{/* Mordred Service labels */}} -{{- define "mordred-service-labels" -}} +{{- define "metadata.mordred.service.labels" -}} {{- range $name, $value := .Values.service.labels }} {{ $name }}: {{ $value | quote }} {{- end -}} @@ -29,8 +29,8 @@ Mordred Service labels {{/* Mordred Service annotations */}} -{{- define "mordred-service-annotations" -}} +{{- define "metadata.mordred.service.annotations" -}} {{- range $name, $value := .Values.service.annotations }} {{ $name }}: {{ $value | quote }} {{- end -}} -{{- end -}} \ No newline at end of file +{{- end -}} diff --git a/kubernetes/helm-chart/charts/mordred/templates/_mordred_config.tpl b/kubernetes/helm-chart/charts/mordred/templates/_mordred_config.tpl index 4a56b1f1..67e2ae1d 100644 --- a/kubernetes/helm-chart/charts/mordred/templates/_mordred_config.tpl +++ b/kubernetes/helm-chart/charts/mordred/templates/_mordred_config.tpl @@ -1,7 +1,7 @@ {{/* Mordred setup config */}} -{{- define "mordred-setup-config" -}} +{{- define "config.mordredSetup" -}} [general] short_name = GrimoireLab update = true @@ -16,17 +16,17 @@ aliases_file = /home/grimoire/aliases.json projects_file = /home/grimoire/conf/projects.json [es_collection] -url = https://admin:admin@opensearch-node:9200 +url = https://admin:{{ include "cred.opensearchNode.password" . }}@opensearch-node:{{ include "port.opensearchNode" . }} [es_enrichment] -url = https://admin:admin@opensearch-node:9200 +url = https://admin:{{ include "cred.opensearchNode.password" . }}@opensearch-node:{{ include "port.opensearchNode" . }} autorefresh = true [sortinghat] host = nginx user = root password = root -port = 8000 +port = {{ include "port.nginxListen" . }} path = /identities/api/ ssl = false database = sortinghat_db @@ -153,4 +153,4 @@ out_index = git-aoc_demo_enriched in_index = git out_index = git-onion_demo_enriched contribs_field = hash -{{- end }} \ No newline at end of file +{{- end }} diff --git a/kubernetes/helm-chart/charts/mordred/templates/_mordred_projects.tpl b/kubernetes/helm-chart/charts/mordred/templates/_mordred_projects.tpl index 1fb036e8..1f8b2785 100644 --- a/kubernetes/helm-chart/charts/mordred/templates/_mordred_projects.tpl +++ b/kubernetes/helm-chart/charts/mordred/templates/_mordred_projects.tpl @@ -1,15 +1,15 @@ {{/* Mordred project config */}} -{{- define "mordred-project-config" -}} +{{- define "config.mordredProject" -}} { - "grimoirelab": { + "grimoireLab": { "meta": { "title": "GrimoireLab" }, "git": [ - "https://github.com/chaoss/grimoirelab.git" + "https://github.com/chaoss/grimoirelab.git" ] } } -{{- end }} \ No newline at end of file +{{- end }} diff --git a/kubernetes/helm-chart/charts/mordred/templates/deployment.yaml b/kubernetes/helm-chart/charts/mordred/templates/deployment.yaml index 6295789c..f34fdce4 100644 --- a/kubernetes/helm-chart/charts/mordred/templates/deployment.yaml +++ b/kubernetes/helm-chart/charts/mordred/templates/deployment.yaml @@ -4,9 +4,9 @@ metadata: name: "{{ .Values.appConfig.name }}" labels: app: "{{ .Values.appConfig.name }}" - {{- include "mordred-pod-labels" . | nindent 4 }} + {{- include "metadata.mordred.pod.labels" . | nindent 4 }} annotations: - {{- include "mordred-pod-annotations" . | nindent 4 }} + {{- include "metadata.mordred.pod.annotations" . | nindent 4 }} spec: replicas: {{ .Values.appConfig.replicas }} @@ -17,9 +17,9 @@ spec: metadata: labels: app: "{{ .Values.appConfig.name }}" - {{- include "mordred-pod-labels" . | nindent 8 }} + {{- include "metadata.mordred.pod.labels" . | nindent 8 }} annotations: - {{- include "mordred-pod-annotations" . | nindent 8 }} + {{- include "metadata.mordred.pod.annotations" . | nindent 8 }} spec: {{- with .Values.global.topologyConfig }} {{- toYaml . | nindent 6 }} @@ -34,48 +34,26 @@ spec: image: {{ .Values.appConfig.image }} ports: - containerPort: {{ .Values.service.targetPort }} + # v ---- Volume mount define ---- {{- if .Values.dependencies.storage.enabled }} volumeMounts: - {{- range .Values.dependencies.storage.volumes }} - - name: {{ .name }} - mountPath: {{ .mountPath }} - {{- if and (eq .type "configmap") (hasKey . "subPath") .subPath }} - subPath: {{ .subPath }} - {{- end }} - {{- end }} + {{- include "template.volumeMount" . | nindent 12 }} {{- end }} + # ^ ---- Volume mount define ---- + # v ---- Resources define ---- resources: - limits: - cpu: {{ .Values.appConfig.resources.cpu.limits | quote }} - memory: {{ .Values.appConfig.resources.memory.limits | quote }} - requests: - cpu: {{ .Values.appConfig.resources.cpu.requests | quote }} - memory: {{ .Values.appConfig.resources.memory.requests | quote}} + {{- include "template.resQuota" . | nindent 12 }} + # ^ ---- Resources define ---- env: + {{- include "nativeEnv.mordred" . | nindent 12 }} {{- with .Values.extraEnvs }} {{- toYaml . | nindent 12 }} {{- end }} + # v ---- Volumes define ---- {{- if .Values.dependencies.storage.enabled }} volumes: - {{- range .Values.dependencies.storage.volumes }} - - name: {{ .name }} - {{- if eq .type "pvc" }} - persistentVolumeClaim: - claimName: {{ .name }}-pvc - {{- else if eq .type "configmap" }} - configMap: - name: {{ $.Release.Name }}-configmap - {{- if and (hasKey . "configmapKey") (hasKey . "asFile" ) .confimapKey .asFile }} - items: - - key: {{ .configmapKey }} - path: {{ .asFile }} - {{- end }} - {{- else if eq .type "secret" }} - secret: - secretName: {{ .name }}-secret - {{- else }} - emptyDir: - sizeLimit: 100Mi - {{- end }} + {{- range .Values.dependencies.storage.volumes }} + {{- include "template.volumes" (dict "item" . "root" $ ) | nindent 8 }} {{- end }} - {{- end }} \ No newline at end of file + {{- end }} + # ^ ---- Volumes define ---- diff --git a/kubernetes/helm-chart/charts/mordred/templates/pvc.yaml b/kubernetes/helm-chart/charts/mordred/templates/pvc.yaml index da765b3b..babc5bee 100644 --- a/kubernetes/helm-chart/charts/mordred/templates/pvc.yaml +++ b/kubernetes/helm-chart/charts/mordred/templates/pvc.yaml @@ -1,17 +1,3 @@ {{- range .Values.dependencies.storage.volumes }} - {{- if eq .type "pvc" }} -apiVersion: v1 -kind: PersistentVolumeClaim -metadata: - name: {{ .name }}-pvc - labels: - app: "{{ $.Release.Name }}" -spec: - storageClassName: "{{ .storageClass }}" - accessModes: - - ReadWriteMany - resources: - requests: - storage: {{ .size }} - {{- end }} -{{- end }} \ No newline at end of file +{{- include "template.pvc" ( dict "item" . "root" $ ) }} +{{- end }} diff --git a/kubernetes/helm-chart/charts/mordred/templates/service.yaml b/kubernetes/helm-chart/charts/mordred/templates/service.yaml index 39abf969..8c003ae5 100644 --- a/kubernetes/helm-chart/charts/mordred/templates/service.yaml +++ b/kubernetes/helm-chart/charts/mordred/templates/service.yaml @@ -4,26 +4,8 @@ metadata: name: "{{ .Values.appConfig.name }}" labels: app: "{{ .Values.appConfig.name }}" - {{- include "mordred-service-labels" . | nindent 4 }} + {{- include "metadata.mordred.service.labels" . | nindent 4 }} annotations: - {{- include "mordred-service-annotations" . | nindent 4 }} + {{- include "metadata.mordred.service.annotations" . | nindent 4 }} spec: - ports: - - protocol: TCP - name: "{{ .Values.appConfig.name }}-service" - {{- if eq .Values.service.scheme "http" }} - port: 80 - targetPort: {{ .Values.service.targetPort }} - {{- end }} - {{- if eq .Values.service.scheme "https" }} - port: 443 - targetPort: {{ .Values.service.targetPort }} - {{- end }} - {{- if eq .Values.service.scheme "passthrough" }} - port: {{ .Values.service.targetPort }} - targetPort: {{ .Values.service.targetPort }} - {{- end }} - type: {{ .Values.service.type | default "ClusterIP" | quote }} - sessionAffinity: None - selector: - app: "{{ .Values.appConfig.name }}" \ No newline at end of file + {{- include "template.service" . | nindent 2 }} diff --git a/kubernetes/helm-chart/charts/mordred/values.yaml b/kubernetes/helm-chart/charts/mordred/values.yaml index 91971490..35834cb7 100644 --- a/kubernetes/helm-chart/charts/mordred/values.yaml +++ b/kubernetes/helm-chart/charts/mordred/values.yaml @@ -4,14 +4,13 @@ global: imageRegistry: "" appName: "" -enabled: true +install: true appConfig: name: "mordred" replicas: 1 image: docker.io/grimoirelab/grimoirelab:latest pullPolicy: "IfNotPresent" - metadata: {} labels: {} annotations: {} resources: @@ -34,4 +33,4 @@ service: scheme: "http" type: "" # Default to "ClusterIP" -extraEnvs: [] \ No newline at end of file +extraEnvs: [] diff --git a/kubernetes/helm-chart/charts/nginx/Chart.yaml b/kubernetes/helm-chart/charts/nginx/Chart.yaml index aae0c16b..62f91278 100644 --- a/kubernetes/helm-chart/charts/nginx/Chart.yaml +++ b/kubernetes/helm-chart/charts/nginx/Chart.yaml @@ -1,5 +1,10 @@ apiVersion: v2 name: nginx -description: Nginx service for GrimoireLab -appVersion: 1.0 -version: 1.0 \ No newline at end of file +description: Official Nginx build. +home: https://github.com/nginxinc/docker-nginx +icon: https://hub.docker.com/api/media/repos_logo/v1/library%2Fnginx +maintainers: +- name: Arie + url: https://github.com/Eroyi +appVersion: 1.27.2 +version: 1.0 diff --git a/kubernetes/helm-chart/charts/nginx/templates/_helper.tpl b/kubernetes/helm-chart/charts/nginx/templates/_helper.tpl index 4faa93d6..f16f6202 100644 --- a/kubernetes/helm-chart/charts/nginx/templates/_helper.tpl +++ b/kubernetes/helm-chart/charts/nginx/templates/_helper.tpl @@ -1,8 +1,8 @@ {/* Mordred labels */}} -{{- define "nginx-pod-labels" -}} -{{- range $name, $value := .Values.appConfiglabels }} +{{- define "metadata.nginx.pod.labels" -}} +{{- range $name, $value := .Values.appConfig.labels }} {{ $name }}: {{ $value | quote }} {{- end -}} {{- end -}} @@ -10,7 +10,7 @@ Mordred labels {{/* Mordred annotations */}} -{{- define "nginx-pod-annotations" -}} +{{- define "metadata.nginx.pod.annotations" -}} {{- range $name, $value := .Values.appConfig.annotations }} {{ $name }}: {{ $value | quote }} {{- end -}} @@ -20,7 +20,7 @@ Mordred annotations {{/* Mordred Service labels */}} -{{- define "nginx-service-labels" -}} +{{- define "metadata.nginx.service.labels" -}} {{- range $name, $value := .Values.service.labels }} {{ $name }}: {{ $value | quote }} {{- end -}} @@ -29,8 +29,8 @@ Mordred Service labels {{/* Mordred Service annotations */}} -{{- define "nginx-service-annotations" -}} +{{- define "metadata.nginx.service.annotations" -}} {{- range $name, $value := .Values.service.annotations }} {{ $name }}: {{ $value | quote }} {{- end -}} -{{- end -}} \ No newline at end of file +{{- end -}} diff --git a/kubernetes/helm-chart/charts/nginx/templates/_nginx-config.tpl b/kubernetes/helm-chart/charts/nginx/templates/_nginx-config.tpl index cb8415ad..abbf8221 100644 --- a/kubernetes/helm-chart/charts/nginx/templates/_nginx-config.tpl +++ b/kubernetes/helm-chart/charts/nginx/templates/_nginx-config.tpl @@ -1,7 +1,7 @@ {{/* uwsgi params config for nginx */}} -{{- define "uwsgi-params" -}} +{{- define "config.uwsgiParams" -}} uwsgi_param QUERY_STRING $query_string; uwsgi_param REQUEST_METHOD $request_method; uwsgi_param CONTENT_TYPE $content_type; @@ -20,14 +20,14 @@ uwsgi_param SERVER_NAME $server_name; {{/* nginx config */}} -{{- define "nginx-conf-template" -}} +{{- define "config.nginxConf" -}} upstream sortinghat { - server sortinghat:9314; + server sortinghat:{{ include "port.sortinghat" . }}; } server { include mime.types; sendfile on; - listen 8000; + listen {{ include "port.nginxListen" . }}; server_name localhost nginx; @@ -58,4 +58,4 @@ server { root /sortinghat; } } -{{- end }} \ No newline at end of file +{{- end }} diff --git a/kubernetes/helm-chart/charts/nginx/templates/_ports.tpl b/kubernetes/helm-chart/charts/nginx/templates/_ports.tpl new file mode 100644 index 00000000..59e46fbd --- /dev/null +++ b/kubernetes/helm-chart/charts/nginx/templates/_ports.tpl @@ -0,0 +1,6 @@ +{{/* +Port catalogs for all services +*/}} +{{- define "nginx-listen.port" -}} +{{ ".Values.nginx.service.targetPort" | default "8000" }} +{{- end }} diff --git a/kubernetes/helm-chart/charts/nginx/templates/deployment.yaml b/kubernetes/helm-chart/charts/nginx/templates/deployment.yaml index 377bcba9..57e0c1c7 100644 --- a/kubernetes/helm-chart/charts/nginx/templates/deployment.yaml +++ b/kubernetes/helm-chart/charts/nginx/templates/deployment.yaml @@ -4,9 +4,9 @@ metadata: name: "{{ .Values.appConfig.name }}" labels: app: "{{ .Values.appConfig.name }}" - {{- include "nginx-pod-labels" . | nindent 4 }} + {{- include "metadata.nginx.pod.labels" . | nindent 4 }} annotations: - {{- include "nginx-pod-annotations" . | nindent 4 }} + {{- include "metadata.nginx.pod.annotations" . | nindent 4 }} spec: replicas: {{ .Values.appConfig.replicas }} @@ -17,9 +17,9 @@ spec: metadata: labels: app: "{{ .Values.appConfig.name }}" - {{- include "nginx-pod-labels" . | nindent 8 }} + {{- include "metadata.nginx.pod.labels" . | nindent 8 }} annotations: - {{- include "nginx-pod-annotations" . | nindent 8 }} + {{- include "metadata.nginx.pod.annotations" . | nindent 8 }} spec: {{- with .Values.global.topologyConfig }} {{- toYaml . | nindent 6 }} @@ -34,48 +34,26 @@ spec: image: {{ .Values.appConfig.image }} ports: - containerPort: {{ .Values.service.targetPort }} + # v ---- Volume mount define ---- {{- if .Values.dependencies.storage.enabled }} volumeMounts: - {{- range .Values.dependencies.storage.volumes }} - - name: {{ .name }} - mountPath: {{ .mountPath }} - {{- if and (eq .type "configmap") (hasKey . "subPath") .subPath }} - subPath: {{ .subPath }} - {{- end }} - {{- end }} + {{- include "template.volumeMount" . | nindent 12 }} {{- end }} + # ^ ---- Volume mount define ---- + # v ---- Resources define ---- resources: - limits: - cpu: {{ .Values.appConfig.resources.cpu.limits | quote }} - memory: {{ .Values.appConfig.resources.memory.limits | quote }} - requests: - cpu: {{ .Values.appConfig.resources.cpu.requests | quote }} - memory: {{ .Values.appConfig.resources.memory.requests | quote}} + {{- include "template.resQuota" . | nindent 12 }} + # ^ ---- Resources define ---- env: + {{- include "nativeEnv.nginx" . | nindent 12 }} {{- with .Values.extraEnvs }} {{- toYaml . | nindent 12 }} {{- end }} + # v ---- Volumes define ---- {{- if .Values.dependencies.storage.enabled }} volumes: - {{- range .Values.dependencies.storage.volumes }} - - name: {{ .name }} - {{- if eq .type "pvc" }} - persistentVolumeClaim: - claimName: {{ .name }}-pvc - {{- else if eq .type "configmap" }} - configMap: - name: {{ $.Release.Name }}-configmap - {{- if and (hasKey . "configmapKey") (hasKey . "asFile" ) .confimapKey .asFile }} - items: - - key: {{ .configmapKey }} - path: {{ .asFile }} - {{- end }} - {{- else if eq .type "secret" }} - secret: - secretName: {{ .name }}-secret - {{- else }} - emptyDir: - sizeLimit: 100Mi - {{- end }} + {{- range .Values.dependencies.storage.volumes }} + {{- include "template.volumes" (dict "item" . "root" $ ) | nindent 8 }} {{- end }} - {{- end }} \ No newline at end of file + {{- end }} + # ^ ---- Volumes define ---- diff --git a/kubernetes/helm-chart/charts/nginx/templates/pvc.yaml b/kubernetes/helm-chart/charts/nginx/templates/pvc.yaml new file mode 100644 index 00000000..babc5bee --- /dev/null +++ b/kubernetes/helm-chart/charts/nginx/templates/pvc.yaml @@ -0,0 +1,3 @@ +{{- range .Values.dependencies.storage.volumes }} +{{- include "template.pvc" ( dict "item" . "root" $ ) }} +{{- end }} diff --git a/kubernetes/helm-chart/charts/nginx/templates/service.yaml b/kubernetes/helm-chart/charts/nginx/templates/service.yaml index 09c5c547..f765af6a 100644 --- a/kubernetes/helm-chart/charts/nginx/templates/service.yaml +++ b/kubernetes/helm-chart/charts/nginx/templates/service.yaml @@ -4,26 +4,8 @@ metadata: name: "{{ .Values.appConfig.name }}" labels: app: "{{ .Values.appConfig.name }}" - {{- include "nginx-service-labels" . | nindent 4 }} + {{- include "metadata.nginx.service.labels" . | nindent 4 }} annotations: - {{- include "nginx-service-annotations" . | nindent 4 }} + {{- include "metadata.nginx.service.annotations" . | nindent 4 }} spec: - ports: - - protocol: TCP - name: "{{ .Values.appConfig.name }}-service" - {{- if eq .Values.service.scheme "http" }} - port: 80 - targetPort: {{ .Values.service.targetPort }} - {{- end }} - {{- if eq .Values.service.scheme "https" }} - port: 443 - targetPort: {{ .Values.service.targetPort }} - {{- end }} - {{- if eq .Values.service.scheme "passthrough" }} - port: {{ .Values.service.targetPort }} - targetPort: {{ .Values.service.targetPort }} - {{- end }} - type: {{ .Values.service.type | default "ClusterIP" | quote }} - sessionAffinity: None - selector: - app: "{{ .Values.appConfig.name }}" \ No newline at end of file + {{- include "template.service" . | nindent 2 }} diff --git a/kubernetes/helm-chart/charts/nginx/values.yaml b/kubernetes/helm-chart/charts/nginx/values.yaml index 37974ffa..8f81a8ae 100644 --- a/kubernetes/helm-chart/charts/nginx/values.yaml +++ b/kubernetes/helm-chart/charts/nginx/values.yaml @@ -4,14 +4,14 @@ global: imageRegistry: "" appName: "" -enabled: true +install: true appConfig: name: "nginx" replicas: 1 - image: docker.io/nginx:latest + image: docker.io/nginx:1.27.2 pullPolicy: IfNotPresent - metadata: {} + labels: {} annotations: {} resources: @@ -44,4 +44,4 @@ service: scheme: "http" type: "" # Default to "ClusterIP" -extraEnvs: [] \ No newline at end of file +extraEnvs: [] diff --git a/kubernetes/helm-chart/charts/opensearch-dashboard/Chart.yaml b/kubernetes/helm-chart/charts/opensearch-dashboard/Chart.yaml index dcb59e78..da2cd644 100644 --- a/kubernetes/helm-chart/charts/opensearch-dashboard/Chart.yaml +++ b/kubernetes/helm-chart/charts/opensearch-dashboard/Chart.yaml @@ -1,5 +1,10 @@ apiVersion: v2 name: opensearch-dashboard -description: Dashboard for Opensearch -appVersion: 1.0 -version: 1.0 \ No newline at end of file +description: OpenSearch is a scalable, flexible, and extensible open-source software suite for search, analytics, and observability applications derived from Elasticsearch 7.10.2 and Kibana 7.10.2 and licensed under Apache 2.0. +home: https://opensearch.org/ +icon: https://www.gravatar.com/avatar/28cb77e720377dcf01e9fee30967c128 +maintainers: +- name: Arie + url: https://github.com/Eroyi +appVersion: 2.11.1 +version: 1.0 diff --git a/kubernetes/helm-chart/charts/opensearch-dashboard/templates/_helper.tpl b/kubernetes/helm-chart/charts/opensearch-dashboard/templates/_helper.tpl index e7355ebc..0e6d3556 100644 --- a/kubernetes/helm-chart/charts/opensearch-dashboard/templates/_helper.tpl +++ b/kubernetes/helm-chart/charts/opensearch-dashboard/templates/_helper.tpl @@ -1,8 +1,8 @@ {{/* Opensearch Dashboard labels */}} -{{- define "opensearch-dashboard-pod-labels" -}} -{{- range $name, $value := .Values.appConfiglabels }} +{{- define "metadata.opensearchDashboard.pod.labels" -}} +{{- range $name, $value := .Values.appConfig.labels }} {{ $name }}: {{ $value | quote }} {{- end -}} {{- end -}} @@ -10,7 +10,7 @@ Opensearch Dashboard labels {{/* Opensearch Dashboard annotations */}} -{{- define "opensearch-dashboard-pod-annotations" -}} +{{- define "metadata.opensearchDashboard.pod.annotations" -}} {{- range $name, $value := .Values.appConfig.annotations }} {{ $name }}: {{ $value | quote }} {{- end -}} @@ -20,7 +20,7 @@ Opensearch Dashboard annotations {{/* Opensearch Dashboard Service labels */}} -{{- define "opensearch-dashboard-service-labels" -}} +{{- define "metadata.opensearchDashboard.service.labels" -}} {{- range $name, $value := .Values.service.labels }} {{ $name }}: {{ $value | quote }} {{- end -}} @@ -29,8 +29,8 @@ Opensearch Dashboard Service labels {{/* Opensearch Dashboard Service annotations */}} -{{- define "opensearch-dashboard-service-annotations" -}} +{{- define "metadata.opensearchDashboard.service.annotations" -}} {{- range $name, $value := .Values.service.annotations }} {{ $name }}: {{ $value | quote }} {{- end -}} -{{- end -}} \ No newline at end of file +{{- end -}} diff --git a/kubernetes/helm-chart/charts/opensearch-dashboard/templates/_ports.tpl b/kubernetes/helm-chart/charts/opensearch-dashboard/templates/_ports.tpl new file mode 100644 index 00000000..9feace61 --- /dev/null +++ b/kubernetes/helm-chart/charts/opensearch-dashboard/templates/_ports.tpl @@ -0,0 +1,6 @@ +{{/* +Port catalogs for all services +*/}} +{{- define "opensearch-dashboard.port" -}} +{{ ".Values.opensearch-dashboard.service.targetPort" | default "5601" }} +{{- end }} diff --git a/kubernetes/helm-chart/charts/opensearch-dashboard/templates/deployment.yaml b/kubernetes/helm-chart/charts/opensearch-dashboard/templates/deployment.yaml index 869a9f05..2f1080f4 100644 --- a/kubernetes/helm-chart/charts/opensearch-dashboard/templates/deployment.yaml +++ b/kubernetes/helm-chart/charts/opensearch-dashboard/templates/deployment.yaml @@ -4,9 +4,9 @@ metadata: name: "{{ .Values.appConfig.name }}" labels: app: "{{ .Values.appConfig.name }}" - {{- include "opensearch-dashboard-pod-labels" . | nindent 4 }} + {{- include "metadata.opensearchDashboard.pod.labels" . | nindent 4 }} annotations: - {{- include "opensearch-dashboard-pod-annotations" . | nindent 4 }} + {{- include "metadata.opensearchDashboard.pod.annotations" . | nindent 4 }} spec: replicas: {{ .Values.appConfig.replicas }} @@ -17,65 +17,43 @@ spec: metadata: labels: app: "{{ .Values.appConfig.name }}" - {{- include "opensearch-dashboard-pod-labels" . | nindent 8 }} + {{- include "metadata.opensearchDashboard.pod.labels" . | nindent 8 }} annotations: - {{- include "opensearch-dashboard-pod-annotations" . | nindent 8 }} + {{- include "metadata.opensearchDashboard.pod.annotations" . | nindent 8 }} spec: {{- with .Values.global.topologyConfig }} {{- toYaml . | nindent 6 }} {{- end }} terminationGracePeriodSeconds: 10 - {{- with .Values.global.imagePullSecrets}} + {{- with .Values.global.imagePullSecrets }} imagePullSecrets: - {{- toYaml . | nindent 8}} + {{- toYaml . | nindent 8 }} {{- end}} containers: - name: opensearch-dashboard image: {{ .Values.appConfig.image }} ports: - containerPort: {{ .Values.service.targetPort }} + # v ---- Volume mount define ---- {{- if .Values.dependencies.storage.enabled }} volumeMounts: - {{- range .Values.dependencies.storage.volumes }} - - name: {{ .name }} - mountPath: {{ .mountPath }} - {{- if and (eq .type "configmap") (hasKey . "subPath") .subPath }} - subPath: {{ .subPath }} - {{- end }} - {{- end }} + {{- include "template.volumeMount" . | nindent 12 }} {{- end }} + # ^ ---- Volume mount define ---- + # v ---- Resources define ---- resources: - limits: - cpu: {{ .Values.appConfig.resources.cpu.limits | quote }} - memory: {{ .Values.appConfig.resources.memory.limits | quote }} - requests: - cpu: {{ .Values.appConfig.resources.cpu.requests | quote }} - memory: {{ .Values.appConfig.resources.memory.requests | quote}} + {{- include "template.resQuota" . | nindent 12 }} + # ^ ---- Resources define ---- env: + {{- include "nativeEnv.opensearchDashboard" . | nindent 12 }} {{- with .Values.extraEnvs }} {{- toYaml . | nindent 12 }} {{- end }} + # v ---- Volumes define ---- {{- if .Values.dependencies.storage.enabled }} volumes: - {{- range .Values.dependencies.storage.volumes }} - - name: {{ .name }} - {{- if eq .type "pvc" }} - persistentVolumeClaim: - claimName: {{ .name }}-pvc - {{- else if eq .type "configmap" }} - configMap: - name: {{ $.Release.Name }}-configmap - {{- if and (hasKey . "configmapKey") (hasKey . "asFile" ) .confimapKey .asFile }} - items: - - key: {{ .configmapKey }} - path: {{ .asFile }} - {{- end }} - {{- else if eq .type "secret" }} - secret: - secretName: {{ .name }}-secret - {{- else }} - emptyDir: - sizeLimit: 100Mi - {{- end }} + {{- range .Values.dependencies.storage.volumes }} + {{- include "template.volumes" (dict "item" . "root" $ ) | nindent 8 }} {{- end }} - {{- end }} \ No newline at end of file + {{- end }} + # ^ ---- Volumes define ---- diff --git a/kubernetes/helm-chart/charts/opensearch-dashboard/templates/pvc.yaml b/kubernetes/helm-chart/charts/opensearch-dashboard/templates/pvc.yaml index da765b3b..babc5bee 100644 --- a/kubernetes/helm-chart/charts/opensearch-dashboard/templates/pvc.yaml +++ b/kubernetes/helm-chart/charts/opensearch-dashboard/templates/pvc.yaml @@ -1,17 +1,3 @@ {{- range .Values.dependencies.storage.volumes }} - {{- if eq .type "pvc" }} -apiVersion: v1 -kind: PersistentVolumeClaim -metadata: - name: {{ .name }}-pvc - labels: - app: "{{ $.Release.Name }}" -spec: - storageClassName: "{{ .storageClass }}" - accessModes: - - ReadWriteMany - resources: - requests: - storage: {{ .size }} - {{- end }} -{{- end }} \ No newline at end of file +{{- include "template.pvc" ( dict "item" . "root" $ ) }} +{{- end }} diff --git a/kubernetes/helm-chart/charts/opensearch-dashboard/templates/service.yaml b/kubernetes/helm-chart/charts/opensearch-dashboard/templates/service.yaml index caa21a3e..4eec6ab7 100644 --- a/kubernetes/helm-chart/charts/opensearch-dashboard/templates/service.yaml +++ b/kubernetes/helm-chart/charts/opensearch-dashboard/templates/service.yaml @@ -4,26 +4,8 @@ metadata: name: "{{ .Values.appConfig.name }}" labels: app: "{{ .Values.appConfig.name }}" - {{- include "opensearch-dashboard-service-labels" . | nindent 4 }} + {{- include "metadata.opensearchDashboard.service.labels" . | nindent 4 }} annotations: - {{- include "opensearch-dashboard-service-annotations" . | nindent 4 }} + {{- include "metadata.opensearchDashboard.service.annotations" . | nindent 4 }} spec: - ports: - - protocol: TCP - name: "{{ .Values.appConfig.name }}-service" - {{- if eq .Values.service.scheme "http" }} - port: 80 - targetPort: {{ .Values.service.targetPort }} - {{- end }} - {{- if eq .Values.service.scheme "https" }} - port: 443 - targetPort: {{ .Values.service.targetPort }} - {{- end }} - {{- if eq .Values.service.scheme "passthrough" }} - port: {{ .Values.service.targetPort }} - targetPort: {{ .Values.service.targetPort }} - {{- end }} - type: {{ .Values.service.type | default "ClusterIP" | quote }} - sessionAffinity: None - selector: - app: "{{ .Values.appConfig.name }}" \ No newline at end of file + {{- include "template.service" . | nindent 2 }} diff --git a/kubernetes/helm-chart/charts/opensearch-dashboard/values.yaml b/kubernetes/helm-chart/charts/opensearch-dashboard/values.yaml index efbbf8da..8418d561 100644 --- a/kubernetes/helm-chart/charts/opensearch-dashboard/values.yaml +++ b/kubernetes/helm-chart/charts/opensearch-dashboard/values.yaml @@ -4,14 +4,14 @@ global: imageRegistry: "" appName: "" -enabled: true +install: true appConfig: name: "opensearch-dashboard" replicas: 1 image: docker.io/opensearchproject/opensearch-dashboards:2.11.1 pullPolicy: IfNotPresent - metadata: {} + labels: {} annotations: {} resources: @@ -34,4 +34,4 @@ service: scheme: "http" type: "" # Default to "ClusterIP" -extraEnvs: [] \ No newline at end of file +extraEnvs: [] diff --git a/kubernetes/helm-chart/charts/opensearch-node/Chart.yaml b/kubernetes/helm-chart/charts/opensearch-node/Chart.yaml index c5ecbe2b..91520c08 100644 --- a/kubernetes/helm-chart/charts/opensearch-node/Chart.yaml +++ b/kubernetes/helm-chart/charts/opensearch-node/Chart.yaml @@ -1,5 +1,10 @@ apiVersion: v2 name: opensearch-node -description: Opensearch for Grimoirelab -appVersion: 1.0 -version: 1.0 \ No newline at end of file +description: OpenSearch is a scalable, flexible, and extensible open-source software suite for search, analytics, and observability applications derived from Elasticsearch 7.10.2 and Kibana 7.10.2 and licensed under Apache 2.0. +home: https://opensearch.org/ +icon: https://www.gravatar.com/avatar/28cb77e720377dcf01e9fee30967c128 +maintainers: +- name: Arie + url: https://github.com/Eroyi +appVersion: 2.11.1 +version: 1.0 diff --git a/kubernetes/helm-chart/charts/opensearch-node/templates/_helper.tpl b/kubernetes/helm-chart/charts/opensearch-node/templates/_helper.tpl index 167f6d3d..de292dd6 100644 --- a/kubernetes/helm-chart/charts/opensearch-node/templates/_helper.tpl +++ b/kubernetes/helm-chart/charts/opensearch-node/templates/_helper.tpl @@ -1,8 +1,8 @@ {{/* Opensearch labels */}} -{{- define "opensearch-node-pod-labels" -}} -{{- range $name, $value := .Values.appConfiglabels }} +{{- define "metadata.opensearchNode.pod.labels" -}} +{{- range $name, $value := .Values.appConfig.labels }} {{ $name }}: {{ $value | quote }} {{- end -}} {{- end -}} @@ -10,7 +10,7 @@ Opensearch labels {{/* Opensearch annotations */}} -{{- define "opensearch-node-pod-annotations" -}} +{{- define "metadata.opensearchNode.pod.annotations" -}} {{- range $name, $value := .Values.appConfig.annotations }} {{ $name }}: {{ $value | quote }} {{- end -}} @@ -20,7 +20,7 @@ Opensearch annotations {{/* Opensearch Service labels */}} -{{- define "opensearch-node-service-labels" -}} +{{- define "metadata.opensearchNode.service.labels" -}} {{- range $name, $value := .Values.service.labels }} {{ $name }}: {{ $value | quote }} {{- end -}} @@ -29,8 +29,8 @@ Opensearch Service labels {{/* Opensearch Service annotations */}} -{{- define "opensearch-node-service-annotations" -}} +{{- define "metadata.opensearchNode.service.annotations" -}} {{- range $name, $value := .Values.service.annotations }} {{ $name }}: {{ $value | quote }} {{- end -}} -{{- end -}} \ No newline at end of file +{{- end -}} diff --git a/kubernetes/helm-chart/charts/opensearch-node/templates/_ports.tpl b/kubernetes/helm-chart/charts/opensearch-node/templates/_ports.tpl new file mode 100644 index 00000000..552c5c37 --- /dev/null +++ b/kubernetes/helm-chart/charts/opensearch-node/templates/_ports.tpl @@ -0,0 +1,6 @@ +{{/* +Port catalogs for all services +*/}} +{{- define "opensearch-node.port" -}} +{{ ".Values.opensearch-node.service.targetPort" | default "9200" }} +{{- end }} diff --git a/kubernetes/helm-chart/charts/opensearch-node/templates/deployment.yaml b/kubernetes/helm-chart/charts/opensearch-node/templates/deployment.yaml index 1bb7f8a7..7fb7d403 100644 --- a/kubernetes/helm-chart/charts/opensearch-node/templates/deployment.yaml +++ b/kubernetes/helm-chart/charts/opensearch-node/templates/deployment.yaml @@ -4,9 +4,9 @@ metadata: name: "{{ .Values.appConfig.name }}" labels: app: "{{ .Values.appConfig.name }}" - {{- include "opensearch-node-pod-labels" . | nindent 4 }} + {{- include "metadata.opensearchNode.pod.labels" . | nindent 4 }} annotations: - {{- include "opensearch-node-pod-annotations" . | nindent 4 }} + {{- include "metadata.opensearchNode.pod.annotations" . | nindent 4 }} spec: replicas: {{ .Values.appConfig.replicas }} @@ -17,9 +17,9 @@ spec: metadata: labels: app: "{{ .Values.appConfig.name }}" - {{- include "opensearch-node-pod-labels" . | nindent 8 }} + {{- include "metadata.opensearchNode.pod.labels" . | nindent 8 }} annotations: - {{- include "opensearch-node-pod-annotations" . | nindent 8 }} + {{- include "metadata.opensearchNode.pod.annotations" . | nindent 8 }} spec: {{- with .Values.global.topologyConfig }} {{- toYaml . | nindent 6 }} @@ -39,48 +39,26 @@ spec: image: {{ .Values.appConfig.image }} ports: - containerPort: {{ .Values.service.targetPort }} + # v ---- Volume mount define ---- {{- if .Values.dependencies.storage.enabled }} volumeMounts: - {{- range .Values.dependencies.storage.volumes }} - - name: {{ .name }} - mountPath: {{ .mountPath }} - {{- if and (eq .type "configmap") (hasKey . "subPath") .subPath }} - subPath: {{ .subPath }} - {{- end }} - {{- end }} + {{- include "template.volumeMount" . | nindent 12 }} {{- end }} + # ^ ---- Volume mount define ---- + # v ---- Resources define ---- resources: - limits: - cpu: {{ .Values.appConfig.resources.cpu.limits | quote }} - memory: {{ .Values.appConfig.resources.memory.limits | quote }} - requests: - cpu: {{ .Values.appConfig.resources.cpu.requests | quote }} - memory: {{ .Values.appConfig.resources.memory.requests | quote}} + {{- include "template.resQuota" . | nindent 12 }} + # ^ ---- Resources define ---- env: + {{- include "nativeEnv.opensearchNode" . | nindent 12 }} {{- with .Values.extraEnvs }} {{- toYaml . | nindent 12 }} {{- end }} + # v ---- Volumes define ---- {{- if .Values.dependencies.storage.enabled }} volumes: - {{- range .Values.dependencies.storage.volumes }} - - name: {{ .name }} - {{- if eq .type "pvc" }} - persistentVolumeClaim: - claimName: {{ .name }}-pvc - {{- else if eq .type "configmap" }} - configMap: - name: {{ $.Release.Name }}-configmap - {{- if and (hasKey . "configmapKey") (hasKey . "asFile" ) .confimapKey .asFile }} - items: - - key: {{ .configmapKey }} - path: {{ .asFile }} - {{- end }} - {{- else if eq .type "secret" }} - secret: - secretName: {{ .name }}-secret - {{- else }} - emptyDir: - sizeLimit: 100Mi - {{- end }} + {{- range .Values.dependencies.storage.volumes }} + {{- include "template.volumes" (dict "item" . "root" $ ) | nindent 8 }} {{- end }} - {{- end }} \ No newline at end of file + {{- end }} + # ^ ---- Volumes define ---- diff --git a/kubernetes/helm-chart/charts/opensearch-node/templates/pvc.yaml b/kubernetes/helm-chart/charts/opensearch-node/templates/pvc.yaml index da765b3b..babc5bee 100644 --- a/kubernetes/helm-chart/charts/opensearch-node/templates/pvc.yaml +++ b/kubernetes/helm-chart/charts/opensearch-node/templates/pvc.yaml @@ -1,17 +1,3 @@ {{- range .Values.dependencies.storage.volumes }} - {{- if eq .type "pvc" }} -apiVersion: v1 -kind: PersistentVolumeClaim -metadata: - name: {{ .name }}-pvc - labels: - app: "{{ $.Release.Name }}" -spec: - storageClassName: "{{ .storageClass }}" - accessModes: - - ReadWriteMany - resources: - requests: - storage: {{ .size }} - {{- end }} -{{- end }} \ No newline at end of file +{{- include "template.pvc" ( dict "item" . "root" $ ) }} +{{- end }} diff --git a/kubernetes/helm-chart/charts/opensearch-node/templates/service.yaml b/kubernetes/helm-chart/charts/opensearch-node/templates/service.yaml index 7157cb8e..4c94d5a2 100644 --- a/kubernetes/helm-chart/charts/opensearch-node/templates/service.yaml +++ b/kubernetes/helm-chart/charts/opensearch-node/templates/service.yaml @@ -4,26 +4,8 @@ metadata: name: "{{ .Values.appConfig.name }}" labels: app: "{{ .Values.appConfig.name }}" - {{- include "opensearch-node-service-labels" . | nindent 4 }} + {{- include "metadata.opensearchNode.service.labels" . | nindent 4 }} annotations: - {{- include "opensearch-node-service-annotations" . | nindent 4 }} + {{- include "metadata.opensearchNode.service.annotations" . | nindent 4 }} spec: - ports: - - protocol: TCP - name: "{{ .Values.appConfig.name }}-service" - {{- if eq .Values.service.scheme "http" }} - port: 80 - targetPort: {{ .Values.service.targetPort }} - {{- end }} - {{- if eq .Values.service.scheme "https" }} - port: 443 - targetPort: {{ .Values.service.targetPort }} - {{- end }} - {{- if eq .Values.service.scheme "passthrough" }} - port: {{ .Values.service.targetPort }} - targetPort: {{ .Values.service.targetPort }} - {{- end }} - type: {{ .Values.service.type | default "ClusterIP" | quote }} - sessionAffinity: None - selector: - app: "{{ .Values.appConfig.name }}" \ No newline at end of file + {{- include "template.service" . | nindent 2 }} diff --git a/kubernetes/helm-chart/charts/opensearch-node/values.yaml b/kubernetes/helm-chart/charts/opensearch-node/values.yaml index b1edf50d..3da1b34a 100644 --- a/kubernetes/helm-chart/charts/opensearch-node/values.yaml +++ b/kubernetes/helm-chart/charts/opensearch-node/values.yaml @@ -4,14 +4,14 @@ global: imageRegistry: "" appName: "" -enabled: true +install: true appConfig: name: "opensearch-node" replicas: 1 image: docker.io/opensearchproject/opensearch:2.11.1 pullPolicy: IfNotPresent - metadata: {} + labels: {} annotations: {} resources: @@ -25,7 +25,6 @@ appConfig: userID: 1000 groupID: 1000 - dependencies: storage: enabled: true @@ -36,7 +35,6 @@ dependencies: storageClass: efs-sc size: 1Gi - service: labels: {} annotations: {} @@ -44,4 +42,4 @@ service: scheme: "http" type: "" # Default to "ClusterIP" -extraEnvs: [] \ No newline at end of file +extraEnvs: [] diff --git a/kubernetes/helm-chart/charts/sortinghat-worker/Chart.yaml b/kubernetes/helm-chart/charts/sortinghat-worker/Chart.yaml index 50131c55..3575d5b8 100644 --- a/kubernetes/helm-chart/charts/sortinghat-worker/Chart.yaml +++ b/kubernetes/helm-chart/charts/sortinghat-worker/Chart.yaml @@ -1,5 +1,10 @@ apiVersion: v2 name: sortinghat-worker -description: Sortinghat worker for GrimoireLab -appVersion: 1.0 -version: 1.0 \ No newline at end of file +description: Sortinghat worker for GrimoireLab. +home: https://github.com/chaoss/grimoirelab +icon: https://www.gravatar.com/avatar/4154acefea56ed23bddaaa47a4850400 +maintainers: +- name: Arie + url: https://github.com/Eroyi +appVersion: 1.7.0 #Based on the "Github Release" version (which is the docker image tag referring from), not the actual application version. +version: 1.0 diff --git a/kubernetes/helm-chart/charts/sortinghat-worker/templates/_helper.tpl b/kubernetes/helm-chart/charts/sortinghat-worker/templates/_helper.tpl index f0ce44b1..b0bbc1de 100644 --- a/kubernetes/helm-chart/charts/sortinghat-worker/templates/_helper.tpl +++ b/kubernetes/helm-chart/charts/sortinghat-worker/templates/_helper.tpl @@ -1,8 +1,8 @@ {{/* Sortinghat labels */}} -{{- define "sortinghat-worker-pod-labels" -}} -{{- range $name, $value := .Values.appConfiglabels }} +{{- define "metadata.sortinghatWorker.pod.labels" -}} +{{- range $name, $value := .Values.appConfig.labels }} {{ $name }}: {{ $value | quote }} {{- end -}} {{- end -}} @@ -10,7 +10,7 @@ Sortinghat labels {{/* Sortinghat annotations */}} -{{- define "sortinghat-worker-pod-annotations" -}} +{{- define "metadata.sortinghatWorker.pod.annotations" -}} {{- range $name, $value := .Values.appConfig.annotations }} {{ $name }}: {{ $value | quote }} {{- end -}} @@ -20,7 +20,7 @@ Sortinghat annotations {{/* Sortinghat Service labels */}} -{{- define "sortinghat-worker-service-labels" -}} +{{- define "metadata.sortinghatWorker.service.labels" -}} {{- range $name, $value := .Values.service.labels }} {{ $name }}: {{ $value | quote }} {{- end -}} @@ -29,8 +29,8 @@ Sortinghat Service labels {{/* Sortinghat Service annotations */}} -{{- define "sortinghat-worker-service-annotations" -}} +{{- define "metadata.sortinghatWorker.service.annotations" -}} {{- range $name, $value := .Values.service.annotations }} {{ $name }}: {{ $value | quote }} {{- end -}} -{{- end -}} \ No newline at end of file +{{- end -}} diff --git a/kubernetes/helm-chart/charts/sortinghat-worker/templates/_ports.tpl b/kubernetes/helm-chart/charts/sortinghat-worker/templates/_ports.tpl new file mode 100644 index 00000000..4625205d --- /dev/null +++ b/kubernetes/helm-chart/charts/sortinghat-worker/templates/_ports.tpl @@ -0,0 +1,6 @@ +{{/* +Port catalogs for all services +*/}} +{{- define "sortinghat-worker.port" -}} +{{ ".Values.sortinghat-worker.service.targetPort" | default "9314" }} +{{- end }} diff --git a/kubernetes/helm-chart/charts/sortinghat-worker/templates/deployment.yaml b/kubernetes/helm-chart/charts/sortinghat-worker/templates/deployment.yaml index f7938dde..f829644e 100644 --- a/kubernetes/helm-chart/charts/sortinghat-worker/templates/deployment.yaml +++ b/kubernetes/helm-chart/charts/sortinghat-worker/templates/deployment.yaml @@ -4,9 +4,9 @@ metadata: name: "{{ .Values.appConfig.name }}" labels: app: "{{ .Values.appConfig.name }}" - {{- include "sortinghat-worker-pod-labels" . | nindent 4 }} + {{- include "metadata.sortinghatWorker.pod.labels" . | nindent 4 }} annotations: - {{- include "sortinghat-worker-pod-annotations" . | nindent 4 }} + {{- include "metadata.sortinghatWorker.pod.annotations" . | nindent 4 }} spec: replicas: {{ .Values.appConfig.replicas }} @@ -17,9 +17,9 @@ spec: metadata: labels: app: "{{ .Values.appConfig.name }}" - {{- include "sortinghat-worker-pod-labels" . | nindent 8 }} + {{- include "metadata.sortinghatWorker.pod.labels" . | nindent 8 }} annotations: - {{- include "sortinghat-worker-pod-annotations" . | nindent 8 }} + {{- include "metadata.sortinghatWorker.pod.annotations" . | nindent 8 }} spec: {{- with .Values.global.topologyConfig }} {{- toYaml . | nindent 6 }} @@ -34,48 +34,26 @@ spec: image: {{ .Values.appConfig.image }} ports: - containerPort: {{ .Values.service.targetPort }} + # v ---- Volume mount define ---- {{- if .Values.dependencies.storage.enabled }} volumeMounts: - {{- range .Values.dependencies.storage.volumes }} - - name: {{ .name }} - mountPath: {{ .mountPath }} - {{- if and (eq .type "configmap") (hasKey . "subPath") .subPath }} - subPath: {{ .subPath }} - {{- end }} - {{- end }} + {{- include "template.volumeMount" . | nindent 12 }} {{- end }} + # ^ ---- Volume mount define ---- + # v ---- Resources define ---- resources: - limits: - cpu: {{ .Values.appConfig.resources.cpu.limits | quote }} - memory: {{ .Values.appConfig.resources.memory.limits | quote }} - requests: - cpu: {{ .Values.appConfig.resources.cpu.requests | quote }} - memory: {{ .Values.appConfig.resources.memory.requests | quote}} + {{- include "template.resQuota" . | nindent 12 }} + # ^ ---- Resources define ---- env: + {{- include "nativeEnv.sortinghatWorker" . | nindent 12 }} {{- with .Values.extraEnvs }} {{- toYaml . | nindent 12 }} {{- end }} + # v ---- Volumes define ---- {{- if .Values.dependencies.storage.enabled }} volumes: - {{- range .Values.dependencies.storage.volumes }} - - name: {{ .name }} - {{- if eq .type "pvc" }} - persistentVolumeClaim: - claimName: {{ .name }}-pvc - {{- else if eq .type "configmap" }} - configMap: - name: {{ $.Release.Name }}-configmap - {{- if and (hasKey . "configmapKey") (hasKey . "asFile" ) .confimapKey .asFile }} - items: - - key: {{ .configmapKey }} - path: {{ .asFile }} - {{- end }} - {{- else if eq .type "secret" }} - secret: - secretName: {{ .name }}-secret - {{- else }} - emptyDir: - sizeLimit: 100Mi - {{- end }} + {{- range .Values.dependencies.storage.volumes }} + {{- include "template.volumes" (dict "item" . "root" $ ) | nindent 8 }} {{- end }} - {{- end }} \ No newline at end of file + {{- end }} + # ^ ---- Volumes define ---- diff --git a/kubernetes/helm-chart/charts/sortinghat-worker/templates/pvc.yaml b/kubernetes/helm-chart/charts/sortinghat-worker/templates/pvc.yaml index da765b3b..babc5bee 100644 --- a/kubernetes/helm-chart/charts/sortinghat-worker/templates/pvc.yaml +++ b/kubernetes/helm-chart/charts/sortinghat-worker/templates/pvc.yaml @@ -1,17 +1,3 @@ {{- range .Values.dependencies.storage.volumes }} - {{- if eq .type "pvc" }} -apiVersion: v1 -kind: PersistentVolumeClaim -metadata: - name: {{ .name }}-pvc - labels: - app: "{{ $.Release.Name }}" -spec: - storageClassName: "{{ .storageClass }}" - accessModes: - - ReadWriteMany - resources: - requests: - storage: {{ .size }} - {{- end }} -{{- end }} \ No newline at end of file +{{- include "template.pvc" ( dict "item" . "root" $ ) }} +{{- end }} diff --git a/kubernetes/helm-chart/charts/sortinghat-worker/templates/service.yaml b/kubernetes/helm-chart/charts/sortinghat-worker/templates/service.yaml index 9d4d4dcb..33ad470c 100644 --- a/kubernetes/helm-chart/charts/sortinghat-worker/templates/service.yaml +++ b/kubernetes/helm-chart/charts/sortinghat-worker/templates/service.yaml @@ -4,26 +4,8 @@ metadata: name: "{{ .Values.appConfig.name }}" labels: app: "{{ .Values.appConfig.name }}" - {{- include "sortinghat-worker-service-labels" . | nindent 4 }} + {{- include "metadata.sortinghatWorker.service.labels" . | nindent 4 }} annotations: - {{- include "sortinghat-worker-service-annotations" . | nindent 4 }} + {{- include "metadata.sortinghatWorker.service.annotations" . | nindent 4 }} spec: - ports: - - protocol: TCP - name: "{{ .Values.appConfig.name }}-service" - {{- if eq .Values.service.scheme "http" }} - port: 80 - targetPort: {{ .Values.service.targetPort }} - {{- end }} - {{- if eq .Values.service.scheme "https" }} - port: 443 - targetPort: {{ .Values.service.targetPort }} - {{- end }} - {{- if eq .Values.service.scheme "passthrough" }} - port: {{ .Values.service.targetPort }} - targetPort: {{ .Values.service.targetPort }} - {{- end }} - type: {{ .Values.service.type | default "ClusterIP" | quote }} - sessionAffinity: None - selector: - app: "{{ .Values.appConfig.name }}" \ No newline at end of file + {{- include "template.service" . | nindent 2 }} diff --git a/kubernetes/helm-chart/charts/sortinghat-worker/values.yaml b/kubernetes/helm-chart/charts/sortinghat-worker/values.yaml index 4792c2aa..b391cbc2 100644 --- a/kubernetes/helm-chart/charts/sortinghat-worker/values.yaml +++ b/kubernetes/helm-chart/charts/sortinghat-worker/values.yaml @@ -4,14 +4,14 @@ global: imageRegistry: "" appName: "" -enabled: true +install: true appConfig: name: sortinghat-worker replicas: 1 image: docker.io/grimoirelab/sortinghat-worker:latest pullPolicy: IfNotPresent - metadata: {} + labels: {} annotations: {} resources: @@ -34,4 +34,4 @@ service: scheme: "http" type: "" # Default to "ClusterIP" -extraEnvs: [] \ No newline at end of file +extraEnvs: [] diff --git a/kubernetes/helm-chart/charts/sortinghat/Chart.yaml b/kubernetes/helm-chart/charts/sortinghat/Chart.yaml index 11576767..364f9a6a 100644 --- a/kubernetes/helm-chart/charts/sortinghat/Chart.yaml +++ b/kubernetes/helm-chart/charts/sortinghat/Chart.yaml @@ -1,5 +1,10 @@ apiVersion: v2 name: sortinghat -description: Sortinghat service for GrimoireLab -appVersion: 1.0 -version: 1.0 \ No newline at end of file +description: Sortinghat service for GrimoireLab, a tool to manage identities. +home: https://github.com/chaoss/grimoirelab +icon: https://www.gravatar.com/avatar/4154acefea56ed23bddaaa47a4850400 +maintainers: +- name: Arie + url: https://github.com/Eroyi +appVersion: 1.7.0 #Based on the "Github Release" version (which is the docker image tag referring from), not the actual application version. +version: 1.0 diff --git a/kubernetes/helm-chart/charts/sortinghat/templates/_helper.tpl b/kubernetes/helm-chart/charts/sortinghat/templates/_helper.tpl index 1f92e741..b6cb2b6c 100644 --- a/kubernetes/helm-chart/charts/sortinghat/templates/_helper.tpl +++ b/kubernetes/helm-chart/charts/sortinghat/templates/_helper.tpl @@ -1,7 +1,7 @@ {{/* Sortinghat labels */}} -{{- define "sortinghat-pod-labels" -}} +{{- define "metadata.sortinghat.pod.labels" -}} {{- range $name, $value := .Values.appConfig.labels }} {{ $name }}: {{ $value | quote }} {{- end -}} @@ -10,7 +10,7 @@ Sortinghat labels {{/* Sortinghat annotations */}} -{{- define "sortinghat-pod-annotations" -}} +{{- define "metadata.sortinghat.pod.annotations" -}} {{- range $name, $value := .Values.appConfig.annotations }} {{ $name }}: {{ $value | quote }} {{- end -}} @@ -20,7 +20,7 @@ Sortinghat annotations {{/* Sortinghat Service labels */}} -{{- define "sortinghat-service-labels" -}} +{{- define "metadata.sortinghat.service.labels" -}} {{- range $name, $value := .Values.service.labels }} {{ $name }}: {{ $value | quote }} {{- end -}} @@ -29,8 +29,8 @@ Sortinghat Service labels {{/* Sortinghat Service annotations */}} -{{- define "sortinghat-service-annotations" -}} +{{- define "metadata.sortinghat.service.annotations" -}} {{- range $name, $value := .Values.service.annotations }} {{ $name }}: {{ $value | quote }} {{- end -}} -{{- end -}} \ No newline at end of file +{{- end -}} diff --git a/kubernetes/helm-chart/charts/sortinghat/templates/_ports.tpl b/kubernetes/helm-chart/charts/sortinghat/templates/_ports.tpl new file mode 100644 index 00000000..5662d608 --- /dev/null +++ b/kubernetes/helm-chart/charts/sortinghat/templates/_ports.tpl @@ -0,0 +1,6 @@ +{{/* +Port catalogs for all services +*/}} +{{- define "sortinghat.port" -}} +{{ ".Values.sortinghat.service.targetPort" | default "9314" }} +{{- end }} diff --git a/kubernetes/helm-chart/charts/sortinghat/templates/deployment.yaml b/kubernetes/helm-chart/charts/sortinghat/templates/deployment.yaml index d555aa76..1214a228 100644 --- a/kubernetes/helm-chart/charts/sortinghat/templates/deployment.yaml +++ b/kubernetes/helm-chart/charts/sortinghat/templates/deployment.yaml @@ -4,9 +4,9 @@ metadata: name: {{ .Values.appConfig.name }} labels: app: "{{ .Values.appConfig.name }}" - {{- include "sortinghat-pod-labels" . | nindent 4 }} + {{- include "metadata.sortinghat.pod.labels" . | nindent 4 }} annotations: - {{- include "sortinghat-pod-annotations" . | nindent 4 }} + {{- include "metadata.sortinghat.pod.annotations" . | nindent 4 }} spec: replicas: {{ .Values.appConfig.replicas }} @@ -17,9 +17,9 @@ spec: metadata: labels: app: "{{ .Values.appConfig.name }}" - {{- include "sortinghat-pod-labels" . | nindent 8 }} + {{- include "metadata.sortinghat.pod.labels" . | nindent 8 }} annotations: - {{- include "sortinghat-pod-annotations" . | nindent 8 }} + {{- include "metadata.sortinghat.pod.annotations" . | nindent 8 }} spec: {{- with .Values.global.topologyConfig }} {{- toYaml . | nindent 6 }} @@ -34,48 +34,26 @@ spec: image: {{ .Values.appConfig.image }} ports: - containerPort: {{ .Values.service.targetPort }} + # v ---- Volume mount define ---- {{- if .Values.dependencies.storage.enabled }} volumeMounts: - {{- range .Values.dependencies.storage.volumes }} - - name: {{ .name }} - mountPath: {{ .mountPath }} - {{- if and (eq .type "configmap") (hasKey . "subPath") .subPath }} - subPath: {{ .subPath }} - {{- end }} - {{- end }} + {{- include "template.volumeMount" . | nindent 12 }} {{- end }} + # ^ ---- Volume mount define ---- + # v ---- Resources define ---- resources: - limits: - cpu: {{ .Values.appConfig.resources.cpu.limits | quote }} - memory: {{ .Values.appConfig.resources.memory.limits | quote }} - requests: - cpu: {{ .Values.appConfig.resources.cpu.requests | quote }} - memory: {{ .Values.appConfig.resources.memory.requests | quote}} + {{- include "template.resQuota" . | nindent 12 }} + # ^ ---- Resources define ---- env: + {{- include "nativeEnv.sortinghat" . | nindent 12 }} {{- with .Values.extraEnvs }} {{- toYaml . | nindent 12 }} {{- end }} + # v ---- Volumes define ---- {{- if .Values.dependencies.storage.enabled }} volumes: - {{- range .Values.dependencies.storage.volumes }} - - name: {{ .name }} - {{- if eq .type "pvc" }} - persistentVolumeClaim: - claimName: {{ .name }}-pvc - {{- else if eq .type "configmap" }} - configMap: - name: {{ $.Release.Name }}-configmap - {{- if and (hasKey . "configmapKey") (hasKey . "asFile" ) .confimapKey .asFile }} - items: - - key: {{ .configmapKey }} - path: {{ .asFile }} - {{- end }} - {{- else if eq .type "secret" }} - secret: - secretName: {{ .name }}-secret - {{- else }} - emptyDir: - sizeLimit: 100Mi - {{- end }} + {{- range .Values.dependencies.storage.volumes }} + {{- include "template.volumes" (dict "item" . "root" $ ) | nindent 8 }} {{- end }} {{- end }} + # ^ ---- Volumes define ---- diff --git a/kubernetes/helm-chart/charts/sortinghat/templates/pvc.yaml b/kubernetes/helm-chart/charts/sortinghat/templates/pvc.yaml index da765b3b..babc5bee 100644 --- a/kubernetes/helm-chart/charts/sortinghat/templates/pvc.yaml +++ b/kubernetes/helm-chart/charts/sortinghat/templates/pvc.yaml @@ -1,17 +1,3 @@ {{- range .Values.dependencies.storage.volumes }} - {{- if eq .type "pvc" }} -apiVersion: v1 -kind: PersistentVolumeClaim -metadata: - name: {{ .name }}-pvc - labels: - app: "{{ $.Release.Name }}" -spec: - storageClassName: "{{ .storageClass }}" - accessModes: - - ReadWriteMany - resources: - requests: - storage: {{ .size }} - {{- end }} -{{- end }} \ No newline at end of file +{{- include "template.pvc" ( dict "item" . "root" $ ) }} +{{- end }} diff --git a/kubernetes/helm-chart/charts/sortinghat/templates/service.yaml b/kubernetes/helm-chart/charts/sortinghat/templates/service.yaml index 46090584..2dda92ee 100644 --- a/kubernetes/helm-chart/charts/sortinghat/templates/service.yaml +++ b/kubernetes/helm-chart/charts/sortinghat/templates/service.yaml @@ -4,26 +4,8 @@ metadata: name: "{{ .Values.appConfig.name }}" labels: app: "{{ .Values.appConfig.name }}" - {{- include "sortinghat-service-labels" . | nindent 4 }} + {{- include "metadata.sortinghat.service.labels" . | nindent 4 }} annotations: - {{- include "sortinghat-service-annotations" . | nindent 4 }} + {{- include "metadata.sortinghat.service.annotations" . | nindent 4 }} spec: - ports: - - protocol: TCP - name: "{{ .Values.appConfig.name }}-service" - {{- if eq .Values.service.scheme "http" }} - port: 80 - targetPort: {{ .Values.service.targetPort }} - {{- end }} - {{- if eq .Values.service.scheme "https" }} - port: 443 - targetPort: {{ .Values.service.targetPort }} - {{- end }} - {{- if eq .Values.service.scheme "passthrough" }} - port: {{ .Values.service.targetPort }} - targetPort: {{ .Values.service.targetPort }} - {{- end }} - type: {{ .Values.service.type | default "ClusterIP" | quote }} - sessionAffinity: None - selector: - app: "{{ .Values.appConfig.name }}" \ No newline at end of file + {{- include "template.service" . | nindent 2 }} diff --git a/kubernetes/helm-chart/charts/sortinghat/values.yaml b/kubernetes/helm-chart/charts/sortinghat/values.yaml index b8b22c57..3a4096c0 100644 --- a/kubernetes/helm-chart/charts/sortinghat/values.yaml +++ b/kubernetes/helm-chart/charts/sortinghat/values.yaml @@ -4,14 +4,13 @@ global: imageRegistry: "" appName: "" -enabled: true +install: true appConfig: name: "sortinghat" replicas: 1 image: docker.io/grimoirelab/sortinghat:latest pullPolicy: IfNotPresent - metadata: {} labels: {} annotations: {} resources: @@ -39,4 +38,4 @@ service: scheme: "http" type: "" # Default to "ClusterIP" -extraEnvs: [] \ No newline at end of file +extraEnvs: [] diff --git a/kubernetes/helm-chart/templates/_credentials.tpl b/kubernetes/helm-chart/templates/_credentials.tpl new file mode 100644 index 00000000..ac24affa --- /dev/null +++ b/kubernetes/helm-chart/templates/_credentials.tpl @@ -0,0 +1,22 @@ +{{/* +Define various credentials recources +*/}} +{{- define "cred.database.username" -}} + {{- $username := default "root" .Values.global.credentials.database.username -}} + {{- $username -}} +{{- end }} + +{{- define "cred.database.password" -}} + {{- $password := default "mar1adb4Grim0ir3Lab" .Values.global.credentials.database.password -}} + {{- $password -}} +{{- end }} + +{{- define "cred.opensearchNode.password" -}} + {{- $password := default "O54Grim0ir3Lab" .Values.global.credentials.opensearchNode.password -}} + {{- $password -}} +{{- end }} + +{{- define "cred.redis.password" -}} + {{- $password := default "red1s4Grim0ir3Lab" .Values.global.credentials.redis.password -}} + {{- $password -}} +{{- end }} diff --git a/kubernetes/helm-chart/templates/_env.tpl b/kubernetes/helm-chart/templates/_env.tpl new file mode 100644 index 00000000..696388ec --- /dev/null +++ b/kubernetes/helm-chart/templates/_env.tpl @@ -0,0 +1,40 @@ +{{/* +Define various environment that referring from other values +*/}} +{{- define "nginx-extraEnvs.env" -}} +- name: KIBANA_HOST + value: http://opensearch-dashboard:{{ include "opensearch-dashboard.port" . }}/ +{{- end }} + +{{- define "sortinghat-extraEnvs.env" -}} +- name: SORTINGHAT_DB_USER + value: "{{ include "database-username.cred" . }}" +- name: SORTINGHAT_DB_PASSWORD + value: "{{ include "database-password.cred" . }}" +- name: SORTINGHAT_REDIS_PASSWORD + value: "{{ include "redis-password.cred" . }}" +- name: SORTINGHAT_CORS_ALLOWED_ORIGINS + value: "http://localhost:{{ include "nginx-listen.port" . }},http://127.0.0.1:{{ include "nginx-listen.port" . }},http://0.0.0.0:{{ include "nginx-listen.port" . }} +{{- end }} + +{{- define "sortinghat-worker-extraEnvs.env" -}} +- name: SORTINGHAT_DB_USER + value: "{{ include "database-username.cred" . }}" +- name: SORTINGHAT_DB_PASSWORD + value: "{{ include "database-password.cred" . }}" +- name: SORTINGHAT_REDIS_PASSWORD + value: "{{ include "redis-password.cred" . }}" +{{- end }} + +{{- define "opensearch-dashboard-extraEnvs.env" -}} +- name: OPENSEARCH_HOSTS + value: "[\"https://opensearch-node:{{ include "opensearch-node.port" . }}\"]" +{{- end }} + +{{- define "opensearch-node-extraEnvs.env" -}} +- name: OPENSEARCH_INITIAL_ADMIN_PASSWORD + value: "{{ include "opensearch-node-password.cred" . }}" +{{- end }} + +{{- define "mordred-extraEnvs.env" }} +{{- end }} \ No newline at end of file diff --git a/kubernetes/helm-chart/templates/_envs.tpl b/kubernetes/helm-chart/templates/_envs.tpl new file mode 100644 index 00000000..71cf245d --- /dev/null +++ b/kubernetes/helm-chart/templates/_envs.tpl @@ -0,0 +1,40 @@ +{{/* +Define various environment that referring from other values +*/}} +{{- define "nativeEnv.nginx" -}} +- name: KIBANA_HOST + value: "http://opensearch-dashboard:{{ include "port.opensearchDashboard" . }}/" +{{- end }} + +{{- define "nativeEnv.sortinghat" -}} +- name: SORTINGHAT_DB_USER + value: "{{ include "cred.database.username" . }}" +- name: SORTINGHAT_DB_PASSWORD + value: "{{ include "cred.database.password" . }}" +- name: SORTINGHAT_REDIS_PASSWORD + value: "{{ include "cred.redis.password" . }}" +- name: SORTINGHAT_CORS_ALLOWED_ORIGINS + value: "http://localhost:{{ include "port.nginxListen" . }},http://127.0.0.1:{{ include "port.nginxListen" . }},http://0.0.0.0:{{ include "port.nginxListen" . }}" +{{- end }} + +{{- define "nativeEnv.sortinghatWorker" -}} +- name: SORTINGHAT_DB_USER + value: "{{ include "cred.database.username" . }}" +- name: SORTINGHAT_DB_PASSWORD + value: "{{ include "cred.database.password" . }}" +- name: SORTINGHAT_REDIS_PASSWORD + value: "{{ include "cred.redis.password" . }}" +{{- end }} + +{{- define "nativeEnv.opensearchDashboard" -}} +- name: OPENSEARCH_HOSTS + value: "[\"https://opensearch-node:{{ include "port.opensearchNode" . }}\"]" +{{- end }} + +{{- define "nativeEnv.opensearchNode" -}} +- name: OPENSEARCH_INITIAL_ADMIN_PASSWORD + value: "{{ include "cred.opensearchNode.password" . }}" +{{- end }} + +{{- define "nativeEnv.mordred" }} +{{- end }} diff --git a/kubernetes/helm-chart/templates/_ports.tpl b/kubernetes/helm-chart/templates/_ports.tpl new file mode 100644 index 00000000..24c88e01 --- /dev/null +++ b/kubernetes/helm-chart/templates/_ports.tpl @@ -0,0 +1,49 @@ +{{/* +Port catalogs for all services + +{{- define "port.sortinghat" -}} +{{- printf .Values.sortinghat.service.targetPort | default "9314" }} +{{- end }} + +{{- define "port.sortinghatWorker" -}} +{{- printf .Values.sortinghatWorker.service.targetPort | default "9314" }} +{{- end }} + +{{- define "port.nginxListen" -}} +{{- printf .Values.nginx.service.targetPort | default "8000" }} +{{- end }} + +{{- define "port.opensearchNode" -}} +{{- printf .Values.opensearchNode.service.targetPort | default "9200" }} +{{- end }} + +{{- define "port.opensearchDashboard" -}} +{{- printf .Values.opensearchDashboard.service.targetPort | default "5601" }} +{{- end }} +*/}} + +{{- define "port.sortinghat" -}} + {{- $sortinghat := default 9314 -}} + {{- $sortinghat -}} +{{- end }} + +{{- define "port.sortinghatWorker" -}} + {{- $sortinghatWorker := default 9314 -}} + {{- $sortinghatWorker -}} +{{- end }} + +{{- define "port.nginxListen" -}} + {{- $nginxListen := default 8000 -}} + {{- $nginxListen -}} +{{- end }} + +{{- define "port.opensearchNode" -}} + {{- $opensearchNode := default 9200 -}} + {{- $opensearchNode -}} +{{- end }} + +{{- define "port.opensearchDashboard" -}} + {{- $opensearchDashboard := default 5601 -}} + {{- $opensearchDashboard -}} +{{- end }} + diff --git a/kubernetes/helm-chart/templates/_template.tpl b/kubernetes/helm-chart/templates/_template.tpl new file mode 100644 index 00000000..f02742f5 --- /dev/null +++ b/kubernetes/helm-chart/templates/_template.tpl @@ -0,0 +1,85 @@ +{{/* +Helm chart templates +*/}} +{{- define "volume-mount.template" -}} +{{- range .Values.dependencies.storage.volumes }} + - name: {{ .name }} + mountPath: {{ .mountPath }} + {{- if and (eq .type "configmap") (hasKey . "subPath") .subPath }} + subPath: {{ .subPath }} + {{- end }} +{{- end }} +{{- end }} + +{{- define "volumes.template" -}} +- name: {{ .name }} + {{- if eq .type "pvc" }} + persistentVolumeClaim: + claimName: {{ .name }}-pvc + {{- else if eq .type "configmap" }} + configMap: + name: {{ $.Release.Name }}-configmap + {{- if and (hasKey . "configmapKey") (hasKey . "asFile") .configmapKey .asFile }} + items: + - key: {{ .configmapKey }} + path: {{ .asFile }} + {{- end }} + {{- else if eq .type "secret" }} + secret: + secretName: {{ .name }}-secret + {{- else }} + emptyDir: + sizeLimit: 100Mi + {{- end }} +{{- end }} + +{{- define "resources.template" -}} +limits: + cpu: {{ .Values.appConfig.resources.cpu.limits | quote }} + memory: {{ .Values.appConfig.resources.memory.limits | quote }} +requests: + cpu: {{ .Values.appConfig.resources.cpu.requests | quote }} + memory: {{ .Values.appConfig.resources.memory.requests | quote }} +{{- end }} + +{{- define "pvc.template" -}} +{{- range .Values.dependencies.storage.volumes }} + {{- if eq .type "pvc" }} +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: {{ .name }}-pvc + labels: + app: "{{ $.Release.Name }}" +spec: + storageClassName: "{{ .storageClass }}" + accessModes: + - ReadWriteMany + resources: + requests: + storage: {{ .size }} + {{- end }} +{{- end }} +{{- end }} + +{{- define "service.template" -}} +ports: + - protocol: TCP + name: "{{ .Values.appConfig.name }}-service" + {{- if eq .Values.service.scheme "http" }} + port: 80 + targetPort: {{ .Values.service.targetPort }} + {{- end }} + {{- if eq .Values.service.scheme "https" }} + port: 443 + targetPort: {{ .Values.service.targetPort }} + {{- end }} + {{- if eq .Values.service.scheme "passthrough" }} + port: {{ .Values.service.targetPort }} + targetPort: {{ .Values.service.targetPort }} + {{- end }} +type: {{ .Values.service.type | default "ClusterIP" | quote }} +sessionAffinity: None +selector: + app: "{{ .Values.appConfig.name }}" +{{- end }} diff --git a/kubernetes/helm-chart/templates/_templates.tpl b/kubernetes/helm-chart/templates/_templates.tpl new file mode 100644 index 00000000..605652cb --- /dev/null +++ b/kubernetes/helm-chart/templates/_templates.tpl @@ -0,0 +1,89 @@ +{{/* +Common Helm chart templates abstract +*/}} + + +{{- define "template.volumeMount" -}} +{{- range .Values.dependencies.storage.volumes }} +- name: {{ .name }} + mountPath: {{ .mountPath }} + {{- if and (eq .type "configmap") (hasKey . "subPath") .subPath }} + subPath: {{ .subPath }} + {{- end }} +{{- end }} +{{- end }} + + +{{- define "template.volumes" -}} +- name: {{ .item.name }} + {{- if eq .item.type "pvc" }} + persistentVolumeClaim: + claimName: {{ .item.name }}-pvc + {{- else if eq .item.type "configmap" }} + configMap: + name: {{ .root.Release.Name }}-configmap + {{- if and (hasKey .item "configmapKey") (hasKey .item "asFile") }} + items: + - key: {{ .item.configmapKey }} + path: {{ .item.asFile }} + {{- end }} + {{- else if eq .item.type "secret" }} + secret: + secretName: {{ .item.name }}-secret + {{- else }} + emptyDir: + sizeLimit: 100Mi + {{- end }} +{{- end }} + + +{{- define "template.resQuota" -}} +limits: + cpu: {{ .Values.appConfig.resources.cpu.limits | quote }} + memory: {{ .Values.appConfig.resources.memory.limits | quote }} +requests: + cpu: {{ .Values.appConfig.resources.cpu.requests | quote }} + memory: {{ .Values.appConfig.resources.memory.requests | quote }} +{{- end }} + + +{{- define "template.pvc" -}} + {{- if and (eq .item.type "pvc") (hasKey .item "size" ) }} +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: {{ .item.name }}-pvc + labels: + app: "{{ .root.Release.Name }}" +spec: + storageClassName: "{{ .item.storageClass }}" + accessModes: + - ReadWriteMany + resources: + requests: + storage: {{ .item.size }} + {{- end }} +{{- end }} + + +{{- define "template.service" -}} +ports: + - protocol: TCP + name: "{{ .Values.appConfig.name }}-service" + {{- if eq .Values.service.scheme "http" }} + port: 80 + targetPort: {{ .Values.service.targetPort }} + {{- end }} + {{- if eq .Values.service.scheme "https" }} + port: 443 + targetPort: {{ .Values.service.targetPort }} + {{- end }} + {{- if eq .Values.service.scheme "passthrough" }} + port: {{ .Values.service.targetPort }} + targetPort: {{ .Values.service.targetPort }} + {{- end }} +type: {{ .Values.service.type | default "ClusterIP" | quote }} +sessionAffinity: None +selector: + app: "{{ .Values.appConfig.name }}" +{{- end }} diff --git a/kubernetes/helm-chart/templates/configmap.yaml b/kubernetes/helm-chart/templates/configmap.yaml index 708880d5..1892752b 100644 --- a/kubernetes/helm-chart/templates/configmap.yaml +++ b/kubernetes/helm-chart/templates/configmap.yaml @@ -7,10 +7,10 @@ metadata: data: mordred-setup: |- - {{- include "mordred-setup-config" . | nindent 4 }} + {{- include "config.mordredSetup" . | nindent 4 }} mordred-projects: |- - {{- include "mordred-project-config" . | nindent 4 }} + {{- include "config.mordredProject" . | nindent 4 }} uwsgi-params: |- - {{- include "uwsgi-params" . | nindent 4 }} + {{- include "config.uwsgiParams" . | nindent 4 }} nginx-conf-template: |- - {{- include "nginx-conf-template" . | nindent 4 }} \ No newline at end of file + {{- include "config.nginxConf" . | nindent 4 }} diff --git a/kubernetes/helm-chart/values.yaml b/kubernetes/helm-chart/values.yaml index f34d8923..924a9eb9 100644 --- a/kubernetes/helm-chart/values.yaml +++ b/kubernetes/helm-chart/values.yaml @@ -3,10 +3,17 @@ global: imagePullSecrets: [] imageRegistry: "" appName: grimoirelab + credentials: + database: + username: "root" + password: "mar1adb4Gr1m0ir3Lab" + opensearchNode: + password: "admin" + redis: + password: "grimoirelab" opensearch-node: - enabled: true - + install: true appConfig: replicas: 1 image: docker.io/opensearchproject/opensearch:2.11.1 @@ -19,7 +26,6 @@ opensearch-node: memory: limits: "3000Mi" requests: "2000Mi" - dependencies: storage: enabled: true @@ -29,11 +35,10 @@ opensearch-node: type: pvc storageClass: efs-sc size: 10Gi - service: + targetPort: 9200 scheme: passthrough type: "" - extraEnvs: - name: cluster.name value: "opensearch-cluster" @@ -43,12 +48,11 @@ opensearch-node: value: "single-node" - name: bootstrap.memory_lock value: "true" - - name: "OPENSEARCH_JAVA_OPTS" + - name: OPENSEARCH_JAVA_OPTS value: "-Xms2g -Xmx2g" opensearch-dashboard: - enabled: true - + install: true appConfig: replicas: 1 image: docker.io/opensearchproject/opensearch-dashboards:2.11.1 @@ -61,34 +65,29 @@ opensearch-dashboard: memory: limits: "512Mi" requests: "256Mi" - dependencies: storage: enabled: false - service: + targetPort: 5601 scheme: passthrough type: "" - - extraEnvs: - - name: OPENSEARCH_HOSTS - value: '"[\"https://opensearch-node:9200\"]"' + extraEnvs: [] mordred: - enabled: true + install: true appConfig: replicas: 1 - image: docker.io/grimoirelab/grimoirelab:latest + image: docker.io/grimoirelab/grimoirelab:1.7.0 labels: {} annotations: {} resources: cpu: - limits: "500m" - requests: "200m" + limits: "200m" + requests: "100m" memory: - limits: "1024Mi" - requests: "512Mi" - + limits: "512Mi" + requests: "256Mi" dependencies: storage: enabled: true @@ -104,29 +103,26 @@ mordred: - name: "mordred-log" mountPath: "/home/grimoire/logs" type: emptyDir - service: + targetPort: 8000 scheme: passthrough type: "" - extraEnvs: [] nginx: - enabled: true - + install: true appConfig: replicas: 1 - image: docker.io/nginx:latest + image: docker.io/nginx:1.27.2 labels: {} annotations: {} resources: cpu: - limits: "100m" - requests: "50m" + limits: "50m" + requests: "20m" memory: - limits: "256Mi" - requests: "128Mi" - + limits: "128Mi" + requests: "64Mi" dependencies: storage: enabled: true @@ -142,31 +138,26 @@ nginx: - name: "sortinghat-static" mountPath: "/sortinghat" type: pvc - service: + targetPort: 8000 scheme: passthrough type: "" - - extraEnvs: - - name: KIBANA_HOST - value: http://opensearch-dashboard:5601/ + extraEnvs: [] sortinghat: - enabled: true - + install: true appConfig: replicas: 1 - image: docker.io/grimoirelab/sortinghat:latest + image: docker.io/grimoirelab/sortinghat:1.7.0 labels: {} annotations: {} resources: cpu: - limits: "200m" - requests: "100m" + limits: "50m" + requests: "20m" memory: limits: "512Mi" requests: "256Mi" - dependencies: storage: enabled: true @@ -176,11 +167,10 @@ sortinghat: type: pvc storageClass: efs-sc size: 1Gi - service: + targetPort: 9314 scheme: passthrough type: "" - extraEnvs: - name: SORTINGHAT_SECRET_KEY value: "secret" @@ -190,47 +180,35 @@ sortinghat: value: "3306" - name: SORTINGHAT_DB_DATABASE value: "sortinghat_db" - - name: SORTINGHAT_DB_USER - value: "root" - - name: SORTINGHAT_DB_PASSWORD - value: "mar1adb4Gr1m0ir3Lab" - name: SORTINGHAT_REDIS_HOST value: "redis-master" - - name: SORTINGHAT_REDIS_PASSWORD - value: "grimoirelab" - name: SORTINGHAT_SUPERUSER_USERNAME value: "root" - name: SORTINGHAT_SUPERUSER_PASSWORD value: "root" - name: SORTINGHAT_ALLOWED_HOST - value: "sortinghat,nginx,localhost,127.0.0.1,0.0.0.0,nginx.grimoirelab.svc.cluster.local,[::1]" - - name: SORTINGHAT_CORS_ALLOWED_ORIGINS - value: "http://localhost:8000,http://127.0.0.1:8000,http://0.0.0.0:8000" + value: "sortinghat,nginx,localhost,127.0.0.1,0.0.0.0,[::1]" sortinghat-worker: - enabled: true - + install: true appConfig: replicas: 1 - image: docker.io/grimoirelab/sortinghat-worker:latest + image: docker.io/grimoirelab/sortinghat-worker:1.7.0 labels: {} annotations: {} resources: cpu: - limits: "200m" - requests: "100m" + limits: "1000m" + requests: "50m" memory: - limits: "512Mi" - requests: "256Mi" - + limits: "256Mi" + requests: "128Mi" dependencies: storage: enabled: false - service: scheme: passthrough type: "" - extraEnvs: - name: SORTINGHAT_SECRET_KEY value: "secret" @@ -240,11 +218,11 @@ sortinghat-worker: value: "3306" - name: SORTINGHAT_DB_DATABASE value: "sortinghat_db" - - name: SORTINGHAT_DB_USER - value: "root" - - name: SORTINGHAT_DB_PASSWORD - value: "mar1adb4Gr1m0ir3Lab" - name: SORTINGHAT_REDIS_HOST value: "redis-master" - - name: SORTINGHAT_REDIS_PASSWORD - value: "grimoirelab" \ No newline at end of file + +mariadb: + install: false + +redis: + install: false From 648d3099ea00a41270143453c51f4c77fb8ff583 Mon Sep 17 00:00:00 2001 From: Arie <44765750+Eroyi@users.noreply.github.com> Date: Thu, 7 Nov 2024 16:20:49 +0800 Subject: [PATCH 05/16] fix indent and typo Signed-off-by: Arie <44765750+Eroyi@users.noreply.github.com> Signed-off-by: root <44765750+Eroyi@users.noreply.github.com> --- kubernetes/README.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/kubernetes/README.md b/kubernetes/README.md index 2e15e1fd..248d453f 100644 --- a/kubernetes/README.md +++ b/kubernetes/README.md @@ -55,7 +55,7 @@ Global values are meant to override the specific values across all sub-charts. > 1. Components' names will be omitted. > 2. Resource value has been set to a minimum running quota. -> 3. You can disable these components: `opensearch-node`, `opensearch-dashboard`, `mariadb`, `redis` +> 3. You can disable these components: `opensearch-node`, `opensearch-dashboard`, `mariadb`, `redis`. | Name | Description | Type | Default value | | ---- | ----------- | ---- | ------------- | @@ -79,9 +79,9 @@ Global values are meant to override the specific values across all sub-charts. | `volumes.name` | Name of this volumes when referencing in yaml | string | --- | | `volumes.mountPath` | Path of this volumes to be mount into container | string | --- | | `volumes.type` | Type of this volumes. `pvc`, `configmap` or `emptyDir` | string | --- | -| `volumes.storageClass` | The strorage class that will be used when creating PVC | string | gp3 | +| `volumes.storageClass` | The storage class that will be used when creating PVC | string | gp3 | | `volumes.size` | Size of this volume | string | --- | -| `volumes.subPath` | Declair the `subPath` while mounting in `configmap` type | string | --- | +| `volumes.subPath` | Declare the `subPath` while mounting in `configmap` type | string | --- | `volumes` have 3 types of schemas, here are the example: @@ -105,11 +105,11 @@ This will result: ```yaml - name: "volume-name" -mountPath: "/path/to/mount/in/container" -type: pvc + mountPath: "/path/to/mount/in/container" + type: pvc ``` This will result: -- Mounted as Volumes with the name "volume-name". (If these volumes are not created, the mounting attempt will fail.) +- Mounted as Volumes with the name "volume-name". If these volumes are not created, the mounting attempt will fail. - in /path/to/mount/in/container > If you did NOT declare the size, PVC will not be created. If these volumes have not been created, the mounting attempt will fail. @@ -125,7 +125,7 @@ This will result: This will result: - Mounting file from Configmap with name "config-name". -- in /path/to/mount/in/container + - in /path/to/mount/in/container > If the configmap has NOT been created, or the key declared in "subPath" is not found in the configmap, the mounting attempt will fail. @@ -139,7 +139,7 @@ This will result: This will result: - Mounted as an empty directory with the name "volume-name" -- in /path/to/mount/in/container + - in /path/to/mount/in/container > Data in this volume type will be lost when the pod is restarted. From 93d86af57f7948aacecdec7db87a02bdf9fcd061 Mon Sep 17 00:00:00 2001 From: Arie <44765750+Eroyi@users.noreply.github.com> Date: Thu, 7 Nov 2024 16:25:33 +0800 Subject: [PATCH 06/16] restore readme.md Signed-off-by: Arie <44765750+Eroyi@users.noreply.github.com> Signed-off-by: root <44765750+Eroyi@users.noreply.github.com> --- kubernetes/README.md | 211 +++++++++---------------------------------- 1 file changed, 43 insertions(+), 168 deletions(-) diff --git a/kubernetes/README.md b/kubernetes/README.md index 248d453f..429a9b7a 100644 --- a/kubernetes/README.md +++ b/kubernetes/README.md @@ -1,168 +1,43 @@ -# Introduction -This chart launches a grimoirelab deployment on a Kubernetes cluster using the helm package manager. - - -# Prerequisites Component -- Mariadb -- Redis -- Opensearch **(!)** -- Opensearch Dashboard **(!)** - - -**(!)**: A component with this mark means this chart is already integrated with that component. - -You can deploy and configure the **(!)** component within this chart via `Values.yaml`. - -If you like to bring your own components, you can disable the installation of the built-in chart, with `install: false` option *(see detail below)*. - - - -# Installing the Chart - -To install the chart with the release name `grimoirelab` -```console -helm install grimoirelab /path/to/chart --values /path/to/chart/values.yaml -n grimoirelab -``` -`-n`: The namespace you would like to put this release in. - - - - -# Configure the chart - -Tips: Use `Ctrl+F / Command+F` search the keywords in `Values.yaml` for quick navigation. - - - - -## Global - -Global values are meant to override the specific values across all sub-charts. -| Name | Description | Type | Default value | -| ---- | ----------- | ---- | ------------- | -| `topologyConfig` | The topology configuration for this chart, affect all components | map | {} | -| `imagePullSecrets` | Only required when you are pulling image from private registry | list | [] | -| `appName` | Name of this chart | string | "" | -| `credentials.database.username` | Plaintext. Username for database connection | string | "root" | -| `credentials.database.password` | Plaintext. Password for the database connection | "mar1adb4Gr1m0ir3Lab" | -| `credentials.opensearchNode.password` | Plaintext. Password for the opensearch connection | string | "admin" | -| `credentials.redis.password` | Plaintext. Password for the redis connection | string | "grimoirelab" | - - -## Component - -### Grimoirelab components - -> 1. Components' names will be omitted. -> 2. Resource value has been set to a minimum running quota. -> 3. You can disable these components: `opensearch-node`, `opensearch-dashboard`, `mariadb`, `redis`. - -| Name | Description | Type | Default value | -| ---- | ----------- | ---- | ------------- | -| `install` | Installation toggle for this component. | boolean | true / false | -| `appConfig.replicas` | Replica count for this deployment | int | 1 | -| `appConfig.image` | Image for this deployment | string | --- | -| `appConfig.labels` | Labels for this deployment | map | {} | -| `appConfig.annotations` | Annotations for this deployment | map | {} | -| `appConfig.resources` | Resources quota for this deployment | map | --- | - - - - -## Dependencies - -### Storage - -| Name | Description | Type | Default value | -| ---- | ----------- | ---- | ------------- | -| `enabled` | Enable or disable persistent storage. | boolean | true / false | -| `volumes.name` | Name of this volumes when referencing in yaml | string | --- | -| `volumes.mountPath` | Path of this volumes to be mount into container | string | --- | -| `volumes.type` | Type of this volumes. `pvc`, `configmap` or `emptyDir` | string | --- | -| `volumes.storageClass` | The storage class that will be used when creating PVC | string | gp3 | -| `volumes.size` | Size of this volume | string | --- | -| `volumes.subPath` | Declare the `subPath` while mounting in `configmap` type | string | --- | - - - `volumes` have 3 types of schemas, here are the example: - -#### 1. Persistent Volume -```yaml -- name: "volume-name" - mountPath: "/path/to/mount/in/container" - type: pvc - storageClass: your-storageClass - size: 1Gi -``` -This will result: -- A Persistence Volume Claim - - With 1 Gigabyte storage - - with the storageClass you assigned -- Mounted as Volumes with the name "volume-name" - - in /path/to/mount/in/container - - - -```yaml -- name: "volume-name" - mountPath: "/path/to/mount/in/container" - type: pvc -``` -This will result: -- Mounted as Volumes with the name "volume-name". If these volumes are not created, the mounting attempt will fail. - - in /path/to/mount/in/container -> If you did NOT declare the size, PVC will not be created. If these volumes have not been created, the mounting attempt will fail. - - - -### 2. Configmap as file -```yaml -- name: "config-name" - mountPath: "/path/to/file/in/container/file-name.txt" - type: configmap - subPath: "configmap-key-name" -``` - -This will result: -- Mounting file from Configmap with name "config-name". - - in /path/to/mount/in/container -> If the configmap has NOT been created, or the key declared in "subPath" is not found in the configmap, the mounting attempt will fail. - - - -### 3. Empty directory -```yaml -- name: "volume-name" - mountPath: "path/to/mount/in/container" - type: emptyDir -``` - -This will result: -- Mounted as an empty directory with the name "volume-name" - - in /path/to/mount/in/container -> Data in this volume type will be lost when the pod is restarted. - - - - -## Service - -| Name | Description | Type | Default value | -| ---- | ----------- | ---- | ------------- | -| `targetPort` | The port to expose for this deployment | int | --- | -| `schema` | The method when proxy the `targetPort`. `passthrough` will remain the original port, `http` will use 80 and `https` as 443 | string | passthrough | -| `type` | The type of the services for this deployment, default (empty) is `ClusterIP` | string | "" | - -**Attention:** If you would like to change the service port in here, please make sure you have changed them in `templates/_ports.tpl` as well. - - - -## Extra environments - -You can put an extra environments list in here to inject into the container. -```yaml -- name: key - value: "value" -- name: foo - value: "bar" -``` +Running GrimoireLab with Kubernetes +In this folder are configuration manifests for deploying GrimoireLab using Kubernetes. You will need a functional Kubernetes cluster, and you should be able to deploy both versions on k8s, kind, or minikube. There are certainly other options out there as well. + +Requirements +Git client +Kubernetes 1.17+ (managed or local, including kind, minikube, or k3s) +kubectl client and admin credentials to aforementioned Kubernetes cluster +Getting Started +Clone this project: +git clone https://github.com/chaoss/grimoirelab +Since it's impossible to reference external files from within yaml, the configuration templates provided in default-grimoirelab-settings are copied to various config/secret maps. +[30-hatstall-config.yml] - Contains apache-hatstall.conf +[31-hatstall-secret.yml] - Contains shdb.cfg +[50-mordred-config.yml] - Contains projects.json and identities.yml +[51-mordred-config-aliases.yml] - Contains aliases.json +[52-mordred-config-identities.yml] - Contains identities.yml +[53-mordred-secret.yml] - Contains setup.cfg +The two files you'll likely want to modify at first are 50-mordred-config.yml, which includes the relevant project locations in projects.json in addition to 53-mordred-secret.yml, which contains all the configuration settings for collecting the data for your projects. This includes api keys, passwords, and other important artifacts. + +See below more information about these files format. + +Launch the project and use port-forward as shown in this example to access the dashboard. +cd grimoirelab/kubernetes/secure +kubectl apply -f . +kubectl port-forward service/kibiter 5601 -n grimoire +Launch your browser and navigate to http://localhost:5601, and login with the user name admin and password admin. + +To manage the contributors identities, you may port-forward the Hatstall application as well. + +kubectl port-forward service/hatstall 8000:80 -n grimoire +Once forwarded, access your browser at http://localhost:8000, and login using the user name admin, and password admin + +Using an insecure environment +Follow the same steps as above, but use the manifests in the insecure folder. + +More information +The projects.json file format +The setup.cfg file format +Getting API tokens for different services: +GitHub +GitLab +Meetup +Slack From 839fa445cc171745a954a10cfe9b545210952105 Mon Sep 17 00:00:00 2001 From: Arie <44765750+Eroyi@users.noreply.github.com> Date: Thu, 7 Nov 2024 16:26:08 +0800 Subject: [PATCH 07/16] restore readme.md Signed-off-by: Arie <44765750+Eroyi@users.noreply.github.com> Signed-off-by: root <44765750+Eroyi@users.noreply.github.com> --- kubernetes/README.md | 93 +++++++++++++++++++++++++++----------------- 1 file changed, 57 insertions(+), 36 deletions(-) diff --git a/kubernetes/README.md b/kubernetes/README.md index 429a9b7a..bc6894ca 100644 --- a/kubernetes/README.md +++ b/kubernetes/README.md @@ -1,43 +1,64 @@ -Running GrimoireLab with Kubernetes -In this folder are configuration manifests for deploying GrimoireLab using Kubernetes. You will need a functional Kubernetes cluster, and you should be able to deploy both versions on k8s, kind, or minikube. There are certainly other options out there as well. - -Requirements -Git client -Kubernetes 1.17+ (managed or local, including kind, minikube, or k3s) -kubectl client and admin credentials to aforementioned Kubernetes cluster -Getting Started -Clone this project: +# Running GrimoireLab with Kubernetes + +In this folder are configuration manifests for deploying GrimoireLab using [Kubernetes](https://kubernetes.io). You will need a functional Kubernetes cluster, and you should be able to deploy both versions on k8s, kind, or minikube. There are certainly other options out there as well. + +# Requirements + +* [Git](https://git-scm.com/) client +* Kubernetes 1.17+ (managed or local, including kind, minikube, or k3s) +* [kubectl client](https://kubernetes.io/docs/tasks/tools/install-kubectl/) and admin credentials to aforementioned Kubernetes cluster + +# Getting Started + +1. Clone this project: +```console git clone https://github.com/chaoss/grimoirelab -Since it's impossible to reference external files from within yaml, the configuration templates provided in default-grimoirelab-settings are copied to various config/secret maps. -[30-hatstall-config.yml] - Contains apache-hatstall.conf -[31-hatstall-secret.yml] - Contains shdb.cfg -[50-mordred-config.yml] - Contains projects.json and identities.yml -[51-mordred-config-aliases.yml] - Contains aliases.json -[52-mordred-config-identities.yml] - Contains identities.yml -[53-mordred-secret.yml] - Contains setup.cfg -The two files you'll likely want to modify at first are 50-mordred-config.yml, which includes the relevant project locations in projects.json in addition to 53-mordred-secret.yml, which contains all the configuration settings for collecting the data for your projects. This includes api keys, passwords, and other important artifacts. - -See below more information about these files format. - -Launch the project and use port-forward as shown in this example to access the dashboard. +``` + +2. Since it's impossible to reference external files from within yaml, the configuration templates provided in [`default-grimoirelab-settings`](../default-grimoirelab-settings) are copied to various config/secret maps. + +* [`30-hatstall-config.yml`] - Contains [`apache-hatstall.conf`](../default-grimoirelab-settings/apache-hatstall.conf) +* [`31-hatstall-secret.yml`] - Contains [`shdb.cfg`](../default-grimoirelab-settings/shdb.cfg) +* [`50-mordred-config.yml`] - Contains [`projects.json`](../default-grimoirelab-settings/projects.json) and [`identities.yml`](../default-grimoirelab-settings/identities.yml) +* [`51-mordred-config-aliases.yml`] - Contains [`aliases.json`](../default-grimoirelab-settings/aliases.json) +* [`52-mordred-config-identities.yml`] - Contains [`identities.yml`](../default-grimoirelab-settings/identities.yml) +* [`53-mordred-secret.yml`] - Contains [`setup.cfg`](../default-grimoirelab-settings/setup.cfg) + +The two files you'll likely want to modify at first are `50-mordred-config.yml`, which includes the relevant project locations in `projects.json` in addition to `53-mordred-secret.yml`, which contains all the configuration settings for collecting the data for your projects. This includes api keys, passwords, and other important artifacts. + +See [below](#more-information) more information about these files format. + +3. Launch the project and use `port-forward` as shown in this example to access the dashboard. + +```console cd grimoirelab/kubernetes/secure kubectl apply -f . kubectl port-forward service/kibiter 5601 -n grimoire -Launch your browser and navigate to http://localhost:5601, and login with the user name admin and password admin. +``` + +Launch your browser and navigate to `http://localhost:5601`, and login with the user name `admin` and password `admin`. -To manage the contributors identities, you may port-forward the Hatstall application as well. +To manage the contributors identities, you may port-forward the [Hatstall](https://github.com/chaoss/grimoirelab-hatstall) application as well. +```console kubectl port-forward service/hatstall 8000:80 -n grimoire -Once forwarded, access your browser at http://localhost:8000, and login using the user name admin, and password admin - -Using an insecure environment -Follow the same steps as above, but use the manifests in the insecure folder. - -More information -The projects.json file format -The setup.cfg file format -Getting API tokens for different services: -GitHub -GitLab -Meetup -Slack +``` + +Once forwarded, access your browser at `http://localhost:8000`, and login using the user name `admin`, and password `admin` + +--- + +## Using an insecure environment + +Follow the same steps as above, but use the manifests in the `insecure` folder. + + +# More information + +* [The `projects.json` file format](https://github.com/chaoss/grimoirelab-sirmordred#projectsjson) +* [The `setup.cfg` file format](https://github.com/chaoss/grimoirelab-sirmordred#setupcfg) +* Getting API tokens for different services: + * [GitHub](https://help.github.com/en/articles/creating-a-personal-access-token-for-the-command-line) + * [GitLab](https://docs.gitlab.com/ee/user/profile/personal_access_tokens.html) + * [Meetup](https://secure.meetup.com/es-ES/meetup_api/oauth_consumers/) + * [Slack](https://get.slack.help/hc/en-us/articles/215770388-Create-and-regenerate-API-tokens) From 6b274c226ffe0ecd224f12e5de6a342557126b8d Mon Sep 17 00:00:00 2001 From: Arie <44765750+Eroyi@users.noreply.github.com> Date: Thu, 7 Nov 2024 16:26:38 +0800 Subject: [PATCH 08/16] remove file in wrong place Signed-off-by: Arie <44765750+Eroyi@users.noreply.github.com> Signed-off-by: root <44765750+Eroyi@users.noreply.github.com> --- kubernetes/NOTES.txt | 12 ------------ 1 file changed, 12 deletions(-) delete mode 100644 kubernetes/NOTES.txt diff --git a/kubernetes/NOTES.txt b/kubernetes/NOTES.txt deleted file mode 100644 index 9ecc9ce7..00000000 --- a/kubernetes/NOTES.txt +++ /dev/null @@ -1,12 +0,0 @@ -Thank you for installing {{ .Chart.Name }}. - -To visualise data, you need to import dashboards into opensearch-dashboard. - - 1. Visit https://github.com/chaoss/grimoirelab-sigils/tree/master/panels/json/opensearch_dashboards - 2. Download the dashboard you are interested - 3. Open opensearch-dashboard console in your browser, login. - 4. [If its the first install] Click "Explore on my own". - 5. Click "Menu" on the top left corner, then go to "Management" - "Dashboard Management" - 6. [If its the first install] Click "Index patterns" on the left to create the index patterns. - 7. Click "Saved objects" on the left to import "ndjson" dashboard file you downloaded. - 8. Drag or browser the dashboard file, select, then click "Import" - "Done" to import the dashboard. \ No newline at end of file From 69f2cf22b5cec9b5a8d2dd6fe296098d90956af8 Mon Sep 17 00:00:00 2001 From: Arie <44765750+Eroyi@users.noreply.github.com> Date: Thu, 7 Nov 2024 16:30:45 +0800 Subject: [PATCH 09/16] move files to right place Signed-off-by: Arie <44765750+Eroyi@users.noreply.github.com> Signed-off-by: root <44765750+Eroyi@users.noreply.github.com> --- kubernetes/helm-chart/NOTES.txt | 12 +++ kubernetes/helm-chart/README.md | 168 ++++++++++++++++++++++++++++++++ 2 files changed, 180 insertions(+) create mode 100644 kubernetes/helm-chart/NOTES.txt create mode 100644 kubernetes/helm-chart/README.md diff --git a/kubernetes/helm-chart/NOTES.txt b/kubernetes/helm-chart/NOTES.txt new file mode 100644 index 00000000..9ecc9ce7 --- /dev/null +++ b/kubernetes/helm-chart/NOTES.txt @@ -0,0 +1,12 @@ +Thank you for installing {{ .Chart.Name }}. + +To visualise data, you need to import dashboards into opensearch-dashboard. + + 1. Visit https://github.com/chaoss/grimoirelab-sigils/tree/master/panels/json/opensearch_dashboards + 2. Download the dashboard you are interested + 3. Open opensearch-dashboard console in your browser, login. + 4. [If its the first install] Click "Explore on my own". + 5. Click "Menu" on the top left corner, then go to "Management" - "Dashboard Management" + 6. [If its the first install] Click "Index patterns" on the left to create the index patterns. + 7. Click "Saved objects" on the left to import "ndjson" dashboard file you downloaded. + 8. Drag or browser the dashboard file, select, then click "Import" - "Done" to import the dashboard. \ No newline at end of file diff --git a/kubernetes/helm-chart/README.md b/kubernetes/helm-chart/README.md new file mode 100644 index 00000000..fee4b976 --- /dev/null +++ b/kubernetes/helm-chart/README.md @@ -0,0 +1,168 @@ +# Introduction +This chart launches a grimoirelab deployment on a Kubernetes cluster using the helm package manager. + + +# Prerequisites Component +- Mariadb +- Redis +- Opensearch **(!)** +- Opensearch Dashboard **(!)** + + +**(!)**: A component with this mark means this chart is already integrated with that component. + +You can deploy and configure the **(!)** component within this chart via `Values.yaml`. + +If you like to bring your own components, you can disable the installation of the built-in chart, with `install: false` option *(see detail below)*. + + + +# Installing the Chart + +To install the chart with the release name `grimoirelab`: +```console +helm install grimoirelab /path/to/chart --values /path/to/chart/values.yaml -n grimoirelab +``` +`-n`: The namespace you would like to put this release in. + + + + +# Configure the chart + +Tips: Use `Ctrl+F / Command+F` search the keywords in `Values.yaml` for quick navigation. + + + + +## Global + +Global values are meant to override the specific values across all sub-charts. +| Name | Description | Type | Default value | +| ---- | ----------- | ---- | ------------- | +| `topologyConfig` | The topology configuration for this chart, affect all components | map | {} | +| `imagePullSecrets` | Only required when you are pulling image from private registry | list | [] | +| `appName` | Name of this chart | string | "" | +| `credentials.database.username` | Plaintext. Username for database connection | string | "root" | +| `credentials.database.password` | Plaintext. Password for the database connection | "mar1adb4Gr1m0ir3Lab" | +| `credentials.opensearchNode.password` | Plaintext. Password for the opensearch connection | string | "admin" | +| `credentials.redis.password` | Plaintext. Password for the redis connection | string | "grimoirelab" | + + +## Component + +### Grimoirelab components + +> 1. Components' names will be omitted. +> 2. Resource value has been set to a minimum running quota. +> 3. You can disable these components: `opensearch-node`, `opensearch-dashboard`, `mariadb`, `redis`. + +| Name | Description | Type | Default value | +| ---- | ----------- | ---- | ------------- | +| `install` | Installation toggle for this component. | boolean | true / false | +| `appConfig.replicas` | Replica count for this deployment | int | 1 | +| `appConfig.image` | Image for this deployment | string | --- | +| `appConfig.labels` | Labels for this deployment | map | {} | +| `appConfig.annotations` | Annotations for this deployment | map | {} | +| `appConfig.resources` | Resources quota for this deployment | map | --- | + + + + +## Dependencies + +### Storage + +| Name | Description | Type | Default value | +| ---- | ----------- | ---- | ------------- | +| `enabled` | Enable or disable persistent storage. | boolean | true / false | +| `volumes.name` | Name of this volumes when referencing in yaml | string | --- | +| `volumes.mountPath` | Path of this volumes to be mount into container | string | --- | +| `volumes.type` | Type of this volumes. `pvc`, `configmap` or `emptyDir` | string | --- | +| `volumes.storageClass` | The storage class that will be used when creating PVC | string | gp3 | +| `volumes.size` | Size of this volume | string | --- | +| `volumes.subPath` | Declare the `subPath` while mounting in `configmap` type | string | --- | + + + `volumes` have 3 types of schemas, here are the example: + +#### 1. Persistent Volume +```yaml +- name: "volume-name" + mountPath: "/path/to/mount/in/container" + type: pvc + storageClass: your-storageClass + size: 1Gi +``` +This will result: +- A Persistence Volume Claim + - With 1 Gigabyte storage + - with the storageClass you assigned +- Mounted as Volumes with the name "volume-name" + - in /path/to/mount/in/container + + + +```yaml +- name: "volume-name" + mountPath: "/path/to/mount/in/container" + type: pvc +``` +This will result: +- Mounted as Volumes with the name "volume-name". If these volumes are not created, the mounting attempt will fail. + - in /path/to/mount/in/container +> If you did NOT declare the size, PVC will not be created. If these volumes have not been created, the mounting attempt will fail. + + + +### 2. Configmap as file +```yaml +- name: "config-name" + mountPath: "/path/to/file/in/container/file-name.txt" + type: configmap + subPath: "configmap-key-name" +``` + +This will result: +- Mounting file from Configmap with name "config-name". + - in /path/to/mount/in/container +> If the configmap has NOT been created, or the key declared in "subPath" is not found in the configmap, the mounting attempt will fail. + + + +### 3. Empty directory +```yaml +- name: "volume-name" + mountPath: "path/to/mount/in/container" + type: emptyDir +``` + +This will result: +- Mounted as an empty directory with the name "volume-name" + - in /path/to/mount/in/container +> Data in this volume type will be lost when the pod is restarted. + + + + +## Service + +| Name | Description | Type | Default value | +| ---- | ----------- | ---- | ------------- | +| `targetPort` | The port to expose for this deployment | int | --- | +| `schema` | The method when proxy the `targetPort`. `passthrough` will remain the original port, `http` will use 80 and `https` as 443 | string | passthrough | +| `type` | The type of the services for this deployment, default (empty) is `ClusterIP` | string | "" | + +**Attention:** If you would like to change the service port in here, please make sure you have changed them in `templates/_ports.tpl` as well. + + + +## Extra environments + +You can put an extra environments list in here to inject into the container. +```yaml +- name: key + value: "value" +- name: foo + value: "bar" +``` From d561820025856213de85ade0ff17d92b3da15aff Mon Sep 17 00:00:00 2001 From: Arie <44765750+Eroyi@users.noreply.github.com> Date: Thu, 7 Nov 2024 16:32:26 +0800 Subject: [PATCH 10/16] remove file in wrong place Signed-off-by: Arie <44765750+Eroyi@users.noreply.github.com> Signed-off-by: root <44765750+Eroyi@users.noreply.github.com> --- Chart.yaml | 43 ------------------------------------------- 1 file changed, 43 deletions(-) delete mode 100644 Chart.yaml diff --git a/Chart.yaml b/Chart.yaml deleted file mode 100644 index d1602a0d..00000000 --- a/Chart.yaml +++ /dev/null @@ -1,43 +0,0 @@ -apiVersion: v2 -name: grimoirelab -type: application -description: Nested Chart collection for all grimorelab services. -home: https://github.com/chaoss/grimoirelab -icon: https://www.gravatar.com/avatar/4154acefea56ed23bddaaa47a4850400 -maintainers: -- name: Arie - url: https://github.com/Eroyi -version: 1.7.0 #Based on the "Github Release" version (which is the docker image tag referring from), not the actual application version. -appVersion: 1.0 -dependencies: -- name: mordred - repository: file://charts/mordred - version: 1.7.0 -- name: nginx - repository: file://charts/nginx - versio: 1.27.2 -- name: sortinghat - repository: file://charts/sortinghat - version: 1.7.0 -- name: sortinghat-worker - repository: file://charts/sortinghat-worker - version: 1.7.0 - alias: sortinghatWorker -# External Dependencies -- name: opensearch-dashboard - version: 2.11.1 - repository: file://charts/opensearch-dashboard - alias: opensearchDashboard - condition: opensearchDashboard.install -- name: opensearch-node - repository: file://charts/opensearch-node - version: 2.11.1 - alias: opensearchNode - condition: opensearchNode.install -# - name: mariadb -# version: 19.1.0 -# condition: mariadb.install -# - name: redis -# version: 20.2.1 -# condition: redis.install - From dfb8850adf77a0e124ca640c76a9abc4a31d3d63 Mon Sep 17 00:00:00 2001 From: Arie <44765750+Eroyi@users.noreply.github.com> Date: Thu, 7 Nov 2024 16:32:37 +0800 Subject: [PATCH 11/16] remove file in wrong place Signed-off-by: Arie <44765750+Eroyi@users.noreply.github.com> Signed-off-by: root <44765750+Eroyi@users.noreply.github.com> --- values.yaml | 228 ---------------------------------------------------- 1 file changed, 228 deletions(-) delete mode 100644 values.yaml diff --git a/values.yaml b/values.yaml deleted file mode 100644 index 179ade69..00000000 --- a/values.yaml +++ /dev/null @@ -1,228 +0,0 @@ -global: - topologyConfig: {} - imagePullSecrets: [] - imageRegistry: "" - appName: grimoirelab - credentials: - database: - username: "root" - password: "mar1adb4Gr1m0ir3Lab" - opensearchNode: - password: "admin" - redis: - password: "grimoirelab" - -opensearch-node: - install: true - appConfig: - replicas: 1 - image: docker.io/opensearchproject/opensearch:2.11.1 - labels: {} - annotations: {} - resources: - cpu: - limits: "500m" - requests: "300m" - memory: - limits: "3000Mi" - requests: "2000Mi" - dependencies: - storage: - enabled: true - volumes: - - name: "opensearch-data" - mountPath: "/usr/share/opensearch/data" - type: pvc - storageClass: efs-sc - size: 10Gi - service: - targetPort: 9200 - scheme: passthrough - type: "" - extraEnvs: - - name: cluster.name - value: "opensearch-cluster" - - name: node.name - value: "opensearch-node1" - - name: discovery.type - value: "single-node" - - name: bootstrap.memory_lock - value: "true" - - name: OPENSEARCH_JAVA_OPTS - value: "-Xms2g -Xmx2g" - -opensearch-dashboard: - install: true - appConfig: - replicas: 1 - image: docker.io/opensearchproject/opensearch-dashboards:2.11.1 - labels: {} - annotations: {} - resources: - cpu: - limits: "200m" - requests: "100m" - memory: - limits: "512Mi" - requests: "256Mi" - dependencies: - storage: - enabled: false - service: - targetPort: 5601 - scheme: passthrough - type: "" - extraEnvs: [] - -mordred: - install: true - appConfig: - replicas: 1 - image: docker.io/grimoirelab/grimoirelab:1.7.0 - labels: {} - annotations: {} - resources: - cpu: - limits: "500m" - requests: "200m" - memory: - limits: "1024Mi" - requests: "512Mi" - dependencies: - storage: - enabled: true - volumes: - - name: "mordred-setup" - mountPath: "/home/grimoire/conf/setup.cfg" - type: configmap - subPath: "mordred-setup" - - name: "mordred-projects" - mountPath: "/home/grimoire/conf/projects.json" - type: configmap - subPath: "mordred-projects" - - name: "mordred-log" - mountPath: "/home/grimoire/logs" - type: emptyDir - service: - targetPort: 8000 - scheme: passthrough - type: "" - extraEnvs: [] - -nginx: - install: true - appConfig: - replicas: 1 - image: docker.io/nginx:1.27.2 - labels: {} - annotations: {} - resources: - cpu: - limits: "100m" - requests: "50m" - memory: - limits: "256Mi" - requests: "128Mi" - dependencies: - storage: - enabled: true - volumes: - - name: "nginx-conf-template" - mountPath: "/etc/nginx/templates/default.conf.template" - type: configmap - subPath: "nginx-conf-template" - - name: "uwsgi-params" - mountPath: "/etc/nginx/uwsgi_params" - type: configmap - subPath: "uwsgi-params" - - name: "sortinghat-static" - mountPath: "/sortinghat" - type: pvc - service: - targetPort: 8000 - scheme: passthrough - type: "" - extraEnvs: [] - -sortinghat: - install: true - appConfig: - replicas: 1 - image: docker.io/grimoirelab/sortinghat:1.7.0 - labels: {} - annotations: {} - resources: - cpu: - limits: "200m" - requests: "100m" - memory: - limits: "512Mi" - requests: "256Mi" - dependencies: - storage: - enabled: true - volumes: - - name: "sortinghat-static" - mountPath: "/opt/venv/lib/python3.9/site-packages/sortinghat/static" - type: pvc - storageClass: efs-sc - size: 1Gi - service: - targetPort: 9314 - scheme: passthrough - type: "" - extraEnvs: - - name: SORTINGHAT_SECRET_KEY - value: "secret" - - name: SORTINGHAT_DB_HOST - value: "mariadb" - - name: SORTINGHAT_DB_PORT - value: "3306" - - name: SORTINGHAT_DB_DATABASE - value: "sortinghat_db" - - name: SORTINGHAT_REDIS_HOST - value: "redis-master" - - name: SORTINGHAT_SUPERUSER_USERNAME - value: "root" - - name: SORTINGHAT_SUPERUSER_PASSWORD - value: "root" - - name: SORTINGHAT_ALLOWED_HOST - value: "sortinghat,nginx,localhost,127.0.0.1,0.0.0.0,[::1]" - -sortinghat-worker: - install: true - appConfig: - replicas: 1 - image: docker.io/grimoirelab/sortinghat-worker:1.7.0 - labels: {} - annotations: {} - resources: - cpu: - limits: "200m" - requests: "100m" - memory: - limits: "512Mi" - requests: "256Mi" - dependencies: - storage: - enabled: false - service: - scheme: passthrough - type: "" - extraEnvs: - - name: SORTINGHAT_SECRET_KEY - value: "secret" - - name: SORTINGHAT_DB_HOST - value: "mariadb" - - name: SORTINGHAT_DB_PORT - value: "3306" - - name: SORTINGHAT_DB_DATABASE - value: "sortinghat_db" - - name: SORTINGHAT_REDIS_HOST - value: "redis-master" - -mariadb: - install: false - -redis: - install: false From 0e9c86dfe549a73f8e29284b437dafa9cc86f92d Mon Sep 17 00:00:00 2001 From: root <44765750+Eroyi@users.noreply.github.com> Date: Thu, 7 Nov 2024 18:01:16 +0800 Subject: [PATCH 12/16] remove files in wrong places Signed-off-by: Arie <44765750+Eroyi@users.noreply.github.com> Signed-off-by: root <44765750+Eroyi@users.noreply.github.com> --- .../charts/nginx/templates/_ports.tpl | 6 -- .../opensearch-dashboard/templates/_ports.tpl | 6 -- .../opensearch-node/templates/_ports.tpl | 6 -- .../sortinghat-worker/templates/_ports.tpl | 6 -- .../charts/sortinghat/templates/_ports.tpl | 6 -- kubernetes/helm-chart/templates/_env.tpl | 40 --------- kubernetes/helm-chart/templates/_image.tpl | 10 --- kubernetes/helm-chart/templates/_template.tpl | 85 ------------------- 8 files changed, 165 deletions(-) delete mode 100644 kubernetes/helm-chart/charts/nginx/templates/_ports.tpl delete mode 100644 kubernetes/helm-chart/charts/opensearch-dashboard/templates/_ports.tpl delete mode 100644 kubernetes/helm-chart/charts/opensearch-node/templates/_ports.tpl delete mode 100644 kubernetes/helm-chart/charts/sortinghat-worker/templates/_ports.tpl delete mode 100644 kubernetes/helm-chart/charts/sortinghat/templates/_ports.tpl delete mode 100644 kubernetes/helm-chart/templates/_env.tpl delete mode 100644 kubernetes/helm-chart/templates/_image.tpl delete mode 100644 kubernetes/helm-chart/templates/_template.tpl diff --git a/kubernetes/helm-chart/charts/nginx/templates/_ports.tpl b/kubernetes/helm-chart/charts/nginx/templates/_ports.tpl deleted file mode 100644 index 59e46fbd..00000000 --- a/kubernetes/helm-chart/charts/nginx/templates/_ports.tpl +++ /dev/null @@ -1,6 +0,0 @@ -{{/* -Port catalogs for all services -*/}} -{{- define "nginx-listen.port" -}} -{{ ".Values.nginx.service.targetPort" | default "8000" }} -{{- end }} diff --git a/kubernetes/helm-chart/charts/opensearch-dashboard/templates/_ports.tpl b/kubernetes/helm-chart/charts/opensearch-dashboard/templates/_ports.tpl deleted file mode 100644 index 9feace61..00000000 --- a/kubernetes/helm-chart/charts/opensearch-dashboard/templates/_ports.tpl +++ /dev/null @@ -1,6 +0,0 @@ -{{/* -Port catalogs for all services -*/}} -{{- define "opensearch-dashboard.port" -}} -{{ ".Values.opensearch-dashboard.service.targetPort" | default "5601" }} -{{- end }} diff --git a/kubernetes/helm-chart/charts/opensearch-node/templates/_ports.tpl b/kubernetes/helm-chart/charts/opensearch-node/templates/_ports.tpl deleted file mode 100644 index 552c5c37..00000000 --- a/kubernetes/helm-chart/charts/opensearch-node/templates/_ports.tpl +++ /dev/null @@ -1,6 +0,0 @@ -{{/* -Port catalogs for all services -*/}} -{{- define "opensearch-node.port" -}} -{{ ".Values.opensearch-node.service.targetPort" | default "9200" }} -{{- end }} diff --git a/kubernetes/helm-chart/charts/sortinghat-worker/templates/_ports.tpl b/kubernetes/helm-chart/charts/sortinghat-worker/templates/_ports.tpl deleted file mode 100644 index 4625205d..00000000 --- a/kubernetes/helm-chart/charts/sortinghat-worker/templates/_ports.tpl +++ /dev/null @@ -1,6 +0,0 @@ -{{/* -Port catalogs for all services -*/}} -{{- define "sortinghat-worker.port" -}} -{{ ".Values.sortinghat-worker.service.targetPort" | default "9314" }} -{{- end }} diff --git a/kubernetes/helm-chart/charts/sortinghat/templates/_ports.tpl b/kubernetes/helm-chart/charts/sortinghat/templates/_ports.tpl deleted file mode 100644 index 5662d608..00000000 --- a/kubernetes/helm-chart/charts/sortinghat/templates/_ports.tpl +++ /dev/null @@ -1,6 +0,0 @@ -{{/* -Port catalogs for all services -*/}} -{{- define "sortinghat.port" -}} -{{ ".Values.sortinghat.service.targetPort" | default "9314" }} -{{- end }} diff --git a/kubernetes/helm-chart/templates/_env.tpl b/kubernetes/helm-chart/templates/_env.tpl deleted file mode 100644 index 696388ec..00000000 --- a/kubernetes/helm-chart/templates/_env.tpl +++ /dev/null @@ -1,40 +0,0 @@ -{{/* -Define various environment that referring from other values -*/}} -{{- define "nginx-extraEnvs.env" -}} -- name: KIBANA_HOST - value: http://opensearch-dashboard:{{ include "opensearch-dashboard.port" . }}/ -{{- end }} - -{{- define "sortinghat-extraEnvs.env" -}} -- name: SORTINGHAT_DB_USER - value: "{{ include "database-username.cred" . }}" -- name: SORTINGHAT_DB_PASSWORD - value: "{{ include "database-password.cred" . }}" -- name: SORTINGHAT_REDIS_PASSWORD - value: "{{ include "redis-password.cred" . }}" -- name: SORTINGHAT_CORS_ALLOWED_ORIGINS - value: "http://localhost:{{ include "nginx-listen.port" . }},http://127.0.0.1:{{ include "nginx-listen.port" . }},http://0.0.0.0:{{ include "nginx-listen.port" . }} -{{- end }} - -{{- define "sortinghat-worker-extraEnvs.env" -}} -- name: SORTINGHAT_DB_USER - value: "{{ include "database-username.cred" . }}" -- name: SORTINGHAT_DB_PASSWORD - value: "{{ include "database-password.cred" . }}" -- name: SORTINGHAT_REDIS_PASSWORD - value: "{{ include "redis-password.cred" . }}" -{{- end }} - -{{- define "opensearch-dashboard-extraEnvs.env" -}} -- name: OPENSEARCH_HOSTS - value: "[\"https://opensearch-node:{{ include "opensearch-node.port" . }}\"]" -{{- end }} - -{{- define "opensearch-node-extraEnvs.env" -}} -- name: OPENSEARCH_INITIAL_ADMIN_PASSWORD - value: "{{ include "opensearch-node-password.cred" . }}" -{{- end }} - -{{- define "mordred-extraEnvs.env" }} -{{- end }} \ No newline at end of file diff --git a/kubernetes/helm-chart/templates/_image.tpl b/kubernetes/helm-chart/templates/_image.tpl deleted file mode 100644 index 7fd013c1..00000000 --- a/kubernetes/helm-chart/templates/_image.tpl +++ /dev/null @@ -1,10 +0,0 @@ -{{/* -Print the image -*/}} -{{- define "appConfig.image" -}} -{{- $image := printf "%s:%s" .repository .tag }} -{{- if .registry }} -{{- $image = printf "%s/%s" .registry $image }} -{{- end }} -{{- $image -}} -{{- end }} \ No newline at end of file diff --git a/kubernetes/helm-chart/templates/_template.tpl b/kubernetes/helm-chart/templates/_template.tpl deleted file mode 100644 index f02742f5..00000000 --- a/kubernetes/helm-chart/templates/_template.tpl +++ /dev/null @@ -1,85 +0,0 @@ -{{/* -Helm chart templates -*/}} -{{- define "volume-mount.template" -}} -{{- range .Values.dependencies.storage.volumes }} - - name: {{ .name }} - mountPath: {{ .mountPath }} - {{- if and (eq .type "configmap") (hasKey . "subPath") .subPath }} - subPath: {{ .subPath }} - {{- end }} -{{- end }} -{{- end }} - -{{- define "volumes.template" -}} -- name: {{ .name }} - {{- if eq .type "pvc" }} - persistentVolumeClaim: - claimName: {{ .name }}-pvc - {{- else if eq .type "configmap" }} - configMap: - name: {{ $.Release.Name }}-configmap - {{- if and (hasKey . "configmapKey") (hasKey . "asFile") .configmapKey .asFile }} - items: - - key: {{ .configmapKey }} - path: {{ .asFile }} - {{- end }} - {{- else if eq .type "secret" }} - secret: - secretName: {{ .name }}-secret - {{- else }} - emptyDir: - sizeLimit: 100Mi - {{- end }} -{{- end }} - -{{- define "resources.template" -}} -limits: - cpu: {{ .Values.appConfig.resources.cpu.limits | quote }} - memory: {{ .Values.appConfig.resources.memory.limits | quote }} -requests: - cpu: {{ .Values.appConfig.resources.cpu.requests | quote }} - memory: {{ .Values.appConfig.resources.memory.requests | quote }} -{{- end }} - -{{- define "pvc.template" -}} -{{- range .Values.dependencies.storage.volumes }} - {{- if eq .type "pvc" }} -apiVersion: v1 -kind: PersistentVolumeClaim -metadata: - name: {{ .name }}-pvc - labels: - app: "{{ $.Release.Name }}" -spec: - storageClassName: "{{ .storageClass }}" - accessModes: - - ReadWriteMany - resources: - requests: - storage: {{ .size }} - {{- end }} -{{- end }} -{{- end }} - -{{- define "service.template" -}} -ports: - - protocol: TCP - name: "{{ .Values.appConfig.name }}-service" - {{- if eq .Values.service.scheme "http" }} - port: 80 - targetPort: {{ .Values.service.targetPort }} - {{- end }} - {{- if eq .Values.service.scheme "https" }} - port: 443 - targetPort: {{ .Values.service.targetPort }} - {{- end }} - {{- if eq .Values.service.scheme "passthrough" }} - port: {{ .Values.service.targetPort }} - targetPort: {{ .Values.service.targetPort }} - {{- end }} -type: {{ .Values.service.type | default "ClusterIP" | quote }} -sessionAffinity: None -selector: - app: "{{ .Values.appConfig.name }}" -{{- end }} From 43bd7767ee49e8b1a190e1622d2453b9c6b0c8fe Mon Sep 17 00:00:00 2001 From: root <44765750+Eroyi@users.noreply.github.com> Date: Thu, 7 Nov 2024 18:21:23 +0800 Subject: [PATCH 13/16] converting all files from windows to unix format Signed-off-by: root <44765750+Eroyi@users.noreply.github.com> --- kubernetes/helm-chart/Chart.yaml | 84 ++-- kubernetes/helm-chart/NOTES.txt | 22 +- kubernetes/helm-chart/README.md | 336 ++++++------- .../helm-chart/charts/mordred/Chart.yaml | 20 +- .../charts/mordred/templates/_helper.tpl | 72 +-- .../mordred/templates/_mordred_config.tpl | 312 ++++++------ .../mordred/templates/_mordred_projects.tpl | 30 +- .../charts/mordred/templates/deployment.yaml | 118 ++--- .../charts/mordred/templates/pvc.yaml | 6 +- .../charts/mordred/templates/service.yaml | 22 +- .../helm-chart/charts/mordred/values.yaml | 72 +-- kubernetes/helm-chart/charts/nginx/Chart.yaml | 20 +- .../charts/nginx/templates/_helper.tpl | 72 +-- .../charts/nginx/templates/_nginx-config.tpl | 122 ++--- .../charts/nginx/templates/deployment.yaml | 118 ++--- .../charts/nginx/templates/pvc.yaml | 6 +- .../charts/nginx/templates/service.yaml | 22 +- .../helm-chart/charts/nginx/values.yaml | 94 ++-- .../charts/opensearch-dashboard/Chart.yaml | 20 +- .../templates/_helper.tpl | 72 +-- .../templates/deployment.yaml | 118 ++--- .../opensearch-dashboard/templates/pvc.yaml | 6 +- .../templates/service.yaml | 22 +- .../charts/opensearch-dashboard/values.yaml | 74 +-- .../charts/opensearch-node/Chart.yaml | 20 +- .../opensearch-node/templates/_helper.tpl | 72 +-- .../opensearch-node/templates/deployment.yaml | 128 ++--- .../charts/opensearch-node/templates/pvc.yaml | 6 +- .../opensearch-node/templates/service.yaml | 22 +- .../charts/opensearch-node/values.yaml | 90 ++-- .../charts/sortinghat-worker/Chart.yaml | 20 +- .../sortinghat-worker/templates/_helper.tpl | 72 +-- .../templates/deployment.yaml | 118 ++--- .../sortinghat-worker/templates/pvc.yaml | 6 +- .../sortinghat-worker/templates/service.yaml | 22 +- .../charts/sortinghat-worker/values.yaml | 74 +-- .../helm-chart/charts/sortinghat/Chart.yaml | 20 +- .../charts/sortinghat/templates/_helper.tpl | 72 +-- .../sortinghat/templates/deployment.yaml | 118 ++--- .../charts/sortinghat/templates/pvc.yaml | 6 +- .../charts/sortinghat/templates/service.yaml | 22 +- .../helm-chart/charts/sortinghat/values.yaml | 82 ++-- .../helm-chart/templates/_credentials.tpl | 44 +- kubernetes/helm-chart/templates/_envs.tpl | 80 +-- kubernetes/helm-chart/templates/_ports.tpl | 98 ++-- .../helm-chart/templates/_templates.tpl | 178 +++---- .../helm-chart/templates/configmap.yaml | 32 +- kubernetes/helm-chart/values.yaml | 456 +++++++++--------- 48 files changed, 1859 insertions(+), 1859 deletions(-) diff --git a/kubernetes/helm-chart/Chart.yaml b/kubernetes/helm-chart/Chart.yaml index 32c21cf1..a0629972 100644 --- a/kubernetes/helm-chart/Chart.yaml +++ b/kubernetes/helm-chart/Chart.yaml @@ -1,42 +1,42 @@ -apiVersion: v2 -name: grimoirelab -type: application -description: Nested Chart collection for all grimorelab services. -home: https://github.com/chaoss/grimoirelab -icon: https://www.gravatar.com/avatar/4154acefea56ed23bddaaa47a4850400 -maintainers: -- name: Arie - url: https://github.com/Eroyi -version: 1.7.0 #Based on the "Github Release" version (which is the docker image tag referring from), not the actual application version. -appVersion: 1.0 -dependencies: -- name: mordred - repository: file://charts/mordred - version: 1.7.0 -- name: nginx - repository: file://charts/nginx - versio: 1.27.2 -- name: sortinghat - repository: file://charts/sortinghat - version: 1.7.0 -- name: sortinghat-worker - repository: file://charts/sortinghat-worker - version: 1.7.0 - alias: sortinghatWorker -# External Dependencies -- name: opensearch-dashboard - version: 2.11.1 - repository: file://charts/opensearch-dashboard - alias: opensearchDashboard - condition: opensearchDashboard.install -- name: opensearch-node - repository: file://charts/opensearch-node - version: 2.11.1 - alias: opensearchNode - condition: opensearchNode.install -# - name: mariadb -# version: 19.1.0 -# condition: mariadb.install -# - name: redis -# version: 20.2.1 -# condition: redis.install +apiVersion: v2 +name: grimoirelab +type: application +description: Nested Chart collection for all grimorelab services. +home: https://github.com/chaoss/grimoirelab +icon: https://www.gravatar.com/avatar/4154acefea56ed23bddaaa47a4850400 +maintainers: +- name: Arie + url: https://github.com/Eroyi +version: 1.7.0 #Based on the "Github Release" version (which is the docker image tag referring from), not the actual application version. +appVersion: 1.0 +dependencies: +- name: mordred + repository: file://charts/mordred + version: 1.7.0 +- name: nginx + repository: file://charts/nginx + versio: 1.27.2 +- name: sortinghat + repository: file://charts/sortinghat + version: 1.7.0 +- name: sortinghat-worker + repository: file://charts/sortinghat-worker + version: 1.7.0 + alias: sortinghatWorker +# External Dependencies +- name: opensearch-dashboard + version: 2.11.1 + repository: file://charts/opensearch-dashboard + alias: opensearchDashboard + condition: opensearchDashboard.install +- name: opensearch-node + repository: file://charts/opensearch-node + version: 2.11.1 + alias: opensearchNode + condition: opensearchNode.install +# - name: mariadb +# version: 19.1.0 +# condition: mariadb.install +# - name: redis +# version: 20.2.1 +# condition: redis.install diff --git a/kubernetes/helm-chart/NOTES.txt b/kubernetes/helm-chart/NOTES.txt index 9ecc9ce7..e5902811 100644 --- a/kubernetes/helm-chart/NOTES.txt +++ b/kubernetes/helm-chart/NOTES.txt @@ -1,12 +1,12 @@ -Thank you for installing {{ .Chart.Name }}. - -To visualise data, you need to import dashboards into opensearch-dashboard. - - 1. Visit https://github.com/chaoss/grimoirelab-sigils/tree/master/panels/json/opensearch_dashboards - 2. Download the dashboard you are interested - 3. Open opensearch-dashboard console in your browser, login. - 4. [If its the first install] Click "Explore on my own". - 5. Click "Menu" on the top left corner, then go to "Management" - "Dashboard Management" - 6. [If its the first install] Click "Index patterns" on the left to create the index patterns. - 7. Click "Saved objects" on the left to import "ndjson" dashboard file you downloaded. +Thank you for installing {{ .Chart.Name }}. + +To visualise data, you need to import dashboards into opensearch-dashboard. + + 1. Visit https://github.com/chaoss/grimoirelab-sigils/tree/master/panels/json/opensearch_dashboards + 2. Download the dashboard you are interested + 3. Open opensearch-dashboard console in your browser, login. + 4. [If its the first install] Click "Explore on my own". + 5. Click "Menu" on the top left corner, then go to "Management" - "Dashboard Management" + 6. [If its the first install] Click "Index patterns" on the left to create the index patterns. + 7. Click "Saved objects" on the left to import "ndjson" dashboard file you downloaded. 8. Drag or browser the dashboard file, select, then click "Import" - "Done" to import the dashboard. \ No newline at end of file diff --git a/kubernetes/helm-chart/README.md b/kubernetes/helm-chart/README.md index fee4b976..120e960f 100644 --- a/kubernetes/helm-chart/README.md +++ b/kubernetes/helm-chart/README.md @@ -1,168 +1,168 @@ -# Introduction -This chart launches a grimoirelab deployment on a Kubernetes cluster using the helm package manager. - - -# Prerequisites Component -- Mariadb -- Redis -- Opensearch **(!)** -- Opensearch Dashboard **(!)** - - -**(!)**: A component with this mark means this chart is already integrated with that component. - -You can deploy and configure the **(!)** component within this chart via `Values.yaml`. - -If you like to bring your own components, you can disable the installation of the built-in chart, with `install: false` option *(see detail below)*. - - - -# Installing the Chart - -To install the chart with the release name `grimoirelab`: -```console -helm install grimoirelab /path/to/chart --values /path/to/chart/values.yaml -n grimoirelab -``` -`-n`: The namespace you would like to put this release in. - - - - -# Configure the chart - -Tips: Use `Ctrl+F / Command+F` search the keywords in `Values.yaml` for quick navigation. - - - - -## Global - -Global values are meant to override the specific values across all sub-charts. -| Name | Description | Type | Default value | -| ---- | ----------- | ---- | ------------- | -| `topologyConfig` | The topology configuration for this chart, affect all components | map | {} | -| `imagePullSecrets` | Only required when you are pulling image from private registry | list | [] | -| `appName` | Name of this chart | string | "" | -| `credentials.database.username` | Plaintext. Username for database connection | string | "root" | -| `credentials.database.password` | Plaintext. Password for the database connection | "mar1adb4Gr1m0ir3Lab" | -| `credentials.opensearchNode.password` | Plaintext. Password for the opensearch connection | string | "admin" | -| `credentials.redis.password` | Plaintext. Password for the redis connection | string | "grimoirelab" | - - -## Component - -### Grimoirelab components - -> 1. Components' names will be omitted. -> 2. Resource value has been set to a minimum running quota. -> 3. You can disable these components: `opensearch-node`, `opensearch-dashboard`, `mariadb`, `redis`. - -| Name | Description | Type | Default value | -| ---- | ----------- | ---- | ------------- | -| `install` | Installation toggle for this component. | boolean | true / false | -| `appConfig.replicas` | Replica count for this deployment | int | 1 | -| `appConfig.image` | Image for this deployment | string | --- | -| `appConfig.labels` | Labels for this deployment | map | {} | -| `appConfig.annotations` | Annotations for this deployment | map | {} | -| `appConfig.resources` | Resources quota for this deployment | map | --- | - - - - -## Dependencies - -### Storage - -| Name | Description | Type | Default value | -| ---- | ----------- | ---- | ------------- | -| `enabled` | Enable or disable persistent storage. | boolean | true / false | -| `volumes.name` | Name of this volumes when referencing in yaml | string | --- | -| `volumes.mountPath` | Path of this volumes to be mount into container | string | --- | -| `volumes.type` | Type of this volumes. `pvc`, `configmap` or `emptyDir` | string | --- | -| `volumes.storageClass` | The storage class that will be used when creating PVC | string | gp3 | -| `volumes.size` | Size of this volume | string | --- | -| `volumes.subPath` | Declare the `subPath` while mounting in `configmap` type | string | --- | - - - `volumes` have 3 types of schemas, here are the example: - -#### 1. Persistent Volume -```yaml -- name: "volume-name" - mountPath: "/path/to/mount/in/container" - type: pvc - storageClass: your-storageClass - size: 1Gi -``` -This will result: -- A Persistence Volume Claim - - With 1 Gigabyte storage - - with the storageClass you assigned -- Mounted as Volumes with the name "volume-name" - - in /path/to/mount/in/container - - - -```yaml -- name: "volume-name" - mountPath: "/path/to/mount/in/container" - type: pvc -``` -This will result: -- Mounted as Volumes with the name "volume-name". If these volumes are not created, the mounting attempt will fail. - - in /path/to/mount/in/container -> If you did NOT declare the size, PVC will not be created. If these volumes have not been created, the mounting attempt will fail. - - - -### 2. Configmap as file -```yaml -- name: "config-name" - mountPath: "/path/to/file/in/container/file-name.txt" - type: configmap - subPath: "configmap-key-name" -``` - -This will result: -- Mounting file from Configmap with name "config-name". - - in /path/to/mount/in/container -> If the configmap has NOT been created, or the key declared in "subPath" is not found in the configmap, the mounting attempt will fail. - - - -### 3. Empty directory -```yaml -- name: "volume-name" - mountPath: "path/to/mount/in/container" - type: emptyDir -``` - -This will result: -- Mounted as an empty directory with the name "volume-name" - - in /path/to/mount/in/container -> Data in this volume type will be lost when the pod is restarted. - - - - -## Service - -| Name | Description | Type | Default value | -| ---- | ----------- | ---- | ------------- | -| `targetPort` | The port to expose for this deployment | int | --- | -| `schema` | The method when proxy the `targetPort`. `passthrough` will remain the original port, `http` will use 80 and `https` as 443 | string | passthrough | -| `type` | The type of the services for this deployment, default (empty) is `ClusterIP` | string | "" | - -**Attention:** If you would like to change the service port in here, please make sure you have changed them in `templates/_ports.tpl` as well. - - - -## Extra environments - -You can put an extra environments list in here to inject into the container. -```yaml -- name: key - value: "value" -- name: foo - value: "bar" -``` +# Introduction +This chart launches a grimoirelab deployment on a Kubernetes cluster using the helm package manager. + + +# Prerequisites Component +- Mariadb +- Redis +- Opensearch **(!)** +- Opensearch Dashboard **(!)** + + +**(!)**: A component with this mark means this chart is already integrated with that component. + +You can deploy and configure the **(!)** component within this chart via `Values.yaml`. + +If you like to bring your own components, you can disable the installation of the built-in chart, with `install: false` option *(see detail below)*. + + + +# Installing the Chart + +To install the chart with the release name `grimoirelab`: +```console +helm install grimoirelab /path/to/chart --values /path/to/chart/values.yaml -n grimoirelab +``` +`-n`: The namespace you would like to put this release in. + + + + +# Configure the chart + +Tips: Use `Ctrl+F / Command+F` search the keywords in `Values.yaml` for quick navigation. + + + + +## Global + +Global values are meant to override the specific values across all sub-charts. +| Name | Description | Type | Default value | +| ---- | ----------- | ---- | ------------- | +| `topologyConfig` | The topology configuration for this chart, affect all components | map | {} | +| `imagePullSecrets` | Only required when you are pulling image from private registry | list | [] | +| `appName` | Name of this chart | string | "" | +| `credentials.database.username` | Plaintext. Username for database connection | string | "root" | +| `credentials.database.password` | Plaintext. Password for the database connection | "mar1adb4Gr1m0ir3Lab" | +| `credentials.opensearchNode.password` | Plaintext. Password for the opensearch connection | string | "admin" | +| `credentials.redis.password` | Plaintext. Password for the redis connection | string | "grimoirelab" | + + +## Component + +### Grimoirelab components + +> 1. Components' names will be omitted. +> 2. Resource value has been set to a minimum running quota. +> 3. You can disable these components: `opensearch-node`, `opensearch-dashboard`, `mariadb`, `redis`. + +| Name | Description | Type | Default value | +| ---- | ----------- | ---- | ------------- | +| `install` | Installation toggle for this component. | boolean | true / false | +| `appConfig.replicas` | Replica count for this deployment | int | 1 | +| `appConfig.image` | Image for this deployment | string | --- | +| `appConfig.labels` | Labels for this deployment | map | {} | +| `appConfig.annotations` | Annotations for this deployment | map | {} | +| `appConfig.resources` | Resources quota for this deployment | map | --- | + + + + +## Dependencies + +### Storage + +| Name | Description | Type | Default value | +| ---- | ----------- | ---- | ------------- | +| `enabled` | Enable or disable persistent storage. | boolean | true / false | +| `volumes.name` | Name of this volumes when referencing in yaml | string | --- | +| `volumes.mountPath` | Path of this volumes to be mount into container | string | --- | +| `volumes.type` | Type of this volumes. `pvc`, `configmap` or `emptyDir` | string | --- | +| `volumes.storageClass` | The storage class that will be used when creating PVC | string | gp3 | +| `volumes.size` | Size of this volume | string | --- | +| `volumes.subPath` | Declare the `subPath` while mounting in `configmap` type | string | --- | + + + `volumes` have 3 types of schemas, here are the example: + +#### 1. Persistent Volume +```yaml +- name: "volume-name" + mountPath: "/path/to/mount/in/container" + type: pvc + storageClass: your-storageClass + size: 1Gi +``` +This will result: +- A Persistence Volume Claim + - With 1 Gigabyte storage + - with the storageClass you assigned +- Mounted as Volumes with the name "volume-name" + - in /path/to/mount/in/container + + + +```yaml +- name: "volume-name" + mountPath: "/path/to/mount/in/container" + type: pvc +``` +This will result: +- Mounted as Volumes with the name "volume-name". If these volumes are not created, the mounting attempt will fail. + - in /path/to/mount/in/container +> If you did NOT declare the size, PVC will not be created. If these volumes have not been created, the mounting attempt will fail. + + + +### 2. Configmap as file +```yaml +- name: "config-name" + mountPath: "/path/to/file/in/container/file-name.txt" + type: configmap + subPath: "configmap-key-name" +``` + +This will result: +- Mounting file from Configmap with name "config-name". + - in /path/to/mount/in/container +> If the configmap has NOT been created, or the key declared in "subPath" is not found in the configmap, the mounting attempt will fail. + + + +### 3. Empty directory +```yaml +- name: "volume-name" + mountPath: "path/to/mount/in/container" + type: emptyDir +``` + +This will result: +- Mounted as an empty directory with the name "volume-name" + - in /path/to/mount/in/container +> Data in this volume type will be lost when the pod is restarted. + + + + +## Service + +| Name | Description | Type | Default value | +| ---- | ----------- | ---- | ------------- | +| `targetPort` | The port to expose for this deployment | int | --- | +| `schema` | The method when proxy the `targetPort`. `passthrough` will remain the original port, `http` will use 80 and `https` as 443 | string | passthrough | +| `type` | The type of the services for this deployment, default (empty) is `ClusterIP` | string | "" | + +**Attention:** If you would like to change the service port in here, please make sure you have changed them in `templates/_ports.tpl` as well. + + + +## Extra environments + +You can put an extra environments list in here to inject into the container. +```yaml +- name: key + value: "value" +- name: foo + value: "bar" +``` diff --git a/kubernetes/helm-chart/charts/mordred/Chart.yaml b/kubernetes/helm-chart/charts/mordred/Chart.yaml index 99fef44e..f1d92d4b 100644 --- a/kubernetes/helm-chart/charts/mordred/Chart.yaml +++ b/kubernetes/helm-chart/charts/mordred/Chart.yaml @@ -1,10 +1,10 @@ -apiVersion: v2 -name: mordred -description: Mordred service for GrimoireLab. -home: https://github.com/chaoss/grimoirelab -icon: https://www.gravatar.com/avatar/4154acefea56ed23bddaaa47a4850400 -maintainers: -- name: Arie - url: https://github.com/Eroyi -appVersion: 1.7.0 #Based on the "Github Release" version (which is the docker image tag referring from), not the actual application version. -version: 1.0 +apiVersion: v2 +name: mordred +description: Mordred service for GrimoireLab. +home: https://github.com/chaoss/grimoirelab +icon: https://www.gravatar.com/avatar/4154acefea56ed23bddaaa47a4850400 +maintainers: +- name: Arie + url: https://github.com/Eroyi +appVersion: 1.7.0 #Based on the "Github Release" version (which is the docker image tag referring from), not the actual application version. +version: 1.0 diff --git a/kubernetes/helm-chart/charts/mordred/templates/_helper.tpl b/kubernetes/helm-chart/charts/mordred/templates/_helper.tpl index cf7469aa..df1ed75b 100644 --- a/kubernetes/helm-chart/charts/mordred/templates/_helper.tpl +++ b/kubernetes/helm-chart/charts/mordred/templates/_helper.tpl @@ -1,36 +1,36 @@ -{{/* -Mordred labels -*/}} -{{- define "metadata.mordred.pod.labels" -}} -{{- range $name, $value := .Values.appConfig.labels }} -{{ $name }}: {{ $value | quote }} -{{- end -}} -{{- end -}} - -{{/* -Mordred annotations -*/}} -{{- define "metadata.mordred.pod.annotations" -}} -{{- range $name, $value := .Values.appConfig.annotations }} -{{ $name }}: {{ $value | quote }} -{{- end -}} -{{- end -}} - - -{{/* -Mordred Service labels -*/}} -{{- define "metadata.mordred.service.labels" -}} -{{- range $name, $value := .Values.service.labels }} -{{ $name }}: {{ $value | quote }} -{{- end -}} -{{- end -}} - -{{/* -Mordred Service annotations -*/}} -{{- define "metadata.mordred.service.annotations" -}} -{{- range $name, $value := .Values.service.annotations }} -{{ $name }}: {{ $value | quote }} -{{- end -}} -{{- end -}} +{{/* +Mordred labels +*/}} +{{- define "metadata.mordred.pod.labels" -}} +{{- range $name, $value := .Values.appConfig.labels }} +{{ $name }}: {{ $value | quote }} +{{- end -}} +{{- end -}} + +{{/* +Mordred annotations +*/}} +{{- define "metadata.mordred.pod.annotations" -}} +{{- range $name, $value := .Values.appConfig.annotations }} +{{ $name }}: {{ $value | quote }} +{{- end -}} +{{- end -}} + + +{{/* +Mordred Service labels +*/}} +{{- define "metadata.mordred.service.labels" -}} +{{- range $name, $value := .Values.service.labels }} +{{ $name }}: {{ $value | quote }} +{{- end -}} +{{- end -}} + +{{/* +Mordred Service annotations +*/}} +{{- define "metadata.mordred.service.annotations" -}} +{{- range $name, $value := .Values.service.annotations }} +{{ $name }}: {{ $value | quote }} +{{- end -}} +{{- end -}} diff --git a/kubernetes/helm-chart/charts/mordred/templates/_mordred_config.tpl b/kubernetes/helm-chart/charts/mordred/templates/_mordred_config.tpl index 67e2ae1d..d7918fe2 100644 --- a/kubernetes/helm-chart/charts/mordred/templates/_mordred_config.tpl +++ b/kubernetes/helm-chart/charts/mordred/templates/_mordred_config.tpl @@ -1,156 +1,156 @@ -{{/* - Mordred setup config -*/}} -{{- define "config.mordredSetup" -}} -[general] -short_name = GrimoireLab -update = true -min_update_delay = 60 -debug = false -logs_dir = /home/grimoire/logs -bulk_size = 100 -scroll_size = 100 -aliases_file = /home/grimoire/aliases.json - -[projects] -projects_file = /home/grimoire/conf/projects.json - -[es_collection] -url = https://admin:{{ include "cred.opensearchNode.password" . }}@opensearch-node:{{ include "port.opensearchNode" . }} - -[es_enrichment] -url = https://admin:{{ include "cred.opensearchNode.password" . }}@opensearch-node:{{ include "port.opensearchNode" . }} -autorefresh = true - -[sortinghat] -host = nginx -user = root -password = root -port = {{ include "port.nginxListen" . }} -path = /identities/api/ -ssl = false -database = sortinghat_db -autoprofile = [github, git] -matching = [email,name,username] -sleep_for = 100 -unaffiliated_group = Unknown -affiliate = true - -[panels] -kibiter_time_from = -kibiter_default_index = -kibiter_url = -kibiter_version = - -[phases] -collection = true -identities = true -enrichment = true -panels = false - -#[bugzillarest] -#raw_index = bugzillarest_demo_raw -#enriched_index = bugzillarest_demo_enriched -#no-archive = true - -#[confluence] -#no-archive = true -#raw_index = confluence_demo_raw -#enriched_index = confluence_demo_enriched - -#[discourse] -#raw_index = discourse_demo_raw -#enriched_index = discourse_demo_enriched -#no-archive = true - -[git] -raw_index = git_demo_raw -enriched_index = git_demo_enriched -latest-items = true -studies = [enrich_demography:git, enrich_areas_of_code:git, enrich_onion:git] - -#[github] -#api-token = -#enterprise-url = -#raw_index = github_demo_raw -#sleep-for-rate = true -#sleep-time = "300" -#enriched_index = github_demo_enriched - -#[gitlab:issues] -#api-token = -#raw_index = gitlab_issues_demo_raw -#enriched_index = gitlab_issues_demo_enriched -#no-archive = true -#enterprise-url = -#sleep-for-rate = true - -#[gitlab:merge] -#api-token = -#raw_index = gitlab_merges_demo_raw -#enriched_index = gitlab_merges_demo_enriched -#no-archive = true -#enterprise-url = -#category = merge_request -#sleep-for-rate = true - -#[jira] -#raw_index = jira_demo_raw -#enriched_index = jira_demo_enriched -#no-archive = true - -#[pipermail] -#raw_index = pipermail_demo_raw -#enriched_index = pipermail_demo_enriched -#no-verify = true - -#[mediawiki] -#raw_index = mediawiki_demo_raw -#enriched_index = mediawiki_demo_enriched -#no-archive = true - -#[meetup] -#raw_index = meetup_demo_raw -#enriched_index = meetup_demo_enriched -#api-token = -#no-archive = true -#sleep-for-rate = true -#sleep-time = "300" - -#[stackexchange] -#raw_index = stackexchange_demo_raw -#enriched_index = stackexchange_demo_enriched -#api-token = -#no-archive = true - -#[slack] -#raw_index = slack_demo_raw -#enriched_index = slack_demo_enriched -#api-token = -#no-archive = true - -#[supybot] -#raw_index = supybot_demo_raw -#enriched_index = supybot_demo_enriched - -#[twitter] -#raw_index = twitter_demo_raw -#enriched_index = twitter_demo_enriched -#api-token = -#no-archive = true -#sleep-for-rate = true -#sleep-time = 300 - -## studies based on enriched indexes - -[enrich_demography:git] - -[enrich_areas_of_code:git] -in_index = git_demo_raw -out_index = git-aoc_demo_enriched - -[enrich_onion:git] -in_index = git -out_index = git-onion_demo_enriched -contribs_field = hash -{{- end }} +{{/* + Mordred setup config +*/}} +{{- define "config.mordredSetup" -}} +[general] +short_name = GrimoireLab +update = true +min_update_delay = 60 +debug = false +logs_dir = /home/grimoire/logs +bulk_size = 100 +scroll_size = 100 +aliases_file = /home/grimoire/aliases.json + +[projects] +projects_file = /home/grimoire/conf/projects.json + +[es_collection] +url = https://admin:{{ include "cred.opensearchNode.password" . }}@opensearch-node:{{ include "port.opensearchNode" . }} + +[es_enrichment] +url = https://admin:{{ include "cred.opensearchNode.password" . }}@opensearch-node:{{ include "port.opensearchNode" . }} +autorefresh = true + +[sortinghat] +host = nginx +user = root +password = root +port = {{ include "port.nginxListen" . }} +path = /identities/api/ +ssl = false +database = sortinghat_db +autoprofile = [github, git] +matching = [email,name,username] +sleep_for = 100 +unaffiliated_group = Unknown +affiliate = true + +[panels] +kibiter_time_from = +kibiter_default_index = +kibiter_url = +kibiter_version = + +[phases] +collection = true +identities = true +enrichment = true +panels = false + +#[bugzillarest] +#raw_index = bugzillarest_demo_raw +#enriched_index = bugzillarest_demo_enriched +#no-archive = true + +#[confluence] +#no-archive = true +#raw_index = confluence_demo_raw +#enriched_index = confluence_demo_enriched + +#[discourse] +#raw_index = discourse_demo_raw +#enriched_index = discourse_demo_enriched +#no-archive = true + +[git] +raw_index = git_demo_raw +enriched_index = git_demo_enriched +latest-items = true +studies = [enrich_demography:git, enrich_areas_of_code:git, enrich_onion:git] + +#[github] +#api-token = +#enterprise-url = +#raw_index = github_demo_raw +#sleep-for-rate = true +#sleep-time = "300" +#enriched_index = github_demo_enriched + +#[gitlab:issues] +#api-token = +#raw_index = gitlab_issues_demo_raw +#enriched_index = gitlab_issues_demo_enriched +#no-archive = true +#enterprise-url = +#sleep-for-rate = true + +#[gitlab:merge] +#api-token = +#raw_index = gitlab_merges_demo_raw +#enriched_index = gitlab_merges_demo_enriched +#no-archive = true +#enterprise-url = +#category = merge_request +#sleep-for-rate = true + +#[jira] +#raw_index = jira_demo_raw +#enriched_index = jira_demo_enriched +#no-archive = true + +#[pipermail] +#raw_index = pipermail_demo_raw +#enriched_index = pipermail_demo_enriched +#no-verify = true + +#[mediawiki] +#raw_index = mediawiki_demo_raw +#enriched_index = mediawiki_demo_enriched +#no-archive = true + +#[meetup] +#raw_index = meetup_demo_raw +#enriched_index = meetup_demo_enriched +#api-token = +#no-archive = true +#sleep-for-rate = true +#sleep-time = "300" + +#[stackexchange] +#raw_index = stackexchange_demo_raw +#enriched_index = stackexchange_demo_enriched +#api-token = +#no-archive = true + +#[slack] +#raw_index = slack_demo_raw +#enriched_index = slack_demo_enriched +#api-token = +#no-archive = true + +#[supybot] +#raw_index = supybot_demo_raw +#enriched_index = supybot_demo_enriched + +#[twitter] +#raw_index = twitter_demo_raw +#enriched_index = twitter_demo_enriched +#api-token = +#no-archive = true +#sleep-for-rate = true +#sleep-time = 300 + +## studies based on enriched indexes + +[enrich_demography:git] + +[enrich_areas_of_code:git] +in_index = git_demo_raw +out_index = git-aoc_demo_enriched + +[enrich_onion:git] +in_index = git +out_index = git-onion_demo_enriched +contribs_field = hash +{{- end }} diff --git a/kubernetes/helm-chart/charts/mordred/templates/_mordred_projects.tpl b/kubernetes/helm-chart/charts/mordred/templates/_mordred_projects.tpl index 1f8b2785..b801a178 100644 --- a/kubernetes/helm-chart/charts/mordred/templates/_mordred_projects.tpl +++ b/kubernetes/helm-chart/charts/mordred/templates/_mordred_projects.tpl @@ -1,15 +1,15 @@ -{{/* - Mordred project config -*/}} -{{- define "config.mordredProject" -}} -{ - "grimoireLab": { - "meta": { - "title": "GrimoireLab" - }, - "git": [ - "https://github.com/chaoss/grimoirelab.git" - ] - } - } -{{- end }} +{{/* + Mordred project config +*/}} +{{- define "config.mordredProject" -}} +{ + "grimoireLab": { + "meta": { + "title": "GrimoireLab" + }, + "git": [ + "https://github.com/chaoss/grimoirelab.git" + ] + } + } +{{- end }} diff --git a/kubernetes/helm-chart/charts/mordred/templates/deployment.yaml b/kubernetes/helm-chart/charts/mordred/templates/deployment.yaml index f34fdce4..755e5047 100644 --- a/kubernetes/helm-chart/charts/mordred/templates/deployment.yaml +++ b/kubernetes/helm-chart/charts/mordred/templates/deployment.yaml @@ -1,59 +1,59 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: "{{ .Values.appConfig.name }}" - labels: - app: "{{ .Values.appConfig.name }}" - {{- include "metadata.mordred.pod.labels" . | nindent 4 }} - annotations: - {{- include "metadata.mordred.pod.annotations" . | nindent 4 }} - -spec: - replicas: {{ .Values.appConfig.replicas }} - selector: - matchLabels: - app: "{{ .Values.appConfig.name }}" - template: - metadata: - labels: - app: "{{ .Values.appConfig.name }}" - {{- include "metadata.mordred.pod.labels" . | nindent 8 }} - annotations: - {{- include "metadata.mordred.pod.annotations" . | nindent 8 }} - spec: - {{- with .Values.global.topologyConfig }} - {{- toYaml . | nindent 6 }} - {{- end }} - terminationGracePeriodSeconds: 10 - {{- with .Values.global.imagePullSecrets}} - imagePullSecrets: - {{- toYaml . | nindent 8}} - {{- end}} - containers: - - name: mordred - image: {{ .Values.appConfig.image }} - ports: - - containerPort: {{ .Values.service.targetPort }} - # v ---- Volume mount define ---- - {{- if .Values.dependencies.storage.enabled }} - volumeMounts: - {{- include "template.volumeMount" . | nindent 12 }} - {{- end }} - # ^ ---- Volume mount define ---- - # v ---- Resources define ---- - resources: - {{- include "template.resQuota" . | nindent 12 }} - # ^ ---- Resources define ---- - env: - {{- include "nativeEnv.mordred" . | nindent 12 }} - {{- with .Values.extraEnvs }} - {{- toYaml . | nindent 12 }} - {{- end }} - # v ---- Volumes define ---- - {{- if .Values.dependencies.storage.enabled }} - volumes: - {{- range .Values.dependencies.storage.volumes }} - {{- include "template.volumes" (dict "item" . "root" $ ) | nindent 8 }} - {{- end }} - {{- end }} - # ^ ---- Volumes define ---- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: "{{ .Values.appConfig.name }}" + labels: + app: "{{ .Values.appConfig.name }}" + {{- include "metadata.mordred.pod.labels" . | nindent 4 }} + annotations: + {{- include "metadata.mordred.pod.annotations" . | nindent 4 }} + +spec: + replicas: {{ .Values.appConfig.replicas }} + selector: + matchLabels: + app: "{{ .Values.appConfig.name }}" + template: + metadata: + labels: + app: "{{ .Values.appConfig.name }}" + {{- include "metadata.mordred.pod.labels" . | nindent 8 }} + annotations: + {{- include "metadata.mordred.pod.annotations" . | nindent 8 }} + spec: + {{- with .Values.global.topologyConfig }} + {{- toYaml . | nindent 6 }} + {{- end }} + terminationGracePeriodSeconds: 10 + {{- with .Values.global.imagePullSecrets}} + imagePullSecrets: + {{- toYaml . | nindent 8}} + {{- end}} + containers: + - name: mordred + image: {{ .Values.appConfig.image }} + ports: + - containerPort: {{ .Values.service.targetPort }} + # v ---- Volume mount define ---- + {{- if .Values.dependencies.storage.enabled }} + volumeMounts: + {{- include "template.volumeMount" . | nindent 12 }} + {{- end }} + # ^ ---- Volume mount define ---- + # v ---- Resources define ---- + resources: + {{- include "template.resQuota" . | nindent 12 }} + # ^ ---- Resources define ---- + env: + {{- include "nativeEnv.mordred" . | nindent 12 }} + {{- with .Values.extraEnvs }} + {{- toYaml . | nindent 12 }} + {{- end }} + # v ---- Volumes define ---- + {{- if .Values.dependencies.storage.enabled }} + volumes: + {{- range .Values.dependencies.storage.volumes }} + {{- include "template.volumes" (dict "item" . "root" $ ) | nindent 8 }} + {{- end }} + {{- end }} + # ^ ---- Volumes define ---- diff --git a/kubernetes/helm-chart/charts/mordred/templates/pvc.yaml b/kubernetes/helm-chart/charts/mordred/templates/pvc.yaml index babc5bee..0200c4fc 100644 --- a/kubernetes/helm-chart/charts/mordred/templates/pvc.yaml +++ b/kubernetes/helm-chart/charts/mordred/templates/pvc.yaml @@ -1,3 +1,3 @@ -{{- range .Values.dependencies.storage.volumes }} -{{- include "template.pvc" ( dict "item" . "root" $ ) }} -{{- end }} +{{- range .Values.dependencies.storage.volumes }} +{{- include "template.pvc" ( dict "item" . "root" $ ) }} +{{- end }} diff --git a/kubernetes/helm-chart/charts/mordred/templates/service.yaml b/kubernetes/helm-chart/charts/mordred/templates/service.yaml index 8c003ae5..87961cf6 100644 --- a/kubernetes/helm-chart/charts/mordred/templates/service.yaml +++ b/kubernetes/helm-chart/charts/mordred/templates/service.yaml @@ -1,11 +1,11 @@ -apiVersion: v1 -kind: Service -metadata: - name: "{{ .Values.appConfig.name }}" - labels: - app: "{{ .Values.appConfig.name }}" - {{- include "metadata.mordred.service.labels" . | nindent 4 }} - annotations: - {{- include "metadata.mordred.service.annotations" . | nindent 4 }} -spec: - {{- include "template.service" . | nindent 2 }} +apiVersion: v1 +kind: Service +metadata: + name: "{{ .Values.appConfig.name }}" + labels: + app: "{{ .Values.appConfig.name }}" + {{- include "metadata.mordred.service.labels" . | nindent 4 }} + annotations: + {{- include "metadata.mordred.service.annotations" . | nindent 4 }} +spec: + {{- include "template.service" . | nindent 2 }} diff --git a/kubernetes/helm-chart/charts/mordred/values.yaml b/kubernetes/helm-chart/charts/mordred/values.yaml index 35834cb7..29ddce2c 100644 --- a/kubernetes/helm-chart/charts/mordred/values.yaml +++ b/kubernetes/helm-chart/charts/mordred/values.yaml @@ -1,36 +1,36 @@ -global: - topologyConfig: {} - imagePullSecrets: [] - imageRegistry: "" - appName: "" - -install: true - -appConfig: - name: "mordred" - replicas: 1 - image: docker.io/grimoirelab/grimoirelab:latest - pullPolicy: "IfNotPresent" - labels: {} - annotations: {} - resources: - cpu: - limits: "" - requests: "" - memory: - limits: "" - requests: "" - -dependencies: - storage: - enabled: false - volumes: [] - -service: - labels: {} - annotations: {} - targetPort: 8000 - scheme: "http" - type: "" # Default to "ClusterIP" - -extraEnvs: [] +global: + topologyConfig: {} + imagePullSecrets: [] + imageRegistry: "" + appName: "" + +install: true + +appConfig: + name: "mordred" + replicas: 1 + image: docker.io/grimoirelab/grimoirelab:latest + pullPolicy: "IfNotPresent" + labels: {} + annotations: {} + resources: + cpu: + limits: "" + requests: "" + memory: + limits: "" + requests: "" + +dependencies: + storage: + enabled: false + volumes: [] + +service: + labels: {} + annotations: {} + targetPort: 8000 + scheme: "http" + type: "" # Default to "ClusterIP" + +extraEnvs: [] diff --git a/kubernetes/helm-chart/charts/nginx/Chart.yaml b/kubernetes/helm-chart/charts/nginx/Chart.yaml index 62f91278..362303ea 100644 --- a/kubernetes/helm-chart/charts/nginx/Chart.yaml +++ b/kubernetes/helm-chart/charts/nginx/Chart.yaml @@ -1,10 +1,10 @@ -apiVersion: v2 -name: nginx -description: Official Nginx build. -home: https://github.com/nginxinc/docker-nginx -icon: https://hub.docker.com/api/media/repos_logo/v1/library%2Fnginx -maintainers: -- name: Arie - url: https://github.com/Eroyi -appVersion: 1.27.2 -version: 1.0 +apiVersion: v2 +name: nginx +description: Official Nginx build. +home: https://github.com/nginxinc/docker-nginx +icon: https://hub.docker.com/api/media/repos_logo/v1/library%2Fnginx +maintainers: +- name: Arie + url: https://github.com/Eroyi +appVersion: 1.27.2 +version: 1.0 diff --git a/kubernetes/helm-chart/charts/nginx/templates/_helper.tpl b/kubernetes/helm-chart/charts/nginx/templates/_helper.tpl index f16f6202..6c5c164b 100644 --- a/kubernetes/helm-chart/charts/nginx/templates/_helper.tpl +++ b/kubernetes/helm-chart/charts/nginx/templates/_helper.tpl @@ -1,36 +1,36 @@ -{/* -Mordred labels -*/}} -{{- define "metadata.nginx.pod.labels" -}} -{{- range $name, $value := .Values.appConfig.labels }} -{{ $name }}: {{ $value | quote }} -{{- end -}} -{{- end -}} - -{{/* -Mordred annotations -*/}} -{{- define "metadata.nginx.pod.annotations" -}} -{{- range $name, $value := .Values.appConfig.annotations }} -{{ $name }}: {{ $value | quote }} -{{- end -}} -{{- end -}} - - -{{/* -Mordred Service labels -*/}} -{{- define "metadata.nginx.service.labels" -}} -{{- range $name, $value := .Values.service.labels }} -{{ $name }}: {{ $value | quote }} -{{- end -}} -{{- end -}} - -{{/* -Mordred Service annotations -*/}} -{{- define "metadata.nginx.service.annotations" -}} -{{- range $name, $value := .Values.service.annotations }} -{{ $name }}: {{ $value | quote }} -{{- end -}} -{{- end -}} +{/* +Mordred labels +*/}} +{{- define "metadata.nginx.pod.labels" -}} +{{- range $name, $value := .Values.appConfig.labels }} +{{ $name }}: {{ $value | quote }} +{{- end -}} +{{- end -}} + +{{/* +Mordred annotations +*/}} +{{- define "metadata.nginx.pod.annotations" -}} +{{- range $name, $value := .Values.appConfig.annotations }} +{{ $name }}: {{ $value | quote }} +{{- end -}} +{{- end -}} + + +{{/* +Mordred Service labels +*/}} +{{- define "metadata.nginx.service.labels" -}} +{{- range $name, $value := .Values.service.labels }} +{{ $name }}: {{ $value | quote }} +{{- end -}} +{{- end -}} + +{{/* +Mordred Service annotations +*/}} +{{- define "metadata.nginx.service.annotations" -}} +{{- range $name, $value := .Values.service.annotations }} +{{ $name }}: {{ $value | quote }} +{{- end -}} +{{- end -}} diff --git a/kubernetes/helm-chart/charts/nginx/templates/_nginx-config.tpl b/kubernetes/helm-chart/charts/nginx/templates/_nginx-config.tpl index abbf8221..72026789 100644 --- a/kubernetes/helm-chart/charts/nginx/templates/_nginx-config.tpl +++ b/kubernetes/helm-chart/charts/nginx/templates/_nginx-config.tpl @@ -1,61 +1,61 @@ -{{/* -uwsgi params config for nginx -*/}} -{{- define "config.uwsgiParams" -}} -uwsgi_param QUERY_STRING $query_string; -uwsgi_param REQUEST_METHOD $request_method; -uwsgi_param CONTENT_TYPE $content_type; -uwsgi_param CONTENT_LENGTH $content_length; -uwsgi_param REQUEST_URI $request_uri; -uwsgi_param PATH_INFO $document_uri; -uwsgi_param DOCUMENT_ROOT $document_root; -uwsgi_param SERVER_PROTOCOL $server_protocol; -uwsgi_param HTTPS $https if_not_empty; -uwsgi_param REMOTE_ADDR $remote_addr; -uwsgi_param REMOTE_PORT $remote_port; -uwsgi_param SERVER_PORT $server_port; -uwsgi_param SERVER_NAME $server_name; -{{- end }} - -{{/* -nginx config -*/}} -{{- define "config.nginxConf" -}} -upstream sortinghat { - server sortinghat:{{ include "port.sortinghat" . }}; -} -server { - include mime.types; - sendfile on; - listen {{ include "port.nginxListen" . }}; - - server_name localhost nginx; - - location / { - proxy_pass ${KIBANA_HOST}; - proxy_redirect ${KIBANA_HOST} /; - proxy_http_version 1.1; - proxy_set_header Upgrade $http_upgrade; - proxy_set_header Connection 'upgrade'; - proxy_set_header Host $host; - proxy_cache_bypass $http_upgrade; - } - - location /identities { - rewrite ^/identities/(.*) /$1 break; - - include /etc/nginx/uwsgi_params; - uwsgi_pass sortinghat; - uwsgi_param Host $host; - uwsgi_param X-Real-IP $remote_addr; - uwsgi_param X-Forwarded-For $proxy_add_x_forwarded_for; - uwsgi_param X-Forwarded-Proto $http_x_forwarded_proto; - } - - location ~ ^/identities/(css|js|fonts)/ { - rewrite ^/identities/(.*) /$1 break; - - root /sortinghat; - } -} -{{- end }} +{{/* +uwsgi params config for nginx +*/}} +{{- define "config.uwsgiParams" -}} +uwsgi_param QUERY_STRING $query_string; +uwsgi_param REQUEST_METHOD $request_method; +uwsgi_param CONTENT_TYPE $content_type; +uwsgi_param CONTENT_LENGTH $content_length; +uwsgi_param REQUEST_URI $request_uri; +uwsgi_param PATH_INFO $document_uri; +uwsgi_param DOCUMENT_ROOT $document_root; +uwsgi_param SERVER_PROTOCOL $server_protocol; +uwsgi_param HTTPS $https if_not_empty; +uwsgi_param REMOTE_ADDR $remote_addr; +uwsgi_param REMOTE_PORT $remote_port; +uwsgi_param SERVER_PORT $server_port; +uwsgi_param SERVER_NAME $server_name; +{{- end }} + +{{/* +nginx config +*/}} +{{- define "config.nginxConf" -}} +upstream sortinghat { + server sortinghat:{{ include "port.sortinghat" . }}; +} +server { + include mime.types; + sendfile on; + listen {{ include "port.nginxListen" . }}; + + server_name localhost nginx; + + location / { + proxy_pass ${KIBANA_HOST}; + proxy_redirect ${KIBANA_HOST} /; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection 'upgrade'; + proxy_set_header Host $host; + proxy_cache_bypass $http_upgrade; + } + + location /identities { + rewrite ^/identities/(.*) /$1 break; + + include /etc/nginx/uwsgi_params; + uwsgi_pass sortinghat; + uwsgi_param Host $host; + uwsgi_param X-Real-IP $remote_addr; + uwsgi_param X-Forwarded-For $proxy_add_x_forwarded_for; + uwsgi_param X-Forwarded-Proto $http_x_forwarded_proto; + } + + location ~ ^/identities/(css|js|fonts)/ { + rewrite ^/identities/(.*) /$1 break; + + root /sortinghat; + } +} +{{- end }} diff --git a/kubernetes/helm-chart/charts/nginx/templates/deployment.yaml b/kubernetes/helm-chart/charts/nginx/templates/deployment.yaml index 57e0c1c7..b3c81c92 100644 --- a/kubernetes/helm-chart/charts/nginx/templates/deployment.yaml +++ b/kubernetes/helm-chart/charts/nginx/templates/deployment.yaml @@ -1,59 +1,59 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: "{{ .Values.appConfig.name }}" - labels: - app: "{{ .Values.appConfig.name }}" - {{- include "metadata.nginx.pod.labels" . | nindent 4 }} - annotations: - {{- include "metadata.nginx.pod.annotations" . | nindent 4 }} - -spec: - replicas: {{ .Values.appConfig.replicas }} - selector: - matchLabels: - app: "{{ .Values.appConfig.name }}" - template: - metadata: - labels: - app: "{{ .Values.appConfig.name }}" - {{- include "metadata.nginx.pod.labels" . | nindent 8 }} - annotations: - {{- include "metadata.nginx.pod.annotations" . | nindent 8 }} - spec: - {{- with .Values.global.topologyConfig }} - {{- toYaml . | nindent 6 }} - {{- end }} - terminationGracePeriodSeconds: 10 - {{- with .Values.global.imagePullSecrets}} - imagePullSecrets: - {{- toYaml . | nindent 8}} - {{- end}} - containers: - - name: nginx - image: {{ .Values.appConfig.image }} - ports: - - containerPort: {{ .Values.service.targetPort }} - # v ---- Volume mount define ---- - {{- if .Values.dependencies.storage.enabled }} - volumeMounts: - {{- include "template.volumeMount" . | nindent 12 }} - {{- end }} - # ^ ---- Volume mount define ---- - # v ---- Resources define ---- - resources: - {{- include "template.resQuota" . | nindent 12 }} - # ^ ---- Resources define ---- - env: - {{- include "nativeEnv.nginx" . | nindent 12 }} - {{- with .Values.extraEnvs }} - {{- toYaml . | nindent 12 }} - {{- end }} - # v ---- Volumes define ---- - {{- if .Values.dependencies.storage.enabled }} - volumes: - {{- range .Values.dependencies.storage.volumes }} - {{- include "template.volumes" (dict "item" . "root" $ ) | nindent 8 }} - {{- end }} - {{- end }} - # ^ ---- Volumes define ---- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: "{{ .Values.appConfig.name }}" + labels: + app: "{{ .Values.appConfig.name }}" + {{- include "metadata.nginx.pod.labels" . | nindent 4 }} + annotations: + {{- include "metadata.nginx.pod.annotations" . | nindent 4 }} + +spec: + replicas: {{ .Values.appConfig.replicas }} + selector: + matchLabels: + app: "{{ .Values.appConfig.name }}" + template: + metadata: + labels: + app: "{{ .Values.appConfig.name }}" + {{- include "metadata.nginx.pod.labels" . | nindent 8 }} + annotations: + {{- include "metadata.nginx.pod.annotations" . | nindent 8 }} + spec: + {{- with .Values.global.topologyConfig }} + {{- toYaml . | nindent 6 }} + {{- end }} + terminationGracePeriodSeconds: 10 + {{- with .Values.global.imagePullSecrets}} + imagePullSecrets: + {{- toYaml . | nindent 8}} + {{- end}} + containers: + - name: nginx + image: {{ .Values.appConfig.image }} + ports: + - containerPort: {{ .Values.service.targetPort }} + # v ---- Volume mount define ---- + {{- if .Values.dependencies.storage.enabled }} + volumeMounts: + {{- include "template.volumeMount" . | nindent 12 }} + {{- end }} + # ^ ---- Volume mount define ---- + # v ---- Resources define ---- + resources: + {{- include "template.resQuota" . | nindent 12 }} + # ^ ---- Resources define ---- + env: + {{- include "nativeEnv.nginx" . | nindent 12 }} + {{- with .Values.extraEnvs }} + {{- toYaml . | nindent 12 }} + {{- end }} + # v ---- Volumes define ---- + {{- if .Values.dependencies.storage.enabled }} + volumes: + {{- range .Values.dependencies.storage.volumes }} + {{- include "template.volumes" (dict "item" . "root" $ ) | nindent 8 }} + {{- end }} + {{- end }} + # ^ ---- Volumes define ---- diff --git a/kubernetes/helm-chart/charts/nginx/templates/pvc.yaml b/kubernetes/helm-chart/charts/nginx/templates/pvc.yaml index babc5bee..0200c4fc 100644 --- a/kubernetes/helm-chart/charts/nginx/templates/pvc.yaml +++ b/kubernetes/helm-chart/charts/nginx/templates/pvc.yaml @@ -1,3 +1,3 @@ -{{- range .Values.dependencies.storage.volumes }} -{{- include "template.pvc" ( dict "item" . "root" $ ) }} -{{- end }} +{{- range .Values.dependencies.storage.volumes }} +{{- include "template.pvc" ( dict "item" . "root" $ ) }} +{{- end }} diff --git a/kubernetes/helm-chart/charts/nginx/templates/service.yaml b/kubernetes/helm-chart/charts/nginx/templates/service.yaml index f765af6a..d0fd98fa 100644 --- a/kubernetes/helm-chart/charts/nginx/templates/service.yaml +++ b/kubernetes/helm-chart/charts/nginx/templates/service.yaml @@ -1,11 +1,11 @@ -apiVersion: v1 -kind: Service -metadata: - name: "{{ .Values.appConfig.name }}" - labels: - app: "{{ .Values.appConfig.name }}" - {{- include "metadata.nginx.service.labels" . | nindent 4 }} - annotations: - {{- include "metadata.nginx.service.annotations" . | nindent 4 }} -spec: - {{- include "template.service" . | nindent 2 }} +apiVersion: v1 +kind: Service +metadata: + name: "{{ .Values.appConfig.name }}" + labels: + app: "{{ .Values.appConfig.name }}" + {{- include "metadata.nginx.service.labels" . | nindent 4 }} + annotations: + {{- include "metadata.nginx.service.annotations" . | nindent 4 }} +spec: + {{- include "template.service" . | nindent 2 }} diff --git a/kubernetes/helm-chart/charts/nginx/values.yaml b/kubernetes/helm-chart/charts/nginx/values.yaml index 8f81a8ae..d5495290 100644 --- a/kubernetes/helm-chart/charts/nginx/values.yaml +++ b/kubernetes/helm-chart/charts/nginx/values.yaml @@ -1,47 +1,47 @@ -global: - topologyConfig: {} - imagePullSecrets: [] - imageRegistry: "" - appName: "" - -install: true - -appConfig: - name: "nginx" - replicas: 1 - image: docker.io/nginx:1.27.2 - pullPolicy: IfNotPresent - - labels: {} - annotations: {} - resources: - cpu: - limits: "" - requests: "" - memory: - limits: "" - requests: "" - -dependencies: - storage: - enabled: true - volumes: - - name: "nginx-conf-template" - mountPath: "/etc/nginx/templates/default.conf.template" - type: configmap - subPath: "nginx-conf-template" - - name: "uwsgi-params" - mountPath: "/etc/nginx/uwsgi_params" - type: configmap - subPath: "uwsgi-params" - - name: "sortinghat-static" - mountPath: "/sortinghat" - type: pvc -service: - labels: {} - annotations: {} - targetPort: 8000 - scheme: "http" - type: "" # Default to "ClusterIP" - -extraEnvs: [] +global: + topologyConfig: {} + imagePullSecrets: [] + imageRegistry: "" + appName: "" + +install: true + +appConfig: + name: "nginx" + replicas: 1 + image: docker.io/nginx:1.27.2 + pullPolicy: IfNotPresent + + labels: {} + annotations: {} + resources: + cpu: + limits: "" + requests: "" + memory: + limits: "" + requests: "" + +dependencies: + storage: + enabled: true + volumes: + - name: "nginx-conf-template" + mountPath: "/etc/nginx/templates/default.conf.template" + type: configmap + subPath: "nginx-conf-template" + - name: "uwsgi-params" + mountPath: "/etc/nginx/uwsgi_params" + type: configmap + subPath: "uwsgi-params" + - name: "sortinghat-static" + mountPath: "/sortinghat" + type: pvc +service: + labels: {} + annotations: {} + targetPort: 8000 + scheme: "http" + type: "" # Default to "ClusterIP" + +extraEnvs: [] diff --git a/kubernetes/helm-chart/charts/opensearch-dashboard/Chart.yaml b/kubernetes/helm-chart/charts/opensearch-dashboard/Chart.yaml index da2cd644..67759a03 100644 --- a/kubernetes/helm-chart/charts/opensearch-dashboard/Chart.yaml +++ b/kubernetes/helm-chart/charts/opensearch-dashboard/Chart.yaml @@ -1,10 +1,10 @@ -apiVersion: v2 -name: opensearch-dashboard -description: OpenSearch is a scalable, flexible, and extensible open-source software suite for search, analytics, and observability applications derived from Elasticsearch 7.10.2 and Kibana 7.10.2 and licensed under Apache 2.0. -home: https://opensearch.org/ -icon: https://www.gravatar.com/avatar/28cb77e720377dcf01e9fee30967c128 -maintainers: -- name: Arie - url: https://github.com/Eroyi -appVersion: 2.11.1 -version: 1.0 +apiVersion: v2 +name: opensearch-dashboard +description: OpenSearch is a scalable, flexible, and extensible open-source software suite for search, analytics, and observability applications derived from Elasticsearch 7.10.2 and Kibana 7.10.2 and licensed under Apache 2.0. +home: https://opensearch.org/ +icon: https://www.gravatar.com/avatar/28cb77e720377dcf01e9fee30967c128 +maintainers: +- name: Arie + url: https://github.com/Eroyi +appVersion: 2.11.1 +version: 1.0 diff --git a/kubernetes/helm-chart/charts/opensearch-dashboard/templates/_helper.tpl b/kubernetes/helm-chart/charts/opensearch-dashboard/templates/_helper.tpl index 0e6d3556..65e08015 100644 --- a/kubernetes/helm-chart/charts/opensearch-dashboard/templates/_helper.tpl +++ b/kubernetes/helm-chart/charts/opensearch-dashboard/templates/_helper.tpl @@ -1,36 +1,36 @@ -{{/* -Opensearch Dashboard labels -*/}} -{{- define "metadata.opensearchDashboard.pod.labels" -}} -{{- range $name, $value := .Values.appConfig.labels }} -{{ $name }}: {{ $value | quote }} -{{- end -}} -{{- end -}} - -{{/* -Opensearch Dashboard annotations -*/}} -{{- define "metadata.opensearchDashboard.pod.annotations" -}} -{{- range $name, $value := .Values.appConfig.annotations }} -{{ $name }}: {{ $value | quote }} -{{- end -}} -{{- end -}} - - -{{/* -Opensearch Dashboard Service labels -*/}} -{{- define "metadata.opensearchDashboard.service.labels" -}} -{{- range $name, $value := .Values.service.labels }} -{{ $name }}: {{ $value | quote }} -{{- end -}} -{{- end -}} - -{{/* -Opensearch Dashboard Service annotations -*/}} -{{- define "metadata.opensearchDashboard.service.annotations" -}} -{{- range $name, $value := .Values.service.annotations }} -{{ $name }}: {{ $value | quote }} -{{- end -}} -{{- end -}} +{{/* +Opensearch Dashboard labels +*/}} +{{- define "metadata.opensearchDashboard.pod.labels" -}} +{{- range $name, $value := .Values.appConfig.labels }} +{{ $name }}: {{ $value | quote }} +{{- end -}} +{{- end -}} + +{{/* +Opensearch Dashboard annotations +*/}} +{{- define "metadata.opensearchDashboard.pod.annotations" -}} +{{- range $name, $value := .Values.appConfig.annotations }} +{{ $name }}: {{ $value | quote }} +{{- end -}} +{{- end -}} + + +{{/* +Opensearch Dashboard Service labels +*/}} +{{- define "metadata.opensearchDashboard.service.labels" -}} +{{- range $name, $value := .Values.service.labels }} +{{ $name }}: {{ $value | quote }} +{{- end -}} +{{- end -}} + +{{/* +Opensearch Dashboard Service annotations +*/}} +{{- define "metadata.opensearchDashboard.service.annotations" -}} +{{- range $name, $value := .Values.service.annotations }} +{{ $name }}: {{ $value | quote }} +{{- end -}} +{{- end -}} diff --git a/kubernetes/helm-chart/charts/opensearch-dashboard/templates/deployment.yaml b/kubernetes/helm-chart/charts/opensearch-dashboard/templates/deployment.yaml index 2f1080f4..257c441c 100644 --- a/kubernetes/helm-chart/charts/opensearch-dashboard/templates/deployment.yaml +++ b/kubernetes/helm-chart/charts/opensearch-dashboard/templates/deployment.yaml @@ -1,59 +1,59 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: "{{ .Values.appConfig.name }}" - labels: - app: "{{ .Values.appConfig.name }}" - {{- include "metadata.opensearchDashboard.pod.labels" . | nindent 4 }} - annotations: - {{- include "metadata.opensearchDashboard.pod.annotations" . | nindent 4 }} - -spec: - replicas: {{ .Values.appConfig.replicas }} - selector: - matchLabels: - app: "{{ .Values.appConfig.name }}" - template: - metadata: - labels: - app: "{{ .Values.appConfig.name }}" - {{- include "metadata.opensearchDashboard.pod.labels" . | nindent 8 }} - annotations: - {{- include "metadata.opensearchDashboard.pod.annotations" . | nindent 8 }} - spec: - {{- with .Values.global.topologyConfig }} - {{- toYaml . | nindent 6 }} - {{- end }} - terminationGracePeriodSeconds: 10 - {{- with .Values.global.imagePullSecrets }} - imagePullSecrets: - {{- toYaml . | nindent 8 }} - {{- end}} - containers: - - name: opensearch-dashboard - image: {{ .Values.appConfig.image }} - ports: - - containerPort: {{ .Values.service.targetPort }} - # v ---- Volume mount define ---- - {{- if .Values.dependencies.storage.enabled }} - volumeMounts: - {{- include "template.volumeMount" . | nindent 12 }} - {{- end }} - # ^ ---- Volume mount define ---- - # v ---- Resources define ---- - resources: - {{- include "template.resQuota" . | nindent 12 }} - # ^ ---- Resources define ---- - env: - {{- include "nativeEnv.opensearchDashboard" . | nindent 12 }} - {{- with .Values.extraEnvs }} - {{- toYaml . | nindent 12 }} - {{- end }} - # v ---- Volumes define ---- - {{- if .Values.dependencies.storage.enabled }} - volumes: - {{- range .Values.dependencies.storage.volumes }} - {{- include "template.volumes" (dict "item" . "root" $ ) | nindent 8 }} - {{- end }} - {{- end }} - # ^ ---- Volumes define ---- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: "{{ .Values.appConfig.name }}" + labels: + app: "{{ .Values.appConfig.name }}" + {{- include "metadata.opensearchDashboard.pod.labels" . | nindent 4 }} + annotations: + {{- include "metadata.opensearchDashboard.pod.annotations" . | nindent 4 }} + +spec: + replicas: {{ .Values.appConfig.replicas }} + selector: + matchLabels: + app: "{{ .Values.appConfig.name }}" + template: + metadata: + labels: + app: "{{ .Values.appConfig.name }}" + {{- include "metadata.opensearchDashboard.pod.labels" . | nindent 8 }} + annotations: + {{- include "metadata.opensearchDashboard.pod.annotations" . | nindent 8 }} + spec: + {{- with .Values.global.topologyConfig }} + {{- toYaml . | nindent 6 }} + {{- end }} + terminationGracePeriodSeconds: 10 + {{- with .Values.global.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end}} + containers: + - name: opensearch-dashboard + image: {{ .Values.appConfig.image }} + ports: + - containerPort: {{ .Values.service.targetPort }} + # v ---- Volume mount define ---- + {{- if .Values.dependencies.storage.enabled }} + volumeMounts: + {{- include "template.volumeMount" . | nindent 12 }} + {{- end }} + # ^ ---- Volume mount define ---- + # v ---- Resources define ---- + resources: + {{- include "template.resQuota" . | nindent 12 }} + # ^ ---- Resources define ---- + env: + {{- include "nativeEnv.opensearchDashboard" . | nindent 12 }} + {{- with .Values.extraEnvs }} + {{- toYaml . | nindent 12 }} + {{- end }} + # v ---- Volumes define ---- + {{- if .Values.dependencies.storage.enabled }} + volumes: + {{- range .Values.dependencies.storage.volumes }} + {{- include "template.volumes" (dict "item" . "root" $ ) | nindent 8 }} + {{- end }} + {{- end }} + # ^ ---- Volumes define ---- diff --git a/kubernetes/helm-chart/charts/opensearch-dashboard/templates/pvc.yaml b/kubernetes/helm-chart/charts/opensearch-dashboard/templates/pvc.yaml index babc5bee..0200c4fc 100644 --- a/kubernetes/helm-chart/charts/opensearch-dashboard/templates/pvc.yaml +++ b/kubernetes/helm-chart/charts/opensearch-dashboard/templates/pvc.yaml @@ -1,3 +1,3 @@ -{{- range .Values.dependencies.storage.volumes }} -{{- include "template.pvc" ( dict "item" . "root" $ ) }} -{{- end }} +{{- range .Values.dependencies.storage.volumes }} +{{- include "template.pvc" ( dict "item" . "root" $ ) }} +{{- end }} diff --git a/kubernetes/helm-chart/charts/opensearch-dashboard/templates/service.yaml b/kubernetes/helm-chart/charts/opensearch-dashboard/templates/service.yaml index 4eec6ab7..e76e2877 100644 --- a/kubernetes/helm-chart/charts/opensearch-dashboard/templates/service.yaml +++ b/kubernetes/helm-chart/charts/opensearch-dashboard/templates/service.yaml @@ -1,11 +1,11 @@ -apiVersion: v1 -kind: Service -metadata: - name: "{{ .Values.appConfig.name }}" - labels: - app: "{{ .Values.appConfig.name }}" - {{- include "metadata.opensearchDashboard.service.labels" . | nindent 4 }} - annotations: - {{- include "metadata.opensearchDashboard.service.annotations" . | nindent 4 }} -spec: - {{- include "template.service" . | nindent 2 }} +apiVersion: v1 +kind: Service +metadata: + name: "{{ .Values.appConfig.name }}" + labels: + app: "{{ .Values.appConfig.name }}" + {{- include "metadata.opensearchDashboard.service.labels" . | nindent 4 }} + annotations: + {{- include "metadata.opensearchDashboard.service.annotations" . | nindent 4 }} +spec: + {{- include "template.service" . | nindent 2 }} diff --git a/kubernetes/helm-chart/charts/opensearch-dashboard/values.yaml b/kubernetes/helm-chart/charts/opensearch-dashboard/values.yaml index 8418d561..5bacc887 100644 --- a/kubernetes/helm-chart/charts/opensearch-dashboard/values.yaml +++ b/kubernetes/helm-chart/charts/opensearch-dashboard/values.yaml @@ -1,37 +1,37 @@ -global: - topologyConfig: {} - imagePullSecrets: [] - imageRegistry: "" - appName: "" - -install: true - -appConfig: - name: "opensearch-dashboard" - replicas: 1 - image: docker.io/opensearchproject/opensearch-dashboards:2.11.1 - pullPolicy: IfNotPresent - - labels: {} - annotations: {} - resources: - cpu: - limits: "" - requests: "" - memory: - limits: "" - requests: "" - -dependencies: - storage: - enabled: false - volumes: [] - -service: - labels: {} - annotations: {} - targetPort: 5601 - scheme: "http" - type: "" # Default to "ClusterIP" - -extraEnvs: [] +global: + topologyConfig: {} + imagePullSecrets: [] + imageRegistry: "" + appName: "" + +install: true + +appConfig: + name: "opensearch-dashboard" + replicas: 1 + image: docker.io/opensearchproject/opensearch-dashboards:2.11.1 + pullPolicy: IfNotPresent + + labels: {} + annotations: {} + resources: + cpu: + limits: "" + requests: "" + memory: + limits: "" + requests: "" + +dependencies: + storage: + enabled: false + volumes: [] + +service: + labels: {} + annotations: {} + targetPort: 5601 + scheme: "http" + type: "" # Default to "ClusterIP" + +extraEnvs: [] diff --git a/kubernetes/helm-chart/charts/opensearch-node/Chart.yaml b/kubernetes/helm-chart/charts/opensearch-node/Chart.yaml index 91520c08..040ed54c 100644 --- a/kubernetes/helm-chart/charts/opensearch-node/Chart.yaml +++ b/kubernetes/helm-chart/charts/opensearch-node/Chart.yaml @@ -1,10 +1,10 @@ -apiVersion: v2 -name: opensearch-node -description: OpenSearch is a scalable, flexible, and extensible open-source software suite for search, analytics, and observability applications derived from Elasticsearch 7.10.2 and Kibana 7.10.2 and licensed under Apache 2.0. -home: https://opensearch.org/ -icon: https://www.gravatar.com/avatar/28cb77e720377dcf01e9fee30967c128 -maintainers: -- name: Arie - url: https://github.com/Eroyi -appVersion: 2.11.1 -version: 1.0 +apiVersion: v2 +name: opensearch-node +description: OpenSearch is a scalable, flexible, and extensible open-source software suite for search, analytics, and observability applications derived from Elasticsearch 7.10.2 and Kibana 7.10.2 and licensed under Apache 2.0. +home: https://opensearch.org/ +icon: https://www.gravatar.com/avatar/28cb77e720377dcf01e9fee30967c128 +maintainers: +- name: Arie + url: https://github.com/Eroyi +appVersion: 2.11.1 +version: 1.0 diff --git a/kubernetes/helm-chart/charts/opensearch-node/templates/_helper.tpl b/kubernetes/helm-chart/charts/opensearch-node/templates/_helper.tpl index de292dd6..95a0dc33 100644 --- a/kubernetes/helm-chart/charts/opensearch-node/templates/_helper.tpl +++ b/kubernetes/helm-chart/charts/opensearch-node/templates/_helper.tpl @@ -1,36 +1,36 @@ -{{/* -Opensearch labels -*/}} -{{- define "metadata.opensearchNode.pod.labels" -}} -{{- range $name, $value := .Values.appConfig.labels }} -{{ $name }}: {{ $value | quote }} -{{- end -}} -{{- end -}} - -{{/* -Opensearch annotations -*/}} -{{- define "metadata.opensearchNode.pod.annotations" -}} -{{- range $name, $value := .Values.appConfig.annotations }} -{{ $name }}: {{ $value | quote }} -{{- end -}} -{{- end -}} - - -{{/* -Opensearch Service labels -*/}} -{{- define "metadata.opensearchNode.service.labels" -}} -{{- range $name, $value := .Values.service.labels }} -{{ $name }}: {{ $value | quote }} -{{- end -}} -{{- end -}} - -{{/* -Opensearch Service annotations -*/}} -{{- define "metadata.opensearchNode.service.annotations" -}} -{{- range $name, $value := .Values.service.annotations }} -{{ $name }}: {{ $value | quote }} -{{- end -}} -{{- end -}} +{{/* +Opensearch labels +*/}} +{{- define "metadata.opensearchNode.pod.labels" -}} +{{- range $name, $value := .Values.appConfig.labels }} +{{ $name }}: {{ $value | quote }} +{{- end -}} +{{- end -}} + +{{/* +Opensearch annotations +*/}} +{{- define "metadata.opensearchNode.pod.annotations" -}} +{{- range $name, $value := .Values.appConfig.annotations }} +{{ $name }}: {{ $value | quote }} +{{- end -}} +{{- end -}} + + +{{/* +Opensearch Service labels +*/}} +{{- define "metadata.opensearchNode.service.labels" -}} +{{- range $name, $value := .Values.service.labels }} +{{ $name }}: {{ $value | quote }} +{{- end -}} +{{- end -}} + +{{/* +Opensearch Service annotations +*/}} +{{- define "metadata.opensearchNode.service.annotations" -}} +{{- range $name, $value := .Values.service.annotations }} +{{ $name }}: {{ $value | quote }} +{{- end -}} +{{- end -}} diff --git a/kubernetes/helm-chart/charts/opensearch-node/templates/deployment.yaml b/kubernetes/helm-chart/charts/opensearch-node/templates/deployment.yaml index 7fb7d403..65698fa4 100644 --- a/kubernetes/helm-chart/charts/opensearch-node/templates/deployment.yaml +++ b/kubernetes/helm-chart/charts/opensearch-node/templates/deployment.yaml @@ -1,64 +1,64 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: "{{ .Values.appConfig.name }}" - labels: - app: "{{ .Values.appConfig.name }}" - {{- include "metadata.opensearchNode.pod.labels" . | nindent 4 }} - annotations: - {{- include "metadata.opensearchNode.pod.annotations" . | nindent 4 }} - -spec: - replicas: {{ .Values.appConfig.replicas }} - selector: - matchLabels: - app: "{{ .Values.appConfig.name }}" - template: - metadata: - labels: - app: "{{ .Values.appConfig.name }}" - {{- include "metadata.opensearchNode.pod.labels" . | nindent 8 }} - annotations: - {{- include "metadata.opensearchNode.pod.annotations" . | nindent 8 }} - spec: - {{- with .Values.global.topologyConfig }} - {{- toYaml . | nindent 6 }} - {{- end }} - {{- if hasKey .Values.appConfig "security" }} - securityContext: - runAsUser: {{ .Values.appConfig.security.userID }} - runAsGroup: {{ .Values.appConfig.security.groupID }} - {{- end }} - terminationGracePeriodSeconds: 10 - {{- with .Values.global.imagePullSecrets}} - imagePullSecrets: - {{- toYaml . | nindent 8}} - {{- end}} - containers: - - name: opensearch-node - image: {{ .Values.appConfig.image }} - ports: - - containerPort: {{ .Values.service.targetPort }} - # v ---- Volume mount define ---- - {{- if .Values.dependencies.storage.enabled }} - volumeMounts: - {{- include "template.volumeMount" . | nindent 12 }} - {{- end }} - # ^ ---- Volume mount define ---- - # v ---- Resources define ---- - resources: - {{- include "template.resQuota" . | nindent 12 }} - # ^ ---- Resources define ---- - env: - {{- include "nativeEnv.opensearchNode" . | nindent 12 }} - {{- with .Values.extraEnvs }} - {{- toYaml . | nindent 12 }} - {{- end }} - # v ---- Volumes define ---- - {{- if .Values.dependencies.storage.enabled }} - volumes: - {{- range .Values.dependencies.storage.volumes }} - {{- include "template.volumes" (dict "item" . "root" $ ) | nindent 8 }} - {{- end }} - {{- end }} - # ^ ---- Volumes define ---- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: "{{ .Values.appConfig.name }}" + labels: + app: "{{ .Values.appConfig.name }}" + {{- include "metadata.opensearchNode.pod.labels" . | nindent 4 }} + annotations: + {{- include "metadata.opensearchNode.pod.annotations" . | nindent 4 }} + +spec: + replicas: {{ .Values.appConfig.replicas }} + selector: + matchLabels: + app: "{{ .Values.appConfig.name }}" + template: + metadata: + labels: + app: "{{ .Values.appConfig.name }}" + {{- include "metadata.opensearchNode.pod.labels" . | nindent 8 }} + annotations: + {{- include "metadata.opensearchNode.pod.annotations" . | nindent 8 }} + spec: + {{- with .Values.global.topologyConfig }} + {{- toYaml . | nindent 6 }} + {{- end }} + {{- if hasKey .Values.appConfig "security" }} + securityContext: + runAsUser: {{ .Values.appConfig.security.userID }} + runAsGroup: {{ .Values.appConfig.security.groupID }} + {{- end }} + terminationGracePeriodSeconds: 10 + {{- with .Values.global.imagePullSecrets}} + imagePullSecrets: + {{- toYaml . | nindent 8}} + {{- end}} + containers: + - name: opensearch-node + image: {{ .Values.appConfig.image }} + ports: + - containerPort: {{ .Values.service.targetPort }} + # v ---- Volume mount define ---- + {{- if .Values.dependencies.storage.enabled }} + volumeMounts: + {{- include "template.volumeMount" . | nindent 12 }} + {{- end }} + # ^ ---- Volume mount define ---- + # v ---- Resources define ---- + resources: + {{- include "template.resQuota" . | nindent 12 }} + # ^ ---- Resources define ---- + env: + {{- include "nativeEnv.opensearchNode" . | nindent 12 }} + {{- with .Values.extraEnvs }} + {{- toYaml . | nindent 12 }} + {{- end }} + # v ---- Volumes define ---- + {{- if .Values.dependencies.storage.enabled }} + volumes: + {{- range .Values.dependencies.storage.volumes }} + {{- include "template.volumes" (dict "item" . "root" $ ) | nindent 8 }} + {{- end }} + {{- end }} + # ^ ---- Volumes define ---- diff --git a/kubernetes/helm-chart/charts/opensearch-node/templates/pvc.yaml b/kubernetes/helm-chart/charts/opensearch-node/templates/pvc.yaml index babc5bee..0200c4fc 100644 --- a/kubernetes/helm-chart/charts/opensearch-node/templates/pvc.yaml +++ b/kubernetes/helm-chart/charts/opensearch-node/templates/pvc.yaml @@ -1,3 +1,3 @@ -{{- range .Values.dependencies.storage.volumes }} -{{- include "template.pvc" ( dict "item" . "root" $ ) }} -{{- end }} +{{- range .Values.dependencies.storage.volumes }} +{{- include "template.pvc" ( dict "item" . "root" $ ) }} +{{- end }} diff --git a/kubernetes/helm-chart/charts/opensearch-node/templates/service.yaml b/kubernetes/helm-chart/charts/opensearch-node/templates/service.yaml index 4c94d5a2..b93c22b3 100644 --- a/kubernetes/helm-chart/charts/opensearch-node/templates/service.yaml +++ b/kubernetes/helm-chart/charts/opensearch-node/templates/service.yaml @@ -1,11 +1,11 @@ -apiVersion: v1 -kind: Service -metadata: - name: "{{ .Values.appConfig.name }}" - labels: - app: "{{ .Values.appConfig.name }}" - {{- include "metadata.opensearchNode.service.labels" . | nindent 4 }} - annotations: - {{- include "metadata.opensearchNode.service.annotations" . | nindent 4 }} -spec: - {{- include "template.service" . | nindent 2 }} +apiVersion: v1 +kind: Service +metadata: + name: "{{ .Values.appConfig.name }}" + labels: + app: "{{ .Values.appConfig.name }}" + {{- include "metadata.opensearchNode.service.labels" . | nindent 4 }} + annotations: + {{- include "metadata.opensearchNode.service.annotations" . | nindent 4 }} +spec: + {{- include "template.service" . | nindent 2 }} diff --git a/kubernetes/helm-chart/charts/opensearch-node/values.yaml b/kubernetes/helm-chart/charts/opensearch-node/values.yaml index 3da1b34a..38b5f9aa 100644 --- a/kubernetes/helm-chart/charts/opensearch-node/values.yaml +++ b/kubernetes/helm-chart/charts/opensearch-node/values.yaml @@ -1,45 +1,45 @@ -global: - topologyConfig: {} - imagePullSecrets: [] - imageRegistry: "" - appName: "" - -install: true - -appConfig: - name: "opensearch-node" - replicas: 1 - image: docker.io/opensearchproject/opensearch:2.11.1 - pullPolicy: IfNotPresent - - labels: {} - annotations: {} - resources: - cpu: - limits: "" - requests: "" - memory: - limits: "" - requests: "" - security: - userID: 1000 - groupID: 1000 - -dependencies: - storage: - enabled: true - volumes: - - name: "opensearch-data" - mountPath: "/usr/share/opensearch/data" - type: pvc - storageClass: efs-sc - size: 1Gi - -service: - labels: {} - annotations: {} - targetPort: 9200 - scheme: "http" - type: "" # Default to "ClusterIP" - -extraEnvs: [] +global: + topologyConfig: {} + imagePullSecrets: [] + imageRegistry: "" + appName: "" + +install: true + +appConfig: + name: "opensearch-node" + replicas: 1 + image: docker.io/opensearchproject/opensearch:2.11.1 + pullPolicy: IfNotPresent + + labels: {} + annotations: {} + resources: + cpu: + limits: "" + requests: "" + memory: + limits: "" + requests: "" + security: + userID: 1000 + groupID: 1000 + +dependencies: + storage: + enabled: true + volumes: + - name: "opensearch-data" + mountPath: "/usr/share/opensearch/data" + type: pvc + storageClass: efs-sc + size: 1Gi + +service: + labels: {} + annotations: {} + targetPort: 9200 + scheme: "http" + type: "" # Default to "ClusterIP" + +extraEnvs: [] diff --git a/kubernetes/helm-chart/charts/sortinghat-worker/Chart.yaml b/kubernetes/helm-chart/charts/sortinghat-worker/Chart.yaml index 3575d5b8..95578ab5 100644 --- a/kubernetes/helm-chart/charts/sortinghat-worker/Chart.yaml +++ b/kubernetes/helm-chart/charts/sortinghat-worker/Chart.yaml @@ -1,10 +1,10 @@ -apiVersion: v2 -name: sortinghat-worker -description: Sortinghat worker for GrimoireLab. -home: https://github.com/chaoss/grimoirelab -icon: https://www.gravatar.com/avatar/4154acefea56ed23bddaaa47a4850400 -maintainers: -- name: Arie - url: https://github.com/Eroyi -appVersion: 1.7.0 #Based on the "Github Release" version (which is the docker image tag referring from), not the actual application version. -version: 1.0 +apiVersion: v2 +name: sortinghat-worker +description: Sortinghat worker for GrimoireLab. +home: https://github.com/chaoss/grimoirelab +icon: https://www.gravatar.com/avatar/4154acefea56ed23bddaaa47a4850400 +maintainers: +- name: Arie + url: https://github.com/Eroyi +appVersion: 1.7.0 #Based on the "Github Release" version (which is the docker image tag referring from), not the actual application version. +version: 1.0 diff --git a/kubernetes/helm-chart/charts/sortinghat-worker/templates/_helper.tpl b/kubernetes/helm-chart/charts/sortinghat-worker/templates/_helper.tpl index b0bbc1de..083a66a1 100644 --- a/kubernetes/helm-chart/charts/sortinghat-worker/templates/_helper.tpl +++ b/kubernetes/helm-chart/charts/sortinghat-worker/templates/_helper.tpl @@ -1,36 +1,36 @@ -{{/* -Sortinghat labels -*/}} -{{- define "metadata.sortinghatWorker.pod.labels" -}} -{{- range $name, $value := .Values.appConfig.labels }} -{{ $name }}: {{ $value | quote }} -{{- end -}} -{{- end -}} - -{{/* -Sortinghat annotations -*/}} -{{- define "metadata.sortinghatWorker.pod.annotations" -}} -{{- range $name, $value := .Values.appConfig.annotations }} -{{ $name }}: {{ $value | quote }} -{{- end -}} -{{- end -}} - - -{{/* -Sortinghat Service labels -*/}} -{{- define "metadata.sortinghatWorker.service.labels" -}} -{{- range $name, $value := .Values.service.labels }} -{{ $name }}: {{ $value | quote }} -{{- end -}} -{{- end -}} - -{{/* -Sortinghat Service annotations -*/}} -{{- define "metadata.sortinghatWorker.service.annotations" -}} -{{- range $name, $value := .Values.service.annotations }} -{{ $name }}: {{ $value | quote }} -{{- end -}} -{{- end -}} +{{/* +Sortinghat labels +*/}} +{{- define "metadata.sortinghatWorker.pod.labels" -}} +{{- range $name, $value := .Values.appConfig.labels }} +{{ $name }}: {{ $value | quote }} +{{- end -}} +{{- end -}} + +{{/* +Sortinghat annotations +*/}} +{{- define "metadata.sortinghatWorker.pod.annotations" -}} +{{- range $name, $value := .Values.appConfig.annotations }} +{{ $name }}: {{ $value | quote }} +{{- end -}} +{{- end -}} + + +{{/* +Sortinghat Service labels +*/}} +{{- define "metadata.sortinghatWorker.service.labels" -}} +{{- range $name, $value := .Values.service.labels }} +{{ $name }}: {{ $value | quote }} +{{- end -}} +{{- end -}} + +{{/* +Sortinghat Service annotations +*/}} +{{- define "metadata.sortinghatWorker.service.annotations" -}} +{{- range $name, $value := .Values.service.annotations }} +{{ $name }}: {{ $value | quote }} +{{- end -}} +{{- end -}} diff --git a/kubernetes/helm-chart/charts/sortinghat-worker/templates/deployment.yaml b/kubernetes/helm-chart/charts/sortinghat-worker/templates/deployment.yaml index f829644e..dddb8349 100644 --- a/kubernetes/helm-chart/charts/sortinghat-worker/templates/deployment.yaml +++ b/kubernetes/helm-chart/charts/sortinghat-worker/templates/deployment.yaml @@ -1,59 +1,59 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: "{{ .Values.appConfig.name }}" - labels: - app: "{{ .Values.appConfig.name }}" - {{- include "metadata.sortinghatWorker.pod.labels" . | nindent 4 }} - annotations: - {{- include "metadata.sortinghatWorker.pod.annotations" . | nindent 4 }} - -spec: - replicas: {{ .Values.appConfig.replicas }} - selector: - matchLabels: - app: "{{ .Values.appConfig.name }}" - template: - metadata: - labels: - app: "{{ .Values.appConfig.name }}" - {{- include "metadata.sortinghatWorker.pod.labels" . | nindent 8 }} - annotations: - {{- include "metadata.sortinghatWorker.pod.annotations" . | nindent 8 }} - spec: - {{- with .Values.global.topologyConfig }} - {{- toYaml . | nindent 6 }} - {{- end }} - terminationGracePeriodSeconds: 10 - {{- with .Values.global.imagePullSecrets}} - imagePullSecrets: - {{- toYaml . | nindent 8}} - {{- end}} - containers: - - name: sortinghat - image: {{ .Values.appConfig.image }} - ports: - - containerPort: {{ .Values.service.targetPort }} - # v ---- Volume mount define ---- - {{- if .Values.dependencies.storage.enabled }} - volumeMounts: - {{- include "template.volumeMount" . | nindent 12 }} - {{- end }} - # ^ ---- Volume mount define ---- - # v ---- Resources define ---- - resources: - {{- include "template.resQuota" . | nindent 12 }} - # ^ ---- Resources define ---- - env: - {{- include "nativeEnv.sortinghatWorker" . | nindent 12 }} - {{- with .Values.extraEnvs }} - {{- toYaml . | nindent 12 }} - {{- end }} - # v ---- Volumes define ---- - {{- if .Values.dependencies.storage.enabled }} - volumes: - {{- range .Values.dependencies.storage.volumes }} - {{- include "template.volumes" (dict "item" . "root" $ ) | nindent 8 }} - {{- end }} - {{- end }} - # ^ ---- Volumes define ---- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: "{{ .Values.appConfig.name }}" + labels: + app: "{{ .Values.appConfig.name }}" + {{- include "metadata.sortinghatWorker.pod.labels" . | nindent 4 }} + annotations: + {{- include "metadata.sortinghatWorker.pod.annotations" . | nindent 4 }} + +spec: + replicas: {{ .Values.appConfig.replicas }} + selector: + matchLabels: + app: "{{ .Values.appConfig.name }}" + template: + metadata: + labels: + app: "{{ .Values.appConfig.name }}" + {{- include "metadata.sortinghatWorker.pod.labels" . | nindent 8 }} + annotations: + {{- include "metadata.sortinghatWorker.pod.annotations" . | nindent 8 }} + spec: + {{- with .Values.global.topologyConfig }} + {{- toYaml . | nindent 6 }} + {{- end }} + terminationGracePeriodSeconds: 10 + {{- with .Values.global.imagePullSecrets}} + imagePullSecrets: + {{- toYaml . | nindent 8}} + {{- end}} + containers: + - name: sortinghat + image: {{ .Values.appConfig.image }} + ports: + - containerPort: {{ .Values.service.targetPort }} + # v ---- Volume mount define ---- + {{- if .Values.dependencies.storage.enabled }} + volumeMounts: + {{- include "template.volumeMount" . | nindent 12 }} + {{- end }} + # ^ ---- Volume mount define ---- + # v ---- Resources define ---- + resources: + {{- include "template.resQuota" . | nindent 12 }} + # ^ ---- Resources define ---- + env: + {{- include "nativeEnv.sortinghatWorker" . | nindent 12 }} + {{- with .Values.extraEnvs }} + {{- toYaml . | nindent 12 }} + {{- end }} + # v ---- Volumes define ---- + {{- if .Values.dependencies.storage.enabled }} + volumes: + {{- range .Values.dependencies.storage.volumes }} + {{- include "template.volumes" (dict "item" . "root" $ ) | nindent 8 }} + {{- end }} + {{- end }} + # ^ ---- Volumes define ---- diff --git a/kubernetes/helm-chart/charts/sortinghat-worker/templates/pvc.yaml b/kubernetes/helm-chart/charts/sortinghat-worker/templates/pvc.yaml index babc5bee..0200c4fc 100644 --- a/kubernetes/helm-chart/charts/sortinghat-worker/templates/pvc.yaml +++ b/kubernetes/helm-chart/charts/sortinghat-worker/templates/pvc.yaml @@ -1,3 +1,3 @@ -{{- range .Values.dependencies.storage.volumes }} -{{- include "template.pvc" ( dict "item" . "root" $ ) }} -{{- end }} +{{- range .Values.dependencies.storage.volumes }} +{{- include "template.pvc" ( dict "item" . "root" $ ) }} +{{- end }} diff --git a/kubernetes/helm-chart/charts/sortinghat-worker/templates/service.yaml b/kubernetes/helm-chart/charts/sortinghat-worker/templates/service.yaml index 33ad470c..986464eb 100644 --- a/kubernetes/helm-chart/charts/sortinghat-worker/templates/service.yaml +++ b/kubernetes/helm-chart/charts/sortinghat-worker/templates/service.yaml @@ -1,11 +1,11 @@ -apiVersion: v1 -kind: Service -metadata: - name: "{{ .Values.appConfig.name }}" - labels: - app: "{{ .Values.appConfig.name }}" - {{- include "metadata.sortinghatWorker.service.labels" . | nindent 4 }} - annotations: - {{- include "metadata.sortinghatWorker.service.annotations" . | nindent 4 }} -spec: - {{- include "template.service" . | nindent 2 }} +apiVersion: v1 +kind: Service +metadata: + name: "{{ .Values.appConfig.name }}" + labels: + app: "{{ .Values.appConfig.name }}" + {{- include "metadata.sortinghatWorker.service.labels" . | nindent 4 }} + annotations: + {{- include "metadata.sortinghatWorker.service.annotations" . | nindent 4 }} +spec: + {{- include "template.service" . | nindent 2 }} diff --git a/kubernetes/helm-chart/charts/sortinghat-worker/values.yaml b/kubernetes/helm-chart/charts/sortinghat-worker/values.yaml index b391cbc2..51268e41 100644 --- a/kubernetes/helm-chart/charts/sortinghat-worker/values.yaml +++ b/kubernetes/helm-chart/charts/sortinghat-worker/values.yaml @@ -1,37 +1,37 @@ -global: - topologyConfig: {} - imagePullSecrets: [] - imageRegistry: "" - appName: "" - -install: true - -appConfig: - name: sortinghat-worker - replicas: 1 - image: docker.io/grimoirelab/sortinghat-worker:latest - pullPolicy: IfNotPresent - - labels: {} - annotations: {} - resources: - cpu: - limits: "" - requests: "" - memory: - limits: "" - requests: "" - -dependencies: - storage: - enabled: false - volumes: [] - -service: - labels: {} - annotations: {} - targetPort: 9314 - scheme: "http" - type: "" # Default to "ClusterIP" - -extraEnvs: [] +global: + topologyConfig: {} + imagePullSecrets: [] + imageRegistry: "" + appName: "" + +install: true + +appConfig: + name: sortinghat-worker + replicas: 1 + image: docker.io/grimoirelab/sortinghat-worker:latest + pullPolicy: IfNotPresent + + labels: {} + annotations: {} + resources: + cpu: + limits: "" + requests: "" + memory: + limits: "" + requests: "" + +dependencies: + storage: + enabled: false + volumes: [] + +service: + labels: {} + annotations: {} + targetPort: 9314 + scheme: "http" + type: "" # Default to "ClusterIP" + +extraEnvs: [] diff --git a/kubernetes/helm-chart/charts/sortinghat/Chart.yaml b/kubernetes/helm-chart/charts/sortinghat/Chart.yaml index 364f9a6a..cc15a87f 100644 --- a/kubernetes/helm-chart/charts/sortinghat/Chart.yaml +++ b/kubernetes/helm-chart/charts/sortinghat/Chart.yaml @@ -1,10 +1,10 @@ -apiVersion: v2 -name: sortinghat -description: Sortinghat service for GrimoireLab, a tool to manage identities. -home: https://github.com/chaoss/grimoirelab -icon: https://www.gravatar.com/avatar/4154acefea56ed23bddaaa47a4850400 -maintainers: -- name: Arie - url: https://github.com/Eroyi -appVersion: 1.7.0 #Based on the "Github Release" version (which is the docker image tag referring from), not the actual application version. -version: 1.0 +apiVersion: v2 +name: sortinghat +description: Sortinghat service for GrimoireLab, a tool to manage identities. +home: https://github.com/chaoss/grimoirelab +icon: https://www.gravatar.com/avatar/4154acefea56ed23bddaaa47a4850400 +maintainers: +- name: Arie + url: https://github.com/Eroyi +appVersion: 1.7.0 #Based on the "Github Release" version (which is the docker image tag referring from), not the actual application version. +version: 1.0 diff --git a/kubernetes/helm-chart/charts/sortinghat/templates/_helper.tpl b/kubernetes/helm-chart/charts/sortinghat/templates/_helper.tpl index b6cb2b6c..c314617c 100644 --- a/kubernetes/helm-chart/charts/sortinghat/templates/_helper.tpl +++ b/kubernetes/helm-chart/charts/sortinghat/templates/_helper.tpl @@ -1,36 +1,36 @@ -{{/* -Sortinghat labels -*/}} -{{- define "metadata.sortinghat.pod.labels" -}} -{{- range $name, $value := .Values.appConfig.labels }} -{{ $name }}: {{ $value | quote }} -{{- end -}} -{{- end -}} - -{{/* -Sortinghat annotations -*/}} -{{- define "metadata.sortinghat.pod.annotations" -}} -{{- range $name, $value := .Values.appConfig.annotations }} -{{ $name }}: {{ $value | quote }} -{{- end -}} -{{- end -}} - - -{{/* -Sortinghat Service labels -*/}} -{{- define "metadata.sortinghat.service.labels" -}} -{{- range $name, $value := .Values.service.labels }} -{{ $name }}: {{ $value | quote }} -{{- end -}} -{{- end -}} - -{{/* -Sortinghat Service annotations -*/}} -{{- define "metadata.sortinghat.service.annotations" -}} -{{- range $name, $value := .Values.service.annotations }} -{{ $name }}: {{ $value | quote }} -{{- end -}} -{{- end -}} +{{/* +Sortinghat labels +*/}} +{{- define "metadata.sortinghat.pod.labels" -}} +{{- range $name, $value := .Values.appConfig.labels }} +{{ $name }}: {{ $value | quote }} +{{- end -}} +{{- end -}} + +{{/* +Sortinghat annotations +*/}} +{{- define "metadata.sortinghat.pod.annotations" -}} +{{- range $name, $value := .Values.appConfig.annotations }} +{{ $name }}: {{ $value | quote }} +{{- end -}} +{{- end -}} + + +{{/* +Sortinghat Service labels +*/}} +{{- define "metadata.sortinghat.service.labels" -}} +{{- range $name, $value := .Values.service.labels }} +{{ $name }}: {{ $value | quote }} +{{- end -}} +{{- end -}} + +{{/* +Sortinghat Service annotations +*/}} +{{- define "metadata.sortinghat.service.annotations" -}} +{{- range $name, $value := .Values.service.annotations }} +{{ $name }}: {{ $value | quote }} +{{- end -}} +{{- end -}} diff --git a/kubernetes/helm-chart/charts/sortinghat/templates/deployment.yaml b/kubernetes/helm-chart/charts/sortinghat/templates/deployment.yaml index 1214a228..12cec2a9 100644 --- a/kubernetes/helm-chart/charts/sortinghat/templates/deployment.yaml +++ b/kubernetes/helm-chart/charts/sortinghat/templates/deployment.yaml @@ -1,59 +1,59 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: {{ .Values.appConfig.name }} - labels: - app: "{{ .Values.appConfig.name }}" - {{- include "metadata.sortinghat.pod.labels" . | nindent 4 }} - annotations: - {{- include "metadata.sortinghat.pod.annotations" . | nindent 4 }} - -spec: - replicas: {{ .Values.appConfig.replicas }} - selector: - matchLabels: - app: "{{ .Values.appConfig.name }}" - template: - metadata: - labels: - app: "{{ .Values.appConfig.name }}" - {{- include "metadata.sortinghat.pod.labels" . | nindent 8 }} - annotations: - {{- include "metadata.sortinghat.pod.annotations" . | nindent 8 }} - spec: - {{- with .Values.global.topologyConfig }} - {{- toYaml . | nindent 6 }} - {{- end }} - terminationGracePeriodSeconds: 10 - {{- with .Values.global.imagePullSecrets}} - imagePullSecrets: - {{- toYaml . | nindent 8}} - {{- end}} - containers: - - name: sortinghat - image: {{ .Values.appConfig.image }} - ports: - - containerPort: {{ .Values.service.targetPort }} - # v ---- Volume mount define ---- - {{- if .Values.dependencies.storage.enabled }} - volumeMounts: - {{- include "template.volumeMount" . | nindent 12 }} - {{- end }} - # ^ ---- Volume mount define ---- - # v ---- Resources define ---- - resources: - {{- include "template.resQuota" . | nindent 12 }} - # ^ ---- Resources define ---- - env: - {{- include "nativeEnv.sortinghat" . | nindent 12 }} - {{- with .Values.extraEnvs }} - {{- toYaml . | nindent 12 }} - {{- end }} - # v ---- Volumes define ---- - {{- if .Values.dependencies.storage.enabled }} - volumes: - {{- range .Values.dependencies.storage.volumes }} - {{- include "template.volumes" (dict "item" . "root" $ ) | nindent 8 }} - {{- end }} - {{- end }} - # ^ ---- Volumes define ---- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ .Values.appConfig.name }} + labels: + app: "{{ .Values.appConfig.name }}" + {{- include "metadata.sortinghat.pod.labels" . | nindent 4 }} + annotations: + {{- include "metadata.sortinghat.pod.annotations" . | nindent 4 }} + +spec: + replicas: {{ .Values.appConfig.replicas }} + selector: + matchLabels: + app: "{{ .Values.appConfig.name }}" + template: + metadata: + labels: + app: "{{ .Values.appConfig.name }}" + {{- include "metadata.sortinghat.pod.labels" . | nindent 8 }} + annotations: + {{- include "metadata.sortinghat.pod.annotations" . | nindent 8 }} + spec: + {{- with .Values.global.topologyConfig }} + {{- toYaml . | nindent 6 }} + {{- end }} + terminationGracePeriodSeconds: 10 + {{- with .Values.global.imagePullSecrets}} + imagePullSecrets: + {{- toYaml . | nindent 8}} + {{- end}} + containers: + - name: sortinghat + image: {{ .Values.appConfig.image }} + ports: + - containerPort: {{ .Values.service.targetPort }} + # v ---- Volume mount define ---- + {{- if .Values.dependencies.storage.enabled }} + volumeMounts: + {{- include "template.volumeMount" . | nindent 12 }} + {{- end }} + # ^ ---- Volume mount define ---- + # v ---- Resources define ---- + resources: + {{- include "template.resQuota" . | nindent 12 }} + # ^ ---- Resources define ---- + env: + {{- include "nativeEnv.sortinghat" . | nindent 12 }} + {{- with .Values.extraEnvs }} + {{- toYaml . | nindent 12 }} + {{- end }} + # v ---- Volumes define ---- + {{- if .Values.dependencies.storage.enabled }} + volumes: + {{- range .Values.dependencies.storage.volumes }} + {{- include "template.volumes" (dict "item" . "root" $ ) | nindent 8 }} + {{- end }} + {{- end }} + # ^ ---- Volumes define ---- diff --git a/kubernetes/helm-chart/charts/sortinghat/templates/pvc.yaml b/kubernetes/helm-chart/charts/sortinghat/templates/pvc.yaml index babc5bee..0200c4fc 100644 --- a/kubernetes/helm-chart/charts/sortinghat/templates/pvc.yaml +++ b/kubernetes/helm-chart/charts/sortinghat/templates/pvc.yaml @@ -1,3 +1,3 @@ -{{- range .Values.dependencies.storage.volumes }} -{{- include "template.pvc" ( dict "item" . "root" $ ) }} -{{- end }} +{{- range .Values.dependencies.storage.volumes }} +{{- include "template.pvc" ( dict "item" . "root" $ ) }} +{{- end }} diff --git a/kubernetes/helm-chart/charts/sortinghat/templates/service.yaml b/kubernetes/helm-chart/charts/sortinghat/templates/service.yaml index 2dda92ee..c680dd0f 100644 --- a/kubernetes/helm-chart/charts/sortinghat/templates/service.yaml +++ b/kubernetes/helm-chart/charts/sortinghat/templates/service.yaml @@ -1,11 +1,11 @@ -apiVersion: v1 -kind: Service -metadata: - name: "{{ .Values.appConfig.name }}" - labels: - app: "{{ .Values.appConfig.name }}" - {{- include "metadata.sortinghat.service.labels" . | nindent 4 }} - annotations: - {{- include "metadata.sortinghat.service.annotations" . | nindent 4 }} -spec: - {{- include "template.service" . | nindent 2 }} +apiVersion: v1 +kind: Service +metadata: + name: "{{ .Values.appConfig.name }}" + labels: + app: "{{ .Values.appConfig.name }}" + {{- include "metadata.sortinghat.service.labels" . | nindent 4 }} + annotations: + {{- include "metadata.sortinghat.service.annotations" . | nindent 4 }} +spec: + {{- include "template.service" . | nindent 2 }} diff --git a/kubernetes/helm-chart/charts/sortinghat/values.yaml b/kubernetes/helm-chart/charts/sortinghat/values.yaml index 3a4096c0..278ad819 100644 --- a/kubernetes/helm-chart/charts/sortinghat/values.yaml +++ b/kubernetes/helm-chart/charts/sortinghat/values.yaml @@ -1,41 +1,41 @@ -global: - topologyConfig: {} - imagePullSecrets: [] - imageRegistry: "" - appName: "" - -install: true - -appConfig: - name: "sortinghat" - replicas: 1 - image: docker.io/grimoirelab/sortinghat:latest - pullPolicy: IfNotPresent - labels: {} - annotations: {} - resources: - cpu: - limits: "" - requests: "" - memory: - limits: "" - requests: "" - -dependencies: - storage: - enabled: true - volumes: - - name: "sortinghat-static" - mountPath: "/opt/venv/lib/python3.9/site-packages/sortinghat/static" - type: pvc - storageClass: efs-sc - size: 1Gi - -service: - labels: {} - annotations: {} - targetPort: 9314 - scheme: "http" - type: "" # Default to "ClusterIP" - -extraEnvs: [] +global: + topologyConfig: {} + imagePullSecrets: [] + imageRegistry: "" + appName: "" + +install: true + +appConfig: + name: "sortinghat" + replicas: 1 + image: docker.io/grimoirelab/sortinghat:latest + pullPolicy: IfNotPresent + labels: {} + annotations: {} + resources: + cpu: + limits: "" + requests: "" + memory: + limits: "" + requests: "" + +dependencies: + storage: + enabled: true + volumes: + - name: "sortinghat-static" + mountPath: "/opt/venv/lib/python3.9/site-packages/sortinghat/static" + type: pvc + storageClass: efs-sc + size: 1Gi + +service: + labels: {} + annotations: {} + targetPort: 9314 + scheme: "http" + type: "" # Default to "ClusterIP" + +extraEnvs: [] diff --git a/kubernetes/helm-chart/templates/_credentials.tpl b/kubernetes/helm-chart/templates/_credentials.tpl index ac24affa..65030725 100644 --- a/kubernetes/helm-chart/templates/_credentials.tpl +++ b/kubernetes/helm-chart/templates/_credentials.tpl @@ -1,22 +1,22 @@ -{{/* -Define various credentials recources -*/}} -{{- define "cred.database.username" -}} - {{- $username := default "root" .Values.global.credentials.database.username -}} - {{- $username -}} -{{- end }} - -{{- define "cred.database.password" -}} - {{- $password := default "mar1adb4Grim0ir3Lab" .Values.global.credentials.database.password -}} - {{- $password -}} -{{- end }} - -{{- define "cred.opensearchNode.password" -}} - {{- $password := default "O54Grim0ir3Lab" .Values.global.credentials.opensearchNode.password -}} - {{- $password -}} -{{- end }} - -{{- define "cred.redis.password" -}} - {{- $password := default "red1s4Grim0ir3Lab" .Values.global.credentials.redis.password -}} - {{- $password -}} -{{- end }} +{{/* +Define various credentials recources +*/}} +{{- define "cred.database.username" -}} + {{- $username := default "root" .Values.global.credentials.database.username -}} + {{- $username -}} +{{- end }} + +{{- define "cred.database.password" -}} + {{- $password := default "mar1adb4Grim0ir3Lab" .Values.global.credentials.database.password -}} + {{- $password -}} +{{- end }} + +{{- define "cred.opensearchNode.password" -}} + {{- $password := default "O54Grim0ir3Lab" .Values.global.credentials.opensearchNode.password -}} + {{- $password -}} +{{- end }} + +{{- define "cred.redis.password" -}} + {{- $password := default "red1s4Grim0ir3Lab" .Values.global.credentials.redis.password -}} + {{- $password -}} +{{- end }} diff --git a/kubernetes/helm-chart/templates/_envs.tpl b/kubernetes/helm-chart/templates/_envs.tpl index 71cf245d..bfebb58d 100644 --- a/kubernetes/helm-chart/templates/_envs.tpl +++ b/kubernetes/helm-chart/templates/_envs.tpl @@ -1,40 +1,40 @@ -{{/* -Define various environment that referring from other values -*/}} -{{- define "nativeEnv.nginx" -}} -- name: KIBANA_HOST - value: "http://opensearch-dashboard:{{ include "port.opensearchDashboard" . }}/" -{{- end }} - -{{- define "nativeEnv.sortinghat" -}} -- name: SORTINGHAT_DB_USER - value: "{{ include "cred.database.username" . }}" -- name: SORTINGHAT_DB_PASSWORD - value: "{{ include "cred.database.password" . }}" -- name: SORTINGHAT_REDIS_PASSWORD - value: "{{ include "cred.redis.password" . }}" -- name: SORTINGHAT_CORS_ALLOWED_ORIGINS - value: "http://localhost:{{ include "port.nginxListen" . }},http://127.0.0.1:{{ include "port.nginxListen" . }},http://0.0.0.0:{{ include "port.nginxListen" . }}" -{{- end }} - -{{- define "nativeEnv.sortinghatWorker" -}} -- name: SORTINGHAT_DB_USER - value: "{{ include "cred.database.username" . }}" -- name: SORTINGHAT_DB_PASSWORD - value: "{{ include "cred.database.password" . }}" -- name: SORTINGHAT_REDIS_PASSWORD - value: "{{ include "cred.redis.password" . }}" -{{- end }} - -{{- define "nativeEnv.opensearchDashboard" -}} -- name: OPENSEARCH_HOSTS - value: "[\"https://opensearch-node:{{ include "port.opensearchNode" . }}\"]" -{{- end }} - -{{- define "nativeEnv.opensearchNode" -}} -- name: OPENSEARCH_INITIAL_ADMIN_PASSWORD - value: "{{ include "cred.opensearchNode.password" . }}" -{{- end }} - -{{- define "nativeEnv.mordred" }} -{{- end }} +{{/* +Define various environment that referring from other values +*/}} +{{- define "nativeEnv.nginx" -}} +- name: KIBANA_HOST + value: "http://opensearch-dashboard:{{ include "port.opensearchDashboard" . }}/" +{{- end }} + +{{- define "nativeEnv.sortinghat" -}} +- name: SORTINGHAT_DB_USER + value: "{{ include "cred.database.username" . }}" +- name: SORTINGHAT_DB_PASSWORD + value: "{{ include "cred.database.password" . }}" +- name: SORTINGHAT_REDIS_PASSWORD + value: "{{ include "cred.redis.password" . }}" +- name: SORTINGHAT_CORS_ALLOWED_ORIGINS + value: "http://localhost:{{ include "port.nginxListen" . }},http://127.0.0.1:{{ include "port.nginxListen" . }},http://0.0.0.0:{{ include "port.nginxListen" . }}" +{{- end }} + +{{- define "nativeEnv.sortinghatWorker" -}} +- name: SORTINGHAT_DB_USER + value: "{{ include "cred.database.username" . }}" +- name: SORTINGHAT_DB_PASSWORD + value: "{{ include "cred.database.password" . }}" +- name: SORTINGHAT_REDIS_PASSWORD + value: "{{ include "cred.redis.password" . }}" +{{- end }} + +{{- define "nativeEnv.opensearchDashboard" -}} +- name: OPENSEARCH_HOSTS + value: "[\"https://opensearch-node:{{ include "port.opensearchNode" . }}\"]" +{{- end }} + +{{- define "nativeEnv.opensearchNode" -}} +- name: OPENSEARCH_INITIAL_ADMIN_PASSWORD + value: "{{ include "cred.opensearchNode.password" . }}" +{{- end }} + +{{- define "nativeEnv.mordred" }} +{{- end }} diff --git a/kubernetes/helm-chart/templates/_ports.tpl b/kubernetes/helm-chart/templates/_ports.tpl index 24c88e01..803e6136 100644 --- a/kubernetes/helm-chart/templates/_ports.tpl +++ b/kubernetes/helm-chart/templates/_ports.tpl @@ -1,49 +1,49 @@ -{{/* -Port catalogs for all services - -{{- define "port.sortinghat" -}} -{{- printf .Values.sortinghat.service.targetPort | default "9314" }} -{{- end }} - -{{- define "port.sortinghatWorker" -}} -{{- printf .Values.sortinghatWorker.service.targetPort | default "9314" }} -{{- end }} - -{{- define "port.nginxListen" -}} -{{- printf .Values.nginx.service.targetPort | default "8000" }} -{{- end }} - -{{- define "port.opensearchNode" -}} -{{- printf .Values.opensearchNode.service.targetPort | default "9200" }} -{{- end }} - -{{- define "port.opensearchDashboard" -}} -{{- printf .Values.opensearchDashboard.service.targetPort | default "5601" }} -{{- end }} -*/}} - -{{- define "port.sortinghat" -}} - {{- $sortinghat := default 9314 -}} - {{- $sortinghat -}} -{{- end }} - -{{- define "port.sortinghatWorker" -}} - {{- $sortinghatWorker := default 9314 -}} - {{- $sortinghatWorker -}} -{{- end }} - -{{- define "port.nginxListen" -}} - {{- $nginxListen := default 8000 -}} - {{- $nginxListen -}} -{{- end }} - -{{- define "port.opensearchNode" -}} - {{- $opensearchNode := default 9200 -}} - {{- $opensearchNode -}} -{{- end }} - -{{- define "port.opensearchDashboard" -}} - {{- $opensearchDashboard := default 5601 -}} - {{- $opensearchDashboard -}} -{{- end }} - +{{/* +Port catalogs for all services + +{{- define "port.sortinghat" -}} +{{- printf .Values.sortinghat.service.targetPort | default "9314" }} +{{- end }} + +{{- define "port.sortinghatWorker" -}} +{{- printf .Values.sortinghatWorker.service.targetPort | default "9314" }} +{{- end }} + +{{- define "port.nginxListen" -}} +{{- printf .Values.nginx.service.targetPort | default "8000" }} +{{- end }} + +{{- define "port.opensearchNode" -}} +{{- printf .Values.opensearchNode.service.targetPort | default "9200" }} +{{- end }} + +{{- define "port.opensearchDashboard" -}} +{{- printf .Values.opensearchDashboard.service.targetPort | default "5601" }} +{{- end }} +*/}} + +{{- define "port.sortinghat" -}} + {{- $sortinghat := default 9314 -}} + {{- $sortinghat -}} +{{- end }} + +{{- define "port.sortinghatWorker" -}} + {{- $sortinghatWorker := default 9314 -}} + {{- $sortinghatWorker -}} +{{- end }} + +{{- define "port.nginxListen" -}} + {{- $nginxListen := default 8000 -}} + {{- $nginxListen -}} +{{- end }} + +{{- define "port.opensearchNode" -}} + {{- $opensearchNode := default 9200 -}} + {{- $opensearchNode -}} +{{- end }} + +{{- define "port.opensearchDashboard" -}} + {{- $opensearchDashboard := default 5601 -}} + {{- $opensearchDashboard -}} +{{- end }} + diff --git a/kubernetes/helm-chart/templates/_templates.tpl b/kubernetes/helm-chart/templates/_templates.tpl index 605652cb..f6dffd67 100644 --- a/kubernetes/helm-chart/templates/_templates.tpl +++ b/kubernetes/helm-chart/templates/_templates.tpl @@ -1,89 +1,89 @@ -{{/* -Common Helm chart templates abstract -*/}} - - -{{- define "template.volumeMount" -}} -{{- range .Values.dependencies.storage.volumes }} -- name: {{ .name }} - mountPath: {{ .mountPath }} - {{- if and (eq .type "configmap") (hasKey . "subPath") .subPath }} - subPath: {{ .subPath }} - {{- end }} -{{- end }} -{{- end }} - - -{{- define "template.volumes" -}} -- name: {{ .item.name }} - {{- if eq .item.type "pvc" }} - persistentVolumeClaim: - claimName: {{ .item.name }}-pvc - {{- else if eq .item.type "configmap" }} - configMap: - name: {{ .root.Release.Name }}-configmap - {{- if and (hasKey .item "configmapKey") (hasKey .item "asFile") }} - items: - - key: {{ .item.configmapKey }} - path: {{ .item.asFile }} - {{- end }} - {{- else if eq .item.type "secret" }} - secret: - secretName: {{ .item.name }}-secret - {{- else }} - emptyDir: - sizeLimit: 100Mi - {{- end }} -{{- end }} - - -{{- define "template.resQuota" -}} -limits: - cpu: {{ .Values.appConfig.resources.cpu.limits | quote }} - memory: {{ .Values.appConfig.resources.memory.limits | quote }} -requests: - cpu: {{ .Values.appConfig.resources.cpu.requests | quote }} - memory: {{ .Values.appConfig.resources.memory.requests | quote }} -{{- end }} - - -{{- define "template.pvc" -}} - {{- if and (eq .item.type "pvc") (hasKey .item "size" ) }} -apiVersion: v1 -kind: PersistentVolumeClaim -metadata: - name: {{ .item.name }}-pvc - labels: - app: "{{ .root.Release.Name }}" -spec: - storageClassName: "{{ .item.storageClass }}" - accessModes: - - ReadWriteMany - resources: - requests: - storage: {{ .item.size }} - {{- end }} -{{- end }} - - -{{- define "template.service" -}} -ports: - - protocol: TCP - name: "{{ .Values.appConfig.name }}-service" - {{- if eq .Values.service.scheme "http" }} - port: 80 - targetPort: {{ .Values.service.targetPort }} - {{- end }} - {{- if eq .Values.service.scheme "https" }} - port: 443 - targetPort: {{ .Values.service.targetPort }} - {{- end }} - {{- if eq .Values.service.scheme "passthrough" }} - port: {{ .Values.service.targetPort }} - targetPort: {{ .Values.service.targetPort }} - {{- end }} -type: {{ .Values.service.type | default "ClusterIP" | quote }} -sessionAffinity: None -selector: - app: "{{ .Values.appConfig.name }}" -{{- end }} +{{/* +Common Helm chart templates abstract +*/}} + + +{{- define "template.volumeMount" -}} +{{- range .Values.dependencies.storage.volumes }} +- name: {{ .name }} + mountPath: {{ .mountPath }} + {{- if and (eq .type "configmap") (hasKey . "subPath") .subPath }} + subPath: {{ .subPath }} + {{- end }} +{{- end }} +{{- end }} + + +{{- define "template.volumes" -}} +- name: {{ .item.name }} + {{- if eq .item.type "pvc" }} + persistentVolumeClaim: + claimName: {{ .item.name }}-pvc + {{- else if eq .item.type "configmap" }} + configMap: + name: {{ .root.Release.Name }}-configmap + {{- if and (hasKey .item "configmapKey") (hasKey .item "asFile") }} + items: + - key: {{ .item.configmapKey }} + path: {{ .item.asFile }} + {{- end }} + {{- else if eq .item.type "secret" }} + secret: + secretName: {{ .item.name }}-secret + {{- else }} + emptyDir: + sizeLimit: 100Mi + {{- end }} +{{- end }} + + +{{- define "template.resQuota" -}} +limits: + cpu: {{ .Values.appConfig.resources.cpu.limits | quote }} + memory: {{ .Values.appConfig.resources.memory.limits | quote }} +requests: + cpu: {{ .Values.appConfig.resources.cpu.requests | quote }} + memory: {{ .Values.appConfig.resources.memory.requests | quote }} +{{- end }} + + +{{- define "template.pvc" -}} + {{- if and (eq .item.type "pvc") (hasKey .item "size" ) }} +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: {{ .item.name }}-pvc + labels: + app: "{{ .root.Release.Name }}" +spec: + storageClassName: "{{ .item.storageClass }}" + accessModes: + - ReadWriteMany + resources: + requests: + storage: {{ .item.size }} + {{- end }} +{{- end }} + + +{{- define "template.service" -}} +ports: + - protocol: TCP + name: "{{ .Values.appConfig.name }}-service" + {{- if eq .Values.service.scheme "http" }} + port: 80 + targetPort: {{ .Values.service.targetPort }} + {{- end }} + {{- if eq .Values.service.scheme "https" }} + port: 443 + targetPort: {{ .Values.service.targetPort }} + {{- end }} + {{- if eq .Values.service.scheme "passthrough" }} + port: {{ .Values.service.targetPort }} + targetPort: {{ .Values.service.targetPort }} + {{- end }} +type: {{ .Values.service.type | default "ClusterIP" | quote }} +sessionAffinity: None +selector: + app: "{{ .Values.appConfig.name }}" +{{- end }} diff --git a/kubernetes/helm-chart/templates/configmap.yaml b/kubernetes/helm-chart/templates/configmap.yaml index 1892752b..b8b3b986 100644 --- a/kubernetes/helm-chart/templates/configmap.yaml +++ b/kubernetes/helm-chart/templates/configmap.yaml @@ -1,16 +1,16 @@ -kind: ConfigMap -apiVersion: v1 -metadata: - name: "{{ $.Release.Name }}-configmap" - labels: - app: "{{ $.Release.Name }}" - -data: - mordred-setup: |- - {{- include "config.mordredSetup" . | nindent 4 }} - mordred-projects: |- - {{- include "config.mordredProject" . | nindent 4 }} - uwsgi-params: |- - {{- include "config.uwsgiParams" . | nindent 4 }} - nginx-conf-template: |- - {{- include "config.nginxConf" . | nindent 4 }} +kind: ConfigMap +apiVersion: v1 +metadata: + name: "{{ $.Release.Name }}-configmap" + labels: + app: "{{ $.Release.Name }}" + +data: + mordred-setup: |- + {{- include "config.mordredSetup" . | nindent 4 }} + mordred-projects: |- + {{- include "config.mordredProject" . | nindent 4 }} + uwsgi-params: |- + {{- include "config.uwsgiParams" . | nindent 4 }} + nginx-conf-template: |- + {{- include "config.nginxConf" . | nindent 4 }} diff --git a/kubernetes/helm-chart/values.yaml b/kubernetes/helm-chart/values.yaml index 924a9eb9..4868fdfd 100644 --- a/kubernetes/helm-chart/values.yaml +++ b/kubernetes/helm-chart/values.yaml @@ -1,228 +1,228 @@ -global: - topologyConfig: {} - imagePullSecrets: [] - imageRegistry: "" - appName: grimoirelab - credentials: - database: - username: "root" - password: "mar1adb4Gr1m0ir3Lab" - opensearchNode: - password: "admin" - redis: - password: "grimoirelab" - -opensearch-node: - install: true - appConfig: - replicas: 1 - image: docker.io/opensearchproject/opensearch:2.11.1 - labels: {} - annotations: {} - resources: - cpu: - limits: "500m" - requests: "300m" - memory: - limits: "3000Mi" - requests: "2000Mi" - dependencies: - storage: - enabled: true - volumes: - - name: "opensearch-data" - mountPath: "/usr/share/opensearch/data" - type: pvc - storageClass: efs-sc - size: 10Gi - service: - targetPort: 9200 - scheme: passthrough - type: "" - extraEnvs: - - name: cluster.name - value: "opensearch-cluster" - - name: node.name - value: "opensearch-node1" - - name: discovery.type - value: "single-node" - - name: bootstrap.memory_lock - value: "true" - - name: OPENSEARCH_JAVA_OPTS - value: "-Xms2g -Xmx2g" - -opensearch-dashboard: - install: true - appConfig: - replicas: 1 - image: docker.io/opensearchproject/opensearch-dashboards:2.11.1 - labels: {} - annotations: {} - resources: - cpu: - limits: "200m" - requests: "100m" - memory: - limits: "512Mi" - requests: "256Mi" - dependencies: - storage: - enabled: false - service: - targetPort: 5601 - scheme: passthrough - type: "" - extraEnvs: [] - -mordred: - install: true - appConfig: - replicas: 1 - image: docker.io/grimoirelab/grimoirelab:1.7.0 - labels: {} - annotations: {} - resources: - cpu: - limits: "200m" - requests: "100m" - memory: - limits: "512Mi" - requests: "256Mi" - dependencies: - storage: - enabled: true - volumes: - - name: "mordred-setup" - mountPath: "/home/grimoire/conf/setup.cfg" - type: configmap - subPath: "mordred-setup" - - name: "mordred-projects" - mountPath: "/home/grimoire/conf/projects.json" - type: configmap - subPath: "mordred-projects" - - name: "mordred-log" - mountPath: "/home/grimoire/logs" - type: emptyDir - service: - targetPort: 8000 - scheme: passthrough - type: "" - extraEnvs: [] - -nginx: - install: true - appConfig: - replicas: 1 - image: docker.io/nginx:1.27.2 - labels: {} - annotations: {} - resources: - cpu: - limits: "50m" - requests: "20m" - memory: - limits: "128Mi" - requests: "64Mi" - dependencies: - storage: - enabled: true - volumes: - - name: "nginx-conf-template" - mountPath: "/etc/nginx/templates/default.conf.template" - type: configmap - subPath: "nginx-conf-template" - - name: "uwsgi-params" - mountPath: "/etc/nginx/uwsgi_params" - type: configmap - subPath: "uwsgi-params" - - name: "sortinghat-static" - mountPath: "/sortinghat" - type: pvc - service: - targetPort: 8000 - scheme: passthrough - type: "" - extraEnvs: [] - -sortinghat: - install: true - appConfig: - replicas: 1 - image: docker.io/grimoirelab/sortinghat:1.7.0 - labels: {} - annotations: {} - resources: - cpu: - limits: "50m" - requests: "20m" - memory: - limits: "512Mi" - requests: "256Mi" - dependencies: - storage: - enabled: true - volumes: - - name: "sortinghat-static" - mountPath: "/opt/venv/lib/python3.9/site-packages/sortinghat/static" - type: pvc - storageClass: efs-sc - size: 1Gi - service: - targetPort: 9314 - scheme: passthrough - type: "" - extraEnvs: - - name: SORTINGHAT_SECRET_KEY - value: "secret" - - name: SORTINGHAT_DB_HOST - value: "mariadb" - - name: SORTINGHAT_DB_PORT - value: "3306" - - name: SORTINGHAT_DB_DATABASE - value: "sortinghat_db" - - name: SORTINGHAT_REDIS_HOST - value: "redis-master" - - name: SORTINGHAT_SUPERUSER_USERNAME - value: "root" - - name: SORTINGHAT_SUPERUSER_PASSWORD - value: "root" - - name: SORTINGHAT_ALLOWED_HOST - value: "sortinghat,nginx,localhost,127.0.0.1,0.0.0.0,[::1]" - -sortinghat-worker: - install: true - appConfig: - replicas: 1 - image: docker.io/grimoirelab/sortinghat-worker:1.7.0 - labels: {} - annotations: {} - resources: - cpu: - limits: "1000m" - requests: "50m" - memory: - limits: "256Mi" - requests: "128Mi" - dependencies: - storage: - enabled: false - service: - scheme: passthrough - type: "" - extraEnvs: - - name: SORTINGHAT_SECRET_KEY - value: "secret" - - name: SORTINGHAT_DB_HOST - value: "mariadb" - - name: SORTINGHAT_DB_PORT - value: "3306" - - name: SORTINGHAT_DB_DATABASE - value: "sortinghat_db" - - name: SORTINGHAT_REDIS_HOST - value: "redis-master" - -mariadb: - install: false - -redis: - install: false +global: + topologyConfig: {} + imagePullSecrets: [] + imageRegistry: "" + appName: grimoirelab + credentials: + database: + username: "root" + password: "mar1adb4Gr1m0ir3Lab" + opensearchNode: + password: "admin" + redis: + password: "grimoirelab" + +opensearch-node: + install: true + appConfig: + replicas: 1 + image: docker.io/opensearchproject/opensearch:2.11.1 + labels: {} + annotations: {} + resources: + cpu: + limits: "500m" + requests: "300m" + memory: + limits: "3000Mi" + requests: "2000Mi" + dependencies: + storage: + enabled: true + volumes: + - name: "opensearch-data" + mountPath: "/usr/share/opensearch/data" + type: pvc + storageClass: efs-sc + size: 10Gi + service: + targetPort: 9200 + scheme: passthrough + type: "" + extraEnvs: + - name: cluster.name + value: "opensearch-cluster" + - name: node.name + value: "opensearch-node1" + - name: discovery.type + value: "single-node" + - name: bootstrap.memory_lock + value: "true" + - name: OPENSEARCH_JAVA_OPTS + value: "-Xms2g -Xmx2g" + +opensearch-dashboard: + install: true + appConfig: + replicas: 1 + image: docker.io/opensearchproject/opensearch-dashboards:2.11.1 + labels: {} + annotations: {} + resources: + cpu: + limits: "200m" + requests: "100m" + memory: + limits: "512Mi" + requests: "256Mi" + dependencies: + storage: + enabled: false + service: + targetPort: 5601 + scheme: passthrough + type: "" + extraEnvs: [] + +mordred: + install: true + appConfig: + replicas: 1 + image: docker.io/grimoirelab/grimoirelab:1.7.0 + labels: {} + annotations: {} + resources: + cpu: + limits: "200m" + requests: "100m" + memory: + limits: "512Mi" + requests: "256Mi" + dependencies: + storage: + enabled: true + volumes: + - name: "mordred-setup" + mountPath: "/home/grimoire/conf/setup.cfg" + type: configmap + subPath: "mordred-setup" + - name: "mordred-projects" + mountPath: "/home/grimoire/conf/projects.json" + type: configmap + subPath: "mordred-projects" + - name: "mordred-log" + mountPath: "/home/grimoire/logs" + type: emptyDir + service: + targetPort: 8000 + scheme: passthrough + type: "" + extraEnvs: [] + +nginx: + install: true + appConfig: + replicas: 1 + image: docker.io/nginx:1.27.2 + labels: {} + annotations: {} + resources: + cpu: + limits: "50m" + requests: "20m" + memory: + limits: "128Mi" + requests: "64Mi" + dependencies: + storage: + enabled: true + volumes: + - name: "nginx-conf-template" + mountPath: "/etc/nginx/templates/default.conf.template" + type: configmap + subPath: "nginx-conf-template" + - name: "uwsgi-params" + mountPath: "/etc/nginx/uwsgi_params" + type: configmap + subPath: "uwsgi-params" + - name: "sortinghat-static" + mountPath: "/sortinghat" + type: pvc + service: + targetPort: 8000 + scheme: passthrough + type: "" + extraEnvs: [] + +sortinghat: + install: true + appConfig: + replicas: 1 + image: docker.io/grimoirelab/sortinghat:1.7.0 + labels: {} + annotations: {} + resources: + cpu: + limits: "50m" + requests: "20m" + memory: + limits: "512Mi" + requests: "256Mi" + dependencies: + storage: + enabled: true + volumes: + - name: "sortinghat-static" + mountPath: "/opt/venv/lib/python3.9/site-packages/sortinghat/static" + type: pvc + storageClass: efs-sc + size: 1Gi + service: + targetPort: 9314 + scheme: passthrough + type: "" + extraEnvs: + - name: SORTINGHAT_SECRET_KEY + value: "secret" + - name: SORTINGHAT_DB_HOST + value: "mariadb" + - name: SORTINGHAT_DB_PORT + value: "3306" + - name: SORTINGHAT_DB_DATABASE + value: "sortinghat_db" + - name: SORTINGHAT_REDIS_HOST + value: "redis-master" + - name: SORTINGHAT_SUPERUSER_USERNAME + value: "root" + - name: SORTINGHAT_SUPERUSER_PASSWORD + value: "root" + - name: SORTINGHAT_ALLOWED_HOST + value: "sortinghat,nginx,localhost,127.0.0.1,0.0.0.0,[::1]" + +sortinghat-worker: + install: true + appConfig: + replicas: 1 + image: docker.io/grimoirelab/sortinghat-worker:1.7.0 + labels: {} + annotations: {} + resources: + cpu: + limits: "1000m" + requests: "50m" + memory: + limits: "256Mi" + requests: "128Mi" + dependencies: + storage: + enabled: false + service: + scheme: passthrough + type: "" + extraEnvs: + - name: SORTINGHAT_SECRET_KEY + value: "secret" + - name: SORTINGHAT_DB_HOST + value: "mariadb" + - name: SORTINGHAT_DB_PORT + value: "3306" + - name: SORTINGHAT_DB_DATABASE + value: "sortinghat_db" + - name: SORTINGHAT_REDIS_HOST + value: "redis-master" + +mariadb: + install: false + +redis: + install: false From 8f980493a4521763f56eb2428552e34eaf3c0abd Mon Sep 17 00:00:00 2001 From: root <44765750+Eroyi@users.noreply.github.com> Date: Thu, 7 Nov 2024 18:27:31 +0800 Subject: [PATCH 14/16] add newline for every file Signed-off-by: root <44765750+Eroyi@users.noreply.github.com> --- kubernetes/helm-chart/Chart.yaml | 1 + kubernetes/helm-chart/NOTES.txt | 3 ++- kubernetes/helm-chart/README.md | 1 + kubernetes/helm-chart/charts/mordred/Chart.yaml | 1 + kubernetes/helm-chart/charts/mordred/templates/_helper.tpl | 1 + .../helm-chart/charts/mordred/templates/_mordred_config.tpl | 1 + .../helm-chart/charts/mordred/templates/_mordred_projects.tpl | 1 + kubernetes/helm-chart/charts/mordred/templates/deployment.yaml | 1 + kubernetes/helm-chart/charts/mordred/templates/pvc.yaml | 1 + kubernetes/helm-chart/charts/mordred/templates/service.yaml | 1 + kubernetes/helm-chart/charts/mordred/values.yaml | 1 + kubernetes/helm-chart/charts/nginx/Chart.yaml | 1 + kubernetes/helm-chart/charts/nginx/templates/_helper.tpl | 1 + kubernetes/helm-chart/charts/nginx/templates/_nginx-config.tpl | 1 + kubernetes/helm-chart/charts/nginx/templates/deployment.yaml | 1 + kubernetes/helm-chart/charts/nginx/templates/pvc.yaml | 1 + kubernetes/helm-chart/charts/nginx/templates/service.yaml | 1 + kubernetes/helm-chart/charts/nginx/values.yaml | 1 + kubernetes/helm-chart/charts/opensearch-dashboard/Chart.yaml | 1 + .../charts/opensearch-dashboard/templates/_helper.tpl | 1 + .../charts/opensearch-dashboard/templates/deployment.yaml | 1 + .../helm-chart/charts/opensearch-dashboard/templates/pvc.yaml | 1 + .../charts/opensearch-dashboard/templates/service.yaml | 1 + kubernetes/helm-chart/charts/opensearch-dashboard/values.yaml | 1 + kubernetes/helm-chart/charts/opensearch-node/Chart.yaml | 1 + .../helm-chart/charts/opensearch-node/templates/_helper.tpl | 1 + .../charts/opensearch-node/templates/deployment.yaml | 1 + .../helm-chart/charts/opensearch-node/templates/pvc.yaml | 1 + .../helm-chart/charts/opensearch-node/templates/service.yaml | 1 + kubernetes/helm-chart/charts/opensearch-node/values.yaml | 1 + kubernetes/helm-chart/charts/sortinghat-worker/Chart.yaml | 1 + .../helm-chart/charts/sortinghat-worker/templates/_helper.tpl | 1 + .../charts/sortinghat-worker/templates/deployment.yaml | 1 + .../helm-chart/charts/sortinghat-worker/templates/pvc.yaml | 1 + .../helm-chart/charts/sortinghat-worker/templates/service.yaml | 1 + kubernetes/helm-chart/charts/sortinghat-worker/values.yaml | 1 + kubernetes/helm-chart/charts/sortinghat/Chart.yaml | 1 + kubernetes/helm-chart/charts/sortinghat/templates/_helper.tpl | 1 + .../helm-chart/charts/sortinghat/templates/deployment.yaml | 1 + kubernetes/helm-chart/charts/sortinghat/templates/pvc.yaml | 1 + kubernetes/helm-chart/charts/sortinghat/templates/service.yaml | 1 + kubernetes/helm-chart/charts/sortinghat/values.yaml | 1 + kubernetes/helm-chart/templates/_credentials.tpl | 1 + kubernetes/helm-chart/templates/_envs.tpl | 1 + kubernetes/helm-chart/templates/_templates.tpl | 1 + kubernetes/helm-chart/templates/configmap.yaml | 1 + kubernetes/helm-chart/values.yaml | 1 + 47 files changed, 48 insertions(+), 1 deletion(-) diff --git a/kubernetes/helm-chart/Chart.yaml b/kubernetes/helm-chart/Chart.yaml index a0629972..a0b7b8c8 100644 --- a/kubernetes/helm-chart/Chart.yaml +++ b/kubernetes/helm-chart/Chart.yaml @@ -40,3 +40,4 @@ dependencies: # - name: redis # version: 20.2.1 # condition: redis.install + diff --git a/kubernetes/helm-chart/NOTES.txt b/kubernetes/helm-chart/NOTES.txt index e5902811..05bd1ffe 100644 --- a/kubernetes/helm-chart/NOTES.txt +++ b/kubernetes/helm-chart/NOTES.txt @@ -9,4 +9,5 @@ To visualise data, you need to import dashboards into opensearch-dashboard. 5. Click "Menu" on the top left corner, then go to "Management" - "Dashboard Management" 6. [If its the first install] Click "Index patterns" on the left to create the index patterns. 7. Click "Saved objects" on the left to import "ndjson" dashboard file you downloaded. - 8. Drag or browser the dashboard file, select, then click "Import" - "Done" to import the dashboard. \ No newline at end of file + 8. Drag or browser the dashboard file, select, then click "Import" - "Done" to import the dashboard. + diff --git a/kubernetes/helm-chart/README.md b/kubernetes/helm-chart/README.md index 120e960f..a7999029 100644 --- a/kubernetes/helm-chart/README.md +++ b/kubernetes/helm-chart/README.md @@ -166,3 +166,4 @@ You can put an extra environments list in here to inject into the container. - name: foo value: "bar" ``` + diff --git a/kubernetes/helm-chart/charts/mordred/Chart.yaml b/kubernetes/helm-chart/charts/mordred/Chart.yaml index f1d92d4b..d8650cc9 100644 --- a/kubernetes/helm-chart/charts/mordred/Chart.yaml +++ b/kubernetes/helm-chart/charts/mordred/Chart.yaml @@ -8,3 +8,4 @@ maintainers: url: https://github.com/Eroyi appVersion: 1.7.0 #Based on the "Github Release" version (which is the docker image tag referring from), not the actual application version. version: 1.0 + diff --git a/kubernetes/helm-chart/charts/mordred/templates/_helper.tpl b/kubernetes/helm-chart/charts/mordred/templates/_helper.tpl index df1ed75b..6da95b03 100644 --- a/kubernetes/helm-chart/charts/mordred/templates/_helper.tpl +++ b/kubernetes/helm-chart/charts/mordred/templates/_helper.tpl @@ -34,3 +34,4 @@ Mordred Service annotations {{ $name }}: {{ $value | quote }} {{- end -}} {{- end -}} + diff --git a/kubernetes/helm-chart/charts/mordred/templates/_mordred_config.tpl b/kubernetes/helm-chart/charts/mordred/templates/_mordred_config.tpl index d7918fe2..55e64bac 100644 --- a/kubernetes/helm-chart/charts/mordred/templates/_mordred_config.tpl +++ b/kubernetes/helm-chart/charts/mordred/templates/_mordred_config.tpl @@ -154,3 +154,4 @@ in_index = git out_index = git-onion_demo_enriched contribs_field = hash {{- end }} + diff --git a/kubernetes/helm-chart/charts/mordred/templates/_mordred_projects.tpl b/kubernetes/helm-chart/charts/mordred/templates/_mordred_projects.tpl index b801a178..4d0406e9 100644 --- a/kubernetes/helm-chart/charts/mordred/templates/_mordred_projects.tpl +++ b/kubernetes/helm-chart/charts/mordred/templates/_mordred_projects.tpl @@ -13,3 +13,4 @@ } } {{- end }} + diff --git a/kubernetes/helm-chart/charts/mordred/templates/deployment.yaml b/kubernetes/helm-chart/charts/mordred/templates/deployment.yaml index 755e5047..dc31e4b2 100644 --- a/kubernetes/helm-chart/charts/mordred/templates/deployment.yaml +++ b/kubernetes/helm-chart/charts/mordred/templates/deployment.yaml @@ -57,3 +57,4 @@ spec: {{- end }} {{- end }} # ^ ---- Volumes define ---- + diff --git a/kubernetes/helm-chart/charts/mordred/templates/pvc.yaml b/kubernetes/helm-chart/charts/mordred/templates/pvc.yaml index 0200c4fc..a88c8d9d 100644 --- a/kubernetes/helm-chart/charts/mordred/templates/pvc.yaml +++ b/kubernetes/helm-chart/charts/mordred/templates/pvc.yaml @@ -1,3 +1,4 @@ {{- range .Values.dependencies.storage.volumes }} {{- include "template.pvc" ( dict "item" . "root" $ ) }} {{- end }} + diff --git a/kubernetes/helm-chart/charts/mordred/templates/service.yaml b/kubernetes/helm-chart/charts/mordred/templates/service.yaml index 87961cf6..f288452c 100644 --- a/kubernetes/helm-chart/charts/mordred/templates/service.yaml +++ b/kubernetes/helm-chart/charts/mordred/templates/service.yaml @@ -9,3 +9,4 @@ metadata: {{- include "metadata.mordred.service.annotations" . | nindent 4 }} spec: {{- include "template.service" . | nindent 2 }} + diff --git a/kubernetes/helm-chart/charts/mordred/values.yaml b/kubernetes/helm-chart/charts/mordred/values.yaml index 29ddce2c..4149033d 100644 --- a/kubernetes/helm-chart/charts/mordred/values.yaml +++ b/kubernetes/helm-chart/charts/mordred/values.yaml @@ -34,3 +34,4 @@ service: type: "" # Default to "ClusterIP" extraEnvs: [] + diff --git a/kubernetes/helm-chart/charts/nginx/Chart.yaml b/kubernetes/helm-chart/charts/nginx/Chart.yaml index 362303ea..a3bd6ac8 100644 --- a/kubernetes/helm-chart/charts/nginx/Chart.yaml +++ b/kubernetes/helm-chart/charts/nginx/Chart.yaml @@ -8,3 +8,4 @@ maintainers: url: https://github.com/Eroyi appVersion: 1.27.2 version: 1.0 + diff --git a/kubernetes/helm-chart/charts/nginx/templates/_helper.tpl b/kubernetes/helm-chart/charts/nginx/templates/_helper.tpl index 6c5c164b..3001022a 100644 --- a/kubernetes/helm-chart/charts/nginx/templates/_helper.tpl +++ b/kubernetes/helm-chart/charts/nginx/templates/_helper.tpl @@ -34,3 +34,4 @@ Mordred Service annotations {{ $name }}: {{ $value | quote }} {{- end -}} {{- end -}} + diff --git a/kubernetes/helm-chart/charts/nginx/templates/_nginx-config.tpl b/kubernetes/helm-chart/charts/nginx/templates/_nginx-config.tpl index 72026789..14a8fbbf 100644 --- a/kubernetes/helm-chart/charts/nginx/templates/_nginx-config.tpl +++ b/kubernetes/helm-chart/charts/nginx/templates/_nginx-config.tpl @@ -59,3 +59,4 @@ server { } } {{- end }} + diff --git a/kubernetes/helm-chart/charts/nginx/templates/deployment.yaml b/kubernetes/helm-chart/charts/nginx/templates/deployment.yaml index b3c81c92..84c8be9e 100644 --- a/kubernetes/helm-chart/charts/nginx/templates/deployment.yaml +++ b/kubernetes/helm-chart/charts/nginx/templates/deployment.yaml @@ -57,3 +57,4 @@ spec: {{- end }} {{- end }} # ^ ---- Volumes define ---- + diff --git a/kubernetes/helm-chart/charts/nginx/templates/pvc.yaml b/kubernetes/helm-chart/charts/nginx/templates/pvc.yaml index 0200c4fc..a88c8d9d 100644 --- a/kubernetes/helm-chart/charts/nginx/templates/pvc.yaml +++ b/kubernetes/helm-chart/charts/nginx/templates/pvc.yaml @@ -1,3 +1,4 @@ {{- range .Values.dependencies.storage.volumes }} {{- include "template.pvc" ( dict "item" . "root" $ ) }} {{- end }} + diff --git a/kubernetes/helm-chart/charts/nginx/templates/service.yaml b/kubernetes/helm-chart/charts/nginx/templates/service.yaml index d0fd98fa..34af8ad5 100644 --- a/kubernetes/helm-chart/charts/nginx/templates/service.yaml +++ b/kubernetes/helm-chart/charts/nginx/templates/service.yaml @@ -9,3 +9,4 @@ metadata: {{- include "metadata.nginx.service.annotations" . | nindent 4 }} spec: {{- include "template.service" . | nindent 2 }} + diff --git a/kubernetes/helm-chart/charts/nginx/values.yaml b/kubernetes/helm-chart/charts/nginx/values.yaml index d5495290..395827a2 100644 --- a/kubernetes/helm-chart/charts/nginx/values.yaml +++ b/kubernetes/helm-chart/charts/nginx/values.yaml @@ -45,3 +45,4 @@ service: type: "" # Default to "ClusterIP" extraEnvs: [] + diff --git a/kubernetes/helm-chart/charts/opensearch-dashboard/Chart.yaml b/kubernetes/helm-chart/charts/opensearch-dashboard/Chart.yaml index 67759a03..f445eddd 100644 --- a/kubernetes/helm-chart/charts/opensearch-dashboard/Chart.yaml +++ b/kubernetes/helm-chart/charts/opensearch-dashboard/Chart.yaml @@ -8,3 +8,4 @@ maintainers: url: https://github.com/Eroyi appVersion: 2.11.1 version: 1.0 + diff --git a/kubernetes/helm-chart/charts/opensearch-dashboard/templates/_helper.tpl b/kubernetes/helm-chart/charts/opensearch-dashboard/templates/_helper.tpl index 65e08015..1d177dbb 100644 --- a/kubernetes/helm-chart/charts/opensearch-dashboard/templates/_helper.tpl +++ b/kubernetes/helm-chart/charts/opensearch-dashboard/templates/_helper.tpl @@ -34,3 +34,4 @@ Opensearch Dashboard Service annotations {{ $name }}: {{ $value | quote }} {{- end -}} {{- end -}} + diff --git a/kubernetes/helm-chart/charts/opensearch-dashboard/templates/deployment.yaml b/kubernetes/helm-chart/charts/opensearch-dashboard/templates/deployment.yaml index 257c441c..05f89cfc 100644 --- a/kubernetes/helm-chart/charts/opensearch-dashboard/templates/deployment.yaml +++ b/kubernetes/helm-chart/charts/opensearch-dashboard/templates/deployment.yaml @@ -57,3 +57,4 @@ spec: {{- end }} {{- end }} # ^ ---- Volumes define ---- + diff --git a/kubernetes/helm-chart/charts/opensearch-dashboard/templates/pvc.yaml b/kubernetes/helm-chart/charts/opensearch-dashboard/templates/pvc.yaml index 0200c4fc..a88c8d9d 100644 --- a/kubernetes/helm-chart/charts/opensearch-dashboard/templates/pvc.yaml +++ b/kubernetes/helm-chart/charts/opensearch-dashboard/templates/pvc.yaml @@ -1,3 +1,4 @@ {{- range .Values.dependencies.storage.volumes }} {{- include "template.pvc" ( dict "item" . "root" $ ) }} {{- end }} + diff --git a/kubernetes/helm-chart/charts/opensearch-dashboard/templates/service.yaml b/kubernetes/helm-chart/charts/opensearch-dashboard/templates/service.yaml index e76e2877..28f66dba 100644 --- a/kubernetes/helm-chart/charts/opensearch-dashboard/templates/service.yaml +++ b/kubernetes/helm-chart/charts/opensearch-dashboard/templates/service.yaml @@ -9,3 +9,4 @@ metadata: {{- include "metadata.opensearchDashboard.service.annotations" . | nindent 4 }} spec: {{- include "template.service" . | nindent 2 }} + diff --git a/kubernetes/helm-chart/charts/opensearch-dashboard/values.yaml b/kubernetes/helm-chart/charts/opensearch-dashboard/values.yaml index 5bacc887..a79983f3 100644 --- a/kubernetes/helm-chart/charts/opensearch-dashboard/values.yaml +++ b/kubernetes/helm-chart/charts/opensearch-dashboard/values.yaml @@ -35,3 +35,4 @@ service: type: "" # Default to "ClusterIP" extraEnvs: [] + diff --git a/kubernetes/helm-chart/charts/opensearch-node/Chart.yaml b/kubernetes/helm-chart/charts/opensearch-node/Chart.yaml index 040ed54c..143e919c 100644 --- a/kubernetes/helm-chart/charts/opensearch-node/Chart.yaml +++ b/kubernetes/helm-chart/charts/opensearch-node/Chart.yaml @@ -8,3 +8,4 @@ maintainers: url: https://github.com/Eroyi appVersion: 2.11.1 version: 1.0 + diff --git a/kubernetes/helm-chart/charts/opensearch-node/templates/_helper.tpl b/kubernetes/helm-chart/charts/opensearch-node/templates/_helper.tpl index 95a0dc33..cc0cbaa3 100644 --- a/kubernetes/helm-chart/charts/opensearch-node/templates/_helper.tpl +++ b/kubernetes/helm-chart/charts/opensearch-node/templates/_helper.tpl @@ -34,3 +34,4 @@ Opensearch Service annotations {{ $name }}: {{ $value | quote }} {{- end -}} {{- end -}} + diff --git a/kubernetes/helm-chart/charts/opensearch-node/templates/deployment.yaml b/kubernetes/helm-chart/charts/opensearch-node/templates/deployment.yaml index 65698fa4..4f91b862 100644 --- a/kubernetes/helm-chart/charts/opensearch-node/templates/deployment.yaml +++ b/kubernetes/helm-chart/charts/opensearch-node/templates/deployment.yaml @@ -62,3 +62,4 @@ spec: {{- end }} {{- end }} # ^ ---- Volumes define ---- + diff --git a/kubernetes/helm-chart/charts/opensearch-node/templates/pvc.yaml b/kubernetes/helm-chart/charts/opensearch-node/templates/pvc.yaml index 0200c4fc..a88c8d9d 100644 --- a/kubernetes/helm-chart/charts/opensearch-node/templates/pvc.yaml +++ b/kubernetes/helm-chart/charts/opensearch-node/templates/pvc.yaml @@ -1,3 +1,4 @@ {{- range .Values.dependencies.storage.volumes }} {{- include "template.pvc" ( dict "item" . "root" $ ) }} {{- end }} + diff --git a/kubernetes/helm-chart/charts/opensearch-node/templates/service.yaml b/kubernetes/helm-chart/charts/opensearch-node/templates/service.yaml index b93c22b3..f4a67bb5 100644 --- a/kubernetes/helm-chart/charts/opensearch-node/templates/service.yaml +++ b/kubernetes/helm-chart/charts/opensearch-node/templates/service.yaml @@ -9,3 +9,4 @@ metadata: {{- include "metadata.opensearchNode.service.annotations" . | nindent 4 }} spec: {{- include "template.service" . | nindent 2 }} + diff --git a/kubernetes/helm-chart/charts/opensearch-node/values.yaml b/kubernetes/helm-chart/charts/opensearch-node/values.yaml index 38b5f9aa..80efb836 100644 --- a/kubernetes/helm-chart/charts/opensearch-node/values.yaml +++ b/kubernetes/helm-chart/charts/opensearch-node/values.yaml @@ -43,3 +43,4 @@ service: type: "" # Default to "ClusterIP" extraEnvs: [] + diff --git a/kubernetes/helm-chart/charts/sortinghat-worker/Chart.yaml b/kubernetes/helm-chart/charts/sortinghat-worker/Chart.yaml index 95578ab5..0b6d4ac4 100644 --- a/kubernetes/helm-chart/charts/sortinghat-worker/Chart.yaml +++ b/kubernetes/helm-chart/charts/sortinghat-worker/Chart.yaml @@ -8,3 +8,4 @@ maintainers: url: https://github.com/Eroyi appVersion: 1.7.0 #Based on the "Github Release" version (which is the docker image tag referring from), not the actual application version. version: 1.0 + diff --git a/kubernetes/helm-chart/charts/sortinghat-worker/templates/_helper.tpl b/kubernetes/helm-chart/charts/sortinghat-worker/templates/_helper.tpl index 083a66a1..82433a06 100644 --- a/kubernetes/helm-chart/charts/sortinghat-worker/templates/_helper.tpl +++ b/kubernetes/helm-chart/charts/sortinghat-worker/templates/_helper.tpl @@ -34,3 +34,4 @@ Sortinghat Service annotations {{ $name }}: {{ $value | quote }} {{- end -}} {{- end -}} + diff --git a/kubernetes/helm-chart/charts/sortinghat-worker/templates/deployment.yaml b/kubernetes/helm-chart/charts/sortinghat-worker/templates/deployment.yaml index dddb8349..3da001f6 100644 --- a/kubernetes/helm-chart/charts/sortinghat-worker/templates/deployment.yaml +++ b/kubernetes/helm-chart/charts/sortinghat-worker/templates/deployment.yaml @@ -57,3 +57,4 @@ spec: {{- end }} {{- end }} # ^ ---- Volumes define ---- + diff --git a/kubernetes/helm-chart/charts/sortinghat-worker/templates/pvc.yaml b/kubernetes/helm-chart/charts/sortinghat-worker/templates/pvc.yaml index 0200c4fc..a88c8d9d 100644 --- a/kubernetes/helm-chart/charts/sortinghat-worker/templates/pvc.yaml +++ b/kubernetes/helm-chart/charts/sortinghat-worker/templates/pvc.yaml @@ -1,3 +1,4 @@ {{- range .Values.dependencies.storage.volumes }} {{- include "template.pvc" ( dict "item" . "root" $ ) }} {{- end }} + diff --git a/kubernetes/helm-chart/charts/sortinghat-worker/templates/service.yaml b/kubernetes/helm-chart/charts/sortinghat-worker/templates/service.yaml index 986464eb..d791fa0a 100644 --- a/kubernetes/helm-chart/charts/sortinghat-worker/templates/service.yaml +++ b/kubernetes/helm-chart/charts/sortinghat-worker/templates/service.yaml @@ -9,3 +9,4 @@ metadata: {{- include "metadata.sortinghatWorker.service.annotations" . | nindent 4 }} spec: {{- include "template.service" . | nindent 2 }} + diff --git a/kubernetes/helm-chart/charts/sortinghat-worker/values.yaml b/kubernetes/helm-chart/charts/sortinghat-worker/values.yaml index 51268e41..1cc82f1c 100644 --- a/kubernetes/helm-chart/charts/sortinghat-worker/values.yaml +++ b/kubernetes/helm-chart/charts/sortinghat-worker/values.yaml @@ -35,3 +35,4 @@ service: type: "" # Default to "ClusterIP" extraEnvs: [] + diff --git a/kubernetes/helm-chart/charts/sortinghat/Chart.yaml b/kubernetes/helm-chart/charts/sortinghat/Chart.yaml index cc15a87f..b11d7074 100644 --- a/kubernetes/helm-chart/charts/sortinghat/Chart.yaml +++ b/kubernetes/helm-chart/charts/sortinghat/Chart.yaml @@ -8,3 +8,4 @@ maintainers: url: https://github.com/Eroyi appVersion: 1.7.0 #Based on the "Github Release" version (which is the docker image tag referring from), not the actual application version. version: 1.0 + diff --git a/kubernetes/helm-chart/charts/sortinghat/templates/_helper.tpl b/kubernetes/helm-chart/charts/sortinghat/templates/_helper.tpl index c314617c..2c81aba2 100644 --- a/kubernetes/helm-chart/charts/sortinghat/templates/_helper.tpl +++ b/kubernetes/helm-chart/charts/sortinghat/templates/_helper.tpl @@ -34,3 +34,4 @@ Sortinghat Service annotations {{ $name }}: {{ $value | quote }} {{- end -}} {{- end -}} + diff --git a/kubernetes/helm-chart/charts/sortinghat/templates/deployment.yaml b/kubernetes/helm-chart/charts/sortinghat/templates/deployment.yaml index 12cec2a9..16136e18 100644 --- a/kubernetes/helm-chart/charts/sortinghat/templates/deployment.yaml +++ b/kubernetes/helm-chart/charts/sortinghat/templates/deployment.yaml @@ -57,3 +57,4 @@ spec: {{- end }} {{- end }} # ^ ---- Volumes define ---- + diff --git a/kubernetes/helm-chart/charts/sortinghat/templates/pvc.yaml b/kubernetes/helm-chart/charts/sortinghat/templates/pvc.yaml index 0200c4fc..a88c8d9d 100644 --- a/kubernetes/helm-chart/charts/sortinghat/templates/pvc.yaml +++ b/kubernetes/helm-chart/charts/sortinghat/templates/pvc.yaml @@ -1,3 +1,4 @@ {{- range .Values.dependencies.storage.volumes }} {{- include "template.pvc" ( dict "item" . "root" $ ) }} {{- end }} + diff --git a/kubernetes/helm-chart/charts/sortinghat/templates/service.yaml b/kubernetes/helm-chart/charts/sortinghat/templates/service.yaml index c680dd0f..bed49568 100644 --- a/kubernetes/helm-chart/charts/sortinghat/templates/service.yaml +++ b/kubernetes/helm-chart/charts/sortinghat/templates/service.yaml @@ -9,3 +9,4 @@ metadata: {{- include "metadata.sortinghat.service.annotations" . | nindent 4 }} spec: {{- include "template.service" . | nindent 2 }} + diff --git a/kubernetes/helm-chart/charts/sortinghat/values.yaml b/kubernetes/helm-chart/charts/sortinghat/values.yaml index 278ad819..ce82afef 100644 --- a/kubernetes/helm-chart/charts/sortinghat/values.yaml +++ b/kubernetes/helm-chart/charts/sortinghat/values.yaml @@ -39,3 +39,4 @@ service: type: "" # Default to "ClusterIP" extraEnvs: [] + diff --git a/kubernetes/helm-chart/templates/_credentials.tpl b/kubernetes/helm-chart/templates/_credentials.tpl index 65030725..1cb6b334 100644 --- a/kubernetes/helm-chart/templates/_credentials.tpl +++ b/kubernetes/helm-chart/templates/_credentials.tpl @@ -20,3 +20,4 @@ Define various credentials recources {{- $password := default "red1s4Grim0ir3Lab" .Values.global.credentials.redis.password -}} {{- $password -}} {{- end }} + diff --git a/kubernetes/helm-chart/templates/_envs.tpl b/kubernetes/helm-chart/templates/_envs.tpl index bfebb58d..beec7151 100644 --- a/kubernetes/helm-chart/templates/_envs.tpl +++ b/kubernetes/helm-chart/templates/_envs.tpl @@ -38,3 +38,4 @@ Define various environment that referring from other values {{- define "nativeEnv.mordred" }} {{- end }} + diff --git a/kubernetes/helm-chart/templates/_templates.tpl b/kubernetes/helm-chart/templates/_templates.tpl index f6dffd67..c747a596 100644 --- a/kubernetes/helm-chart/templates/_templates.tpl +++ b/kubernetes/helm-chart/templates/_templates.tpl @@ -87,3 +87,4 @@ sessionAffinity: None selector: app: "{{ .Values.appConfig.name }}" {{- end }} + diff --git a/kubernetes/helm-chart/templates/configmap.yaml b/kubernetes/helm-chart/templates/configmap.yaml index b8b3b986..d9653e09 100644 --- a/kubernetes/helm-chart/templates/configmap.yaml +++ b/kubernetes/helm-chart/templates/configmap.yaml @@ -14,3 +14,4 @@ data: {{- include "config.uwsgiParams" . | nindent 4 }} nginx-conf-template: |- {{- include "config.nginxConf" . | nindent 4 }} + diff --git a/kubernetes/helm-chart/values.yaml b/kubernetes/helm-chart/values.yaml index 4868fdfd..8653e270 100644 --- a/kubernetes/helm-chart/values.yaml +++ b/kubernetes/helm-chart/values.yaml @@ -226,3 +226,4 @@ mariadb: redis: install: false + From fae0981adf5623d8bfef8fd941a16670618463e3 Mon Sep 17 00:00:00 2001 From: root <44765750+Eroyi@users.noreply.github.com> Date: Thu, 7 Nov 2024 18:36:05 +0800 Subject: [PATCH 15/16] change default storageClass to gp3 Signed-off-by: root <44765750+Eroyi@users.noreply.github.com> --- kubernetes/helm-chart/charts/opensearch-node/values.yaml | 2 +- kubernetes/helm-chart/charts/sortinghat/values.yaml | 2 +- kubernetes/helm-chart/values.yaml | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/kubernetes/helm-chart/charts/opensearch-node/values.yaml b/kubernetes/helm-chart/charts/opensearch-node/values.yaml index 80efb836..eb7d816e 100644 --- a/kubernetes/helm-chart/charts/opensearch-node/values.yaml +++ b/kubernetes/helm-chart/charts/opensearch-node/values.yaml @@ -32,7 +32,7 @@ dependencies: - name: "opensearch-data" mountPath: "/usr/share/opensearch/data" type: pvc - storageClass: efs-sc + storageClass: gp3 size: 1Gi service: diff --git a/kubernetes/helm-chart/charts/sortinghat/values.yaml b/kubernetes/helm-chart/charts/sortinghat/values.yaml index ce82afef..74c8df0c 100644 --- a/kubernetes/helm-chart/charts/sortinghat/values.yaml +++ b/kubernetes/helm-chart/charts/sortinghat/values.yaml @@ -28,7 +28,7 @@ dependencies: - name: "sortinghat-static" mountPath: "/opt/venv/lib/python3.9/site-packages/sortinghat/static" type: pvc - storageClass: efs-sc + storageClass: gp3 size: 1Gi service: diff --git a/kubernetes/helm-chart/values.yaml b/kubernetes/helm-chart/values.yaml index 8653e270..d02cf4d2 100644 --- a/kubernetes/helm-chart/values.yaml +++ b/kubernetes/helm-chart/values.yaml @@ -33,7 +33,7 @@ opensearch-node: - name: "opensearch-data" mountPath: "/usr/share/opensearch/data" type: pvc - storageClass: efs-sc + storageClass: gp3 size: 10Gi service: targetPort: 9200 @@ -165,7 +165,7 @@ sortinghat: - name: "sortinghat-static" mountPath: "/opt/venv/lib/python3.9/site-packages/sortinghat/static" type: pvc - storageClass: efs-sc + storageClass: gp3 size: 1Gi service: targetPort: 9314 From 952ac601c6c47d3f152565b6326f7f2c296af117 Mon Sep 17 00:00:00 2001 From: Arie <44765750+Eroyi@users.noreply.github.com> Date: Fri, 8 Nov 2024 09:57:23 +0800 Subject: [PATCH 16/16] Update README.md - instruction on how to replace database connection strings - instruction on how to replace opensearch, opensearch dashboard connection strings - instruction on how to import dashboard Signed-off-by: Arie <44765750+Eroyi@users.noreply.github.com> --- kubernetes/helm-chart/README.md | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/kubernetes/helm-chart/README.md b/kubernetes/helm-chart/README.md index a7999029..210de4ff 100644 --- a/kubernetes/helm-chart/README.md +++ b/kubernetes/helm-chart/README.md @@ -25,7 +25,19 @@ helm install grimoirelab /path/to/chart --values /path/to/chart/values.yaml -n g ``` `-n`: The namespace you would like to put this release in. +After installation, visit grimoirelab (opensearch-dashboard) homepage with: +`http://`opensearch_dashboard_ip`:5601` +To visualise data, you need to import dashboards into opensearch-dashboard. + + 1. Visit https://github.com/chaoss/grimoirelab-sigils/tree/master/panels/json/opensearch_dashboards + 2. Download the dashboard you are interested + 3. Open opensearch-dashboard console in your browser, login. + 4. [If its the first install] Click "Explore on my own". + 5. Click "Menu" on the top left corner, then go to "Management" - "Dashboard Management" + 6. [If its the first install] Click "Index patterns" on the left to create the index patterns. + 7. Click "Saved objects" on the left to import "ndjson" dashboard file you downloaded. + 8. Drag or browser the dashboard file, select, then click "Import" - "Done" to import the dashboard. # Configure the chart @@ -44,7 +56,7 @@ Global values are meant to override the specific values across all sub-charts. | `imagePullSecrets` | Only required when you are pulling image from private registry | list | [] | | `appName` | Name of this chart | string | "" | | `credentials.database.username` | Plaintext. Username for database connection | string | "root" | -| `credentials.database.password` | Plaintext. Password for the database connection | "mar1adb4Gr1m0ir3Lab" | +| `credentials.database.password` | Plaintext. Password for the database connection | string | "mar1adb4Gr1m0ir3Lab" | | `credentials.opensearchNode.password` | Plaintext. Password for the opensearch connection | string | "admin" | | `credentials.redis.password` | Plaintext. Password for the redis connection | string | "grimoirelab" | @@ -167,3 +179,21 @@ You can put an extra environments list in here to inject into the container. value: "bar" ``` + +# If you would like to bring your own databases and more... +Here are the strings you need to replace. + +## Database +| Name | Description | Type | Default value | +| ---- | ----------- | ---- | ------------- | +| `SORTINGHAT_DB_HOST` | Database connection address, IP address or URL, without HTTP header | string | "mariadb" | +| `SORTINGHAT_DB_PORT` | Database connection port | string | "3306" | +| `SORTINGHAT_REDIS_HOST` | Redis connection address, IP address or URL, without HTTP header | string | "redis-master" | + +## Opensearch and Dashboard +| Location | Key | Description | Type | Default value | +| -------- | --- | ----------- | ---- | ------------- | +| `templates/_envs.tpl` | `KIBANA_HOST` | Opensearch dashboard url | string | http://opensearch-dashboard: | +| `templates/_envs.tpl` | `OPENSEARCH_HOSTS` | Opensearch node url | string | https://opensearch-node: | +| `charts/mordred/templates/_mordred_config.tpl` | `es_collection.url` | Opensearch node url | string | @opensearch-node | +| `charts/mordred/templates/_mordred_config.tpl` | `es_enrichment.url` | Opensearch node url | string | @opensearch-node |