-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Helm charts created #35
base: main
Are you sure you want to change the base?
Changes from 4 commits
ca145b0
5bd75e9
b92f761
8c43d1e
ae27e1e
4e91efc
d58a365
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
apiVersion: v2 | ||
name: helm | ||
description: A Helm chart for Kubernetes | ||
|
||
# A chart can be either an 'application' or a 'library' chart. | ||
# | ||
# Application charts are a collection of templates that can be packaged into versioned archives | ||
# to be deployed. | ||
# | ||
# Library charts provide useful utilities or functions for the chart developer. They're included as | ||
# a dependency of application charts to inject those utilities and functions into the rendering | ||
# pipeline. Library charts do not define any templates and therefore cannot be deployed. | ||
type: application | ||
|
||
# This is the chart version. This version number should be incremented each time you make changes | ||
# to the chart and its templates, including the app version. | ||
# Versions are expected to follow Semantic Versioning (https://semver.org/) | ||
version: 0.1.0 | ||
|
||
# This is the version number of the application being deployed. This version number should be | ||
# incremented each time you make changes to the application. Versions are not expected to | ||
# follow Semantic Versioning. They should reflect the version the application is using. | ||
# It is recommended to use it with quotes. | ||
appVersion: "1.16.0" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
{{/* | ||
Expand the name of the chart. | ||
*/}} | ||
{{- define "helm.name" -}} | ||
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} | ||
{{- end }} | ||
|
||
{{/* | ||
Create a default fully qualified app name. | ||
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). | ||
If release name contains chart name it will be used as a full name. | ||
*/}} | ||
{{- define "helm.fullname" -}} | ||
{{- if .Values.fullnameOverride }} | ||
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} | ||
{{- else }} | ||
{{- $name := default .Chart.Name .Values.nameOverride }} | ||
{{- if contains $name .Release.Name }} | ||
{{- .Release.Name | trunc 63 | trimSuffix "-" }} | ||
{{- else }} | ||
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} | ||
{{- end }} | ||
{{- end }} | ||
{{- end }} | ||
|
||
{{/* | ||
Create chart name and version as used by the chart label. | ||
*/}} | ||
{{- define "helm.chart" -}} | ||
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} | ||
{{- end }} | ||
|
||
{{/* | ||
Common labels | ||
*/}} | ||
{{- define "helm.labels" -}} | ||
helm.sh/chart: {{ include "helm.chart" . }} | ||
{{ include "helm.selectorLabels" . }} | ||
{{- if .Chart.AppVersion }} | ||
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} | ||
{{- end }} | ||
app.kubernetes.io/managed-by: {{ .Release.Service }} | ||
{{- end }} | ||
|
||
{{/* | ||
Selector labels | ||
*/}} | ||
{{- define "helm.selectorLabels" -}} | ||
app.kubernetes.io/name: {{ include "helm.name" . }} | ||
app.kubernetes.io/instance: {{ .Release.Name }} | ||
{{- end }} | ||
|
||
{{/* | ||
Create the name of the service account to use | ||
*/}} | ||
{{- define "helm.serviceAccountName" -}} | ||
{{- if .Values.serviceAccount.create }} | ||
{{- default (include "helm.fullname" .) .Values.serviceAccount.name }} | ||
{{- else }} | ||
{{- default "default" .Values.serviceAccount.name }} | ||
{{- end }} | ||
{{- end }} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: {{ .Values.deployment_name }} | ||
namespace: {{ .Values.namespace }} | ||
labels: | ||
app: {{ .Values.deployment_name }} | ||
spec: | ||
replicas: {{ .Values.replicas }} | ||
selector: | ||
matchLabels: | ||
app: {{ .Values.deployment_name }} | ||
template: | ||
metadata: | ||
labels: | ||
app: {{ .Values.deployment_name }} | ||
spec: | ||
containers: | ||
- name: {{ .Values.container.name }} | ||
image: " {{ .Values.image.name }}:{{ .Values.image.tag }} " | ||
imagePullPolicy: Always | ||
ports: | ||
- containerPort: {{ .Values.container.port }} | ||
env: | ||
- name: AGENT_PORT | ||
value: "{{ .Values.environment.AGENT_PORT }}" | ||
- name: AGENT_NAME | ||
value: "{{ .Values.environment.AGENT_NAME }}" | ||
- name: WALLET_NAME | ||
value: "{{ .Values.environment.WALLET_NAME }}" | ||
- name: WALLET_KEY | ||
value: "{{ .Values.environment.WALLET_KEY }}" | ||
- name: POSTGRES_USER | ||
value: "{{ .Values.environment.POSTGRES_USER }}" | ||
- name: POSTGRES_PASSWORD | ||
value: "{{ .Values.environment.POSTGRES_PASSWORD }}" | ||
- name: POSTGRES_HOST | ||
value: "{{ .Values.environment.POSTGRES_HOST }}" | ||
- name: POSTGRES_ADMIN_USER | ||
value: "{{ .Values.environment.POSTGRES_ADMIN_USER }}" | ||
- name: POSTGRES_ADMIN_PASSWORD | ||
value: "{{ .Values.environment.POSTGRES_ADMIN_PASSWORD }}" | ||
- name: AGENT_ENDPOINTS | ||
value: "{{ .Values.environment.AGENT_ENDPOINTS }}" | ||
- name: LOG_LEVEL | ||
value: "{{ .Values.environment.LOG_LEVEL }}" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
apiVersion: networking.k8s.io/v1 | ||
kind: Ingress | ||
metadata: | ||
annotations: | ||
cert-manager.io/cluster-issuer: {{ .Values.cluster_issuer_name }} | ||
kubernetes.io/ingress.class: nginx | ||
name: {{ .Values.ingress_name }} | ||
namespace: {{ .Values.namespace }} | ||
spec: | ||
rules: | ||
- host: {{ .Values.host_name }} | ||
http: | ||
paths: | ||
- backend: | ||
service: | ||
name: {{ .Values.service_name }} | ||
port: | ||
number: {{ .Values.container.port }} | ||
path: / | ||
pathType: Prefix | ||
tls: | ||
- hosts: | ||
- {{ .Values.host_name }} | ||
secretName: {{ .Values.certificate_secret_name }} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: {{ .Values.service_name }} | ||
namespace: {{ .Values.namespace }} | ||
spec: | ||
selector: | ||
app: {{ .Values.deployment_name }} | ||
ports: | ||
- port: {{ .Values.container.port }} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
## Common Values | ||
namespace: mediator | ||
|
||
|
||
## Deployment Values | ||
deployment_name: mediator | ||
replicas: 1 | ||
|
||
image: | ||
name: ghcr.io/openwallet-foundation/didcomm-mediator-credo | ||
tag: latest | ||
|
||
container: | ||
name: mediator | ||
port: 3000 | ||
|
||
environment: | ||
AGENT_PORT: 3000 | ||
AGENT_NAME: Mediator | ||
WALLET_NAME: mediator | ||
WALLET_KEY: ${WALLET_KEY} | ||
POSTGRES_USER: ${POSTGRES_USER} | ||
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD} | ||
POSTGRES_HOST: ${POSTGRES_HOST} | ||
POSTGRES_ADMIN_USER: ${POSTGRES_ADMIN_USER} | ||
POSTGRES_ADMIN_PASSWORD: ${POSTGRES_ADMIN_PASSWORD} | ||
AGENT_ENDPOINTS: "https://my-mediator.com,wss://my-mediator.com" | ||
LOG_LEVEL: 2 | ||
Comment on lines
+19
to
+28
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It would be good to be able to override all values. (Also wallet_name) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I have written the values from the docker-compose.yaml file, it should be left with only "{}" this. For reference I have done that. You can override the values as needed or can set the values with |
||
|
||
|
||
## Service Values | ||
service_name: mediator | ||
|
||
|
||
## Ingress Values | ||
ingress_name: mediator_ingress | ||
cluster_issuer_name: CLUSTER_ISSUER-NAME | ||
host_name: HOST_NAME | ||
certificate_secret_name: CERTIFICATE_SECRET_NAME |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we give these mediator specific names?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, I will write the docs with the helm commands to install the application.
For the name: and description: I have left it default, but we can change that any time. Also suggest to me any note we should display after the helm deployment; I will write that too.