Skip to content

Commit 994091a

Browse files
author
Raman Damayeu
committed
Create helm chart that combines odd-platform and postgres for it that could be run on AWS Marketplace as Helm Chart with QuickLaunch Delivery option.
1 parent c0d7647 commit 994091a

14 files changed

+575
-0
lines changed

charts/odd-quicklaunch/Chart.yaml

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
apiVersion: v2
2+
name: odd-quicklaunch
3+
description: A Helm chart for deploying odd-platform and its PostgreSQL database
4+
version: 1.0.13
5+
appVersion: "1.0"
6+
7+
dependencies:
8+
- name: postgresql
9+
version: "13.2.9"
10+
repository: "https://charts.bitnami.com/bitnami"

charts/odd-quicklaunch/README.md

+67
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
2+
1. configmap.yaml template for odd-platform has been changed
3+
```
4+
...
5+
data:
6+
application.yml: |-
7+
spring:
8+
datasource:
9+
username: "postgres"
10+
password: "{{ .Values.global.postgresql.auth.postgresPassword }}"
11+
url: "jdbc:postgresql://odd-quicklaunch-postgresql:5432/odd-platform"
12+
...
13+
```
14+
That has been done to get value for password from value.yaml file of parent chart
15+
16+
2. service.yaml template for odd-platform has been changed
17+
2.1. service.type:
18+
```
19+
...
20+
spec:
21+
type: {{ .Values.global.platformServiceType }}
22+
...
23+
```
24+
That has been done as AWS Marketplace QuickLaunch does not accept Override parameter key with '-' that we have in the name of chart.
25+
So we have to use another name.
26+
27+
2.2 annotations:
28+
```
29+
...
30+
metadata:
31+
name: {{ include "odd-platform.fullname" . }}
32+
annotations:
33+
"service.beta.kubernetes.io/load-balancer-source-ranges": "{{ .Values.global.loadBalancerSourceRanges }}"
34+
...
35+
```
36+
There is a restriction of 50 characters to be propagated with AWS Marketplace QuickLaunch Override parameter key.
37+
So we have to use new shorter one.
38+
39+
```commandline
40+
$ helm dependency update .
41+
$ helm package .
42+
$ aws ecr get-login-password --region us-east-1 --profile ${AWSMarketplaceProfile} | helm registry login --username AWS --password-stdin 709825985650.dkr.ecr.us-east-1.amazonaws.com
43+
$ export HELM_EXPERIMENTAL_OCI=1 && helm push ./odd-quicklaunch-1.0.8.tgz oci://709825985650.dkr.ecr.us-east-1.amazonaws.com/provectus/
44+
```
45+
46+
Version Information in AWS Marketplace (Examples)
47+
48+
| Property | Value |
49+
|-----------------------------|-------------------------------------------------------------------------------------------------------------------------------------------|
50+
| Version title | odd-platform 0.19.0 quicklaunch |
51+
| Release notes | Data Quality Dashboard with QuickLaunch capabilities (odd-patform and postgres in one helm chart) |
52+
| Helm chart | 709825985650.dkr.ecr.us-east-1.amazonaws.com/provectus/odd-quicklaunch:1.0.13 |
53+
| Container Image | 709825985650.dkr.ecr.us-east-1.amazonaws.com/provectus/odd:0.19.0 |
54+
| Delivery option title | Open Data Discovery Platfrom Quick Launch |
55+
| Delivery option description | This delivery method allows to deploy odd-platform and its database with one helm chart on newly created AWS EKS cluster with QuickLaunch |
56+
| Usage instructions | Go to https://blog.opendatadiscovery.org/ to learn how to deploy odd-collectors. |
57+
| Supported services | Amazon Elastic Kubernetes Service (EKS) |
58+
| Helm release name | odd-quicklaunch |
59+
| QuickLaunch | Enable QuickLaunch |
60+
61+
Override parameters
62+
63+
| Override parameter | Override parameter key | Override parameter default | CloudFormation parameter name | CloudFormation parameter description | Hide passwords and secrets |
64+
| ------------- | ------------- | ------------- | ------------- | ------------- | ------------- |
65+
| Override parameter 1 | global.platformServiceType | LoadBalancer | platformServiceType | Leave default LoadBalancer so that odd-platform has a public host | false |
66+
| Override parameter 2 | global.postgresql.auth.postgresPassword | | postgresPassword | Password for user postgres that is used to connect odd-platform to its database | true |
67+
| Override parameter 3 | global.loadBalancerSourceRanges | 1.1.1.1/32 | AllowedIPAddresses | List of CIDRs separated with comma that would have connection to odd-platform. For instance, it could be your IP address found at https://whatismyipaddress.com/.Format for single IP: x.x.x.x/32 | false |
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Patterns to ignore when building packages.
2+
# This supports shell glob matching, relative path matching, and
3+
# negation (prefixed with !). Only one pattern per line.
4+
.DS_Store
5+
# Common VCS dirs
6+
.git/
7+
.gitignore
8+
.bzr/
9+
.bzrignore
10+
.hg/
11+
.hgignore
12+
.svn/
13+
# Common backup files
14+
*.swp
15+
*.bak
16+
*.tmp
17+
*.orig
18+
*~
19+
# Various IDEs
20+
.project
21+
.idea/
22+
*.tmproj
23+
.vscode/
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
apiVersion: v2
2+
name: odd-platform
3+
description: A Helm chart for Kubernetes
4+
5+
# A chart can be either an 'application' or a 'library' chart.
6+
#
7+
# Application charts are a collection of templates that can be packaged into versioned archives
8+
# to be deployed.
9+
#
10+
# Library charts provide useful utilities or functions for the chart developer. They're included as
11+
# a dependency of application charts to inject those utilities and functions into the rendering
12+
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
13+
type: application
14+
15+
# This is the chart version. This version number should be incremented each time you make changes
16+
# to the chart and its templates, including the app version.
17+
# Versions are expected to follow Semantic Versioning (https://semver.org/)
18+
version: 0.1.8
19+
20+
# This is the version number of the application being deployed. This version number should be
21+
# incremented each time you make changes to the application. Versions are not expected to
22+
# follow Semantic Versioning. They should reflect the version the application is using.
23+
appVersion: latest
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# odd-platform
2+
3+
![Version: 0.1.6](https://img.shields.io/badge/Version-0.1.6-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: latest](https://img.shields.io/badge/AppVersion-latest-informational?style=flat-square)
4+
5+
A Helm chart for Kubernetes
6+
7+
## Values
8+
9+
| Key | Type | Default | Description |
10+
|-----|------|---------|-------------|
11+
| affinity | object | `{}` | |
12+
| autoscaling.enabled | bool | `false` | |
13+
| autoscaling.maxReplicas | int | `100` | |
14+
| autoscaling.minReplicas | int | `1` | |
15+
| autoscaling.targetCPUUtilizationPercentage | int | `80` | |
16+
| config | string | `nil` | |
17+
| fullnameOverride | string | `""` | |
18+
| image.pullPolicy | string | `"IfNotPresent"` | |
19+
| image.repository | string | `"ghcr.io/opendatadiscovery/odd-platform"` | |
20+
| image.tag | string | `""` | |
21+
| imagePullSecrets | list | `[]` | |
22+
| ingress.annotations | object | `{}` | |
23+
| ingress.className | string | `""` | |
24+
| ingress.enabled | bool | `false` | |
25+
| ingress.hosts[0].host | string | `"chart-example.local"` | |
26+
| ingress.hosts[0].paths | list | `[]` | |
27+
| ingress.tls | list | `[]` | |
28+
| nameOverride | string | `""` | |
29+
| nodeSelector | object | `{}` | |
30+
| podAnnotations | object | `{}` | |
31+
| podSecurityContext | object | `{}` | |
32+
| replicaCount | int | `1` | |
33+
| resources | object | `{}` | |
34+
| securityContext | object | `{}` | |
35+
| service.annotations | object | `{}` | |
36+
| service.port | int | `80` | |
37+
| service.type | string | `"ClusterIP"` | |
38+
| serviceAccount.annotations | object | `{}` | |
39+
| serviceAccount.create | bool | `true` | |
40+
| serviceAccount.name | string | `""` | |
41+
| tolerations | list | `[]` | |
42+
43+
----------------------------------------------
44+
Autogenerated from chart metadata using [helm-docs v1.11.0](https://github.com/norwoodj/helm-docs/releases/v1.11.0)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
{{/* vim: set filetype=mustache: */}}
2+
{{/*
3+
Expand the name of the chart.
4+
*/}}
5+
{{- define "odd-platform.name" -}}
6+
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
7+
{{- end }}
8+
9+
{{/*
10+
Create a default fully qualified app name.
11+
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
12+
If release name contains chart name it will be used as a full name.
13+
*/}}
14+
{{- define "odd-platform.fullname" -}}
15+
{{- if .Values.fullnameOverride }}
16+
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
17+
{{- else }}
18+
{{- $name := default .Chart.Name .Values.nameOverride }}
19+
{{- if contains $name .Release.Name }}
20+
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
21+
{{- else }}
22+
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
23+
{{- end }}
24+
{{- end }}
25+
{{- end }}
26+
27+
{{/*
28+
Create chart name and version as used by the chart label.
29+
*/}}
30+
{{- define "odd-platform.chart" -}}
31+
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
32+
{{- end }}
33+
34+
{{/*
35+
Common labels
36+
*/}}
37+
{{- define "odd-platform.labels" -}}
38+
helm.sh/chart: {{ include "odd-platform.chart" . }}
39+
{{ include "odd-platform.selectorLabels" . }}
40+
{{- if .Chart.AppVersion }}
41+
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
42+
{{- end }}
43+
app.kubernetes.io/managed-by: {{ .Release.Service }}
44+
{{- end }}
45+
46+
{{/*
47+
Selector labels
48+
*/}}
49+
{{- define "odd-platform.selectorLabels" -}}
50+
app.kubernetes.io/name: {{ include "odd-platform.name" . }}
51+
app.kubernetes.io/instance: {{ .Release.Name }}
52+
{{- end }}
53+
54+
{{/*
55+
Create the name of the service account to use
56+
*/}}
57+
{{- define "odd-platform.serviceAccountName" -}}
58+
{{- if .Values.serviceAccount.create }}
59+
{{- default (include "odd-platform.fullname" .) .Values.serviceAccount.name }}
60+
{{- else }}
61+
{{- default "default" .Values.serviceAccount.name }}
62+
{{- end }}
63+
{{- end }}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
apiVersion: v1
2+
kind: ConfigMap
3+
metadata:
4+
name: {{ include "odd-platform.fullname" . }}-application-conf
5+
labels:
6+
{{- include "odd-platform.labels" . | nindent 4 }}
7+
data:
8+
application.yml: |-
9+
spring:
10+
datasource:
11+
username: "postgres"
12+
password: "{{ .Values.global.postgresql.auth.postgresPassword }}"
13+
url: "jdbc:postgresql://odd-quicklaunch-postgresql:5432/odd-platform"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
name: {{ include "odd-platform.fullname" . }}
5+
labels:
6+
{{- include "odd-platform.labels" . | nindent 4 }}
7+
spec:
8+
{{- if not .Values.autoscaling.enabled }}
9+
replicas: {{ .Values.replicaCount }}
10+
{{- end }}
11+
selector:
12+
matchLabels:
13+
{{- include "odd-platform.selectorLabels" . | nindent 6 }}
14+
template:
15+
metadata:
16+
{{- with .Values.podAnnotations }}
17+
annotations:
18+
{{- toYaml . | nindent 8 }}
19+
{{- end }}
20+
labels:
21+
{{- include "odd-platform.selectorLabels" . | nindent 8 }}
22+
spec:
23+
{{- with .Values.imagePullSecrets }}
24+
imagePullSecrets:
25+
{{- toYaml . | nindent 8 }}
26+
{{- end }}
27+
serviceAccountName: {{ include "odd-platform.serviceAccountName" . }}
28+
securityContext:
29+
{{- toYaml .Values.podSecurityContext | nindent 8 }}
30+
containers:
31+
- name: {{ .Chart.Name }}
32+
securityContext:
33+
{{- toYaml .Values.securityContext | nindent 12 }}
34+
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
35+
imagePullPolicy: {{ .Values.image.pullPolicy }}
36+
ports:
37+
- name: http
38+
containerPort: 8080
39+
protocol: TCP
40+
livenessProbe:
41+
tcpSocket:
42+
port: http
43+
readinessProbe:
44+
tcpSocket:
45+
port: http
46+
resources:
47+
{{- toYaml .Values.resources | nindent 12 }}
48+
{{- if (.Values.config).env }}
49+
env:
50+
{{- toYaml .Values.config.env | nindent 12 }}
51+
{{- end }}
52+
volumeMounts:
53+
{{- if (.Values.config).yaml }}
54+
- name: odd-platform-application-conf
55+
mountPath: /app/config/
56+
{{- end }}
57+
volumes:
58+
{{- if (.Values.config).yaml }}
59+
- name: odd-platform-application-conf
60+
configMap:
61+
name: {{ include "odd-platform.fullname" . }}-application-conf
62+
{{- end }}
63+
{{- with .Values.nodeSelector }}
64+
nodeSelector:
65+
{{- toYaml . | nindent 8 }}
66+
{{- end }}
67+
{{- with .Values.affinity }}
68+
affinity:
69+
{{- toYaml . | nindent 8 }}
70+
{{- end }}
71+
{{- with .Values.tolerations }}
72+
tolerations:
73+
{{- toYaml . | nindent 8 }}
74+
{{- end }}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{{- if .Values.autoscaling.enabled }}
2+
apiVersion: autoscaling/v2beta1
3+
kind: HorizontalPodAutoscaler
4+
metadata:
5+
name: {{ include "odd-platform.fullname" . }}
6+
labels:
7+
{{- include "odd-platform.labels" . | nindent 4 }}
8+
spec:
9+
scaleTargetRef:
10+
apiVersion: apps/v1
11+
kind: Deployment
12+
name: {{ include "odd-platform.fullname" . }}
13+
minReplicas: {{ .Values.autoscaling.minReplicas }}
14+
maxReplicas: {{ .Values.autoscaling.maxReplicas }}
15+
metrics:
16+
{{- if .Values.autoscaling.targetCPUUtilizationPercentage }}
17+
- type: Resource
18+
resource:
19+
name: cpu
20+
targetAverageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }}
21+
{{- end }}
22+
{{- if .Values.autoscaling.targetMemoryUtilizationPercentage }}
23+
- type: Resource
24+
resource:
25+
name: memory
26+
targetAverageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }}
27+
{{- end }}
28+
{{- end }}

0 commit comments

Comments
 (0)