Skip to content

Commit

Permalink
Add helm chart for wcmp-app
Browse files Browse the repository at this point in the history
  • Loading branch information
adibrastegarnia committed Jul 8, 2022
1 parent dc7f0eb commit 18f6e85
Show file tree
Hide file tree
Showing 13 changed files with 606 additions and 0 deletions.
27 changes: 27 additions & 0 deletions wcmp-app/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# SPDX-FileCopyrightText: 2022-present Intel Corporation
#
# SPDX-License-Identifier: Apache-2.0

# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*.orig
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/
29 changes: 29 additions & 0 deletions wcmp-app/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# SPDX-FileCopyrightText: 2022-present Intel Corporation
#
# SPDX-License-Identifier: Apache-2.0

apiVersion: v2
name: wcmp-app
description: wcmp-app 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.1

# 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: "0.0.2"

21 changes: 21 additions & 0 deletions wcmp-app/files/certs/tls.cacrt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
-----BEGIN CERTIFICATE-----
MIIDYDCCAkgCCQDe99fSN9qxSTANBgkqhkiG9w0BAQsFADByMQswCQYD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z+1iGqoyUhfCYcCSjuWTgAxzir+hrdn7uO67Hv4ndCoSj4SQaGka3W
eEfVeA==
-----END CERTIFICATE-----
21 changes: 21 additions & 0 deletions wcmp-app/files/certs/tls.crt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
-----BEGIN CERTIFICATE-----
MIIDdDCCAlwCFBveh0tyYQtXayQPaXgW+5dLuK8DMA0GCSqGSIb3DQEBCwUAMHIx
CzAJBgNVBAYTAlVTMQswCQYDVQQIDAJDQTESMBAGA1UEBwwJTWVubG9QYXJrMQww
CgYDVQQKDANPTkYxFDASBgNVBAsMC0VuZ2luZWVyaW5nMR4wHAYDVQQDDBVjYS5v
cGVubmV0d29ya2luZy5vcmcwHhcNMTkwNzE2MTkwNjU2WhcNMjkwNzEzMTkwNjU2
WjB7MQswCQYDVQQGEwJVUzELMAkGA1UECAwCQ0ExEjAQBgNVBAcMCU1lbmxvUGFy
azEMMAoGA1UECgwDT05GMRQwEgYDVQQLDAtFbmdpbmVlcmluZzEnMCUGA1UEAwwe
b25vcy1jb25maWcub3Blbm5ldHdvcmtpbmcub3JnMIIBIjANBgkqhkiG9w0BAQEF
AAOCAQ8AMIIBCgKCAQEAs1ER/FG9COwYnyDOxxPIGJb8p9l59GLqYdnb3PH5EI6y
AfhpJDhp+Z/RN8v+/NhH6JPYquPxRKWmHhRXmwEHgYREfkqK+HikTv86H5Tq/Xzz
BqadHkopMz+Q66Wo4LoD3M+Vl/11gUU9s7SIWBmcJly9ETQN5nddeGa+v+Mg9QoS
W/8CK7Y1iCguu3h2FYju+OQ7HJ9hO5abs3XiuJJJN9hPJRr1O1UtgUzlVbj2QLcT
BDntIxPKUc3/M5IpzgLt2vgHW9VMO5vFOXsr+UyQd/lByVXTxQKS5aw0kwMUJSdN
vasV3FAz4usP9IBx5Pq3MwMQF1uO5zJ8Xo2ytlsI0wIDAQABMA0GCSqGSIb3DQEB
CwUAA4IBAQB9W8/ygG87QLR37GZfutYLi9hBJQHSppCxZB2SBP1yl/Js1hHM0paP
ywlbRbmuCv7LM3CiaXdJo9w7onYha/BtJIYG0YHZqnXLjk0uufP07CBISGKXnfp0
y35YqruHjXtkoKdcqOGZsuz88iQ579PrvJpWCOon936FM7vBzKeBoNbBso52vt7b
FtKISoGAr8XwCrFYxgHOjYUP8A9d9ylaa3Hgfd7Xul2BKO3tPx/7oFxiaz40ATuQ
wN9OEsvNmP2TcrLEFKoUJBtyYV9gFCqQPuf7obwbTV5m1JW+1+NEsKNcWemdKU6x
N0u+jCC7D7so8pjqfZRouCW2dKVlIRjj
-----END CERTIFICATE-----
28 changes: 28 additions & 0 deletions wcmp-app/files/certs/tls.key
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
-----BEGIN PRIVATE KEY-----
MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCzURH8Ub0I7Bif
IM7HE8gYlvyn2Xn0Yuph2dvc8fkQjrIB+GkkOGn5n9E3y/782Efok9iq4/FEpaYe
FFebAQeBhER+Sor4eKRO/zoflOr9fPMGpp0eSikzP5DrpajgugPcz5WX/XWBRT2z
tIhYGZwmXL0RNA3md114Zr6/4yD1ChJb/wIrtjWIKC67eHYViO745Dscn2E7lpuz
deK4kkk32E8lGvU7VS2BTOVVuPZAtxMEOe0jE8pRzf8zkinOAu3a+Adb1Uw7m8U5
eyv5TJB3+UHJVdPFApLlrDSTAxQlJ029qxXcUDPi6w/0gHHk+rczAxAXW47nMnxe
jbK2WwjTAgMBAAECggEBALE57iHIk6Hu3wLfhR9DUN/k0r/+dMdywB6IGQKNcVHJ
BuxlnV08GJmsODcCevlhteiLv3hfI4Vqhv1xs4gygz2iAaQkfqfHbPXa0ZKHN53j
0bqAEAfw2jmZmN0edQPvNYQW8s4upuVmDu6+/oa8gRV1UTRgk2B2Fz65pcu3a0pi
yVeZzeAO/vD7WNP3uM7Yuv0AQTKKLvOqZmKLeDwPeC+2sbi03opYbIaEl+OJ94DX
9hCm1/vqojlzw+BHrxGS8bqXMnJnqxLep/gmbvL0Iy92SJgEBk6l8t7xzpBqSjDW
+DjDLqpda6r/Dy9b5hBZ0a/4V+fRJPz4S/k+qjp9DyECgYEA7KMQur7QZcSAWPPM
ZV5TM6+SDYn6TP9csbyB4IbOfeLdIkVKY+svVz2m7FynfQb4whtxERbMy0QjYEgc
us3p/QVjHBs/JZIdtIg5ff6qgOFAkuaCXEJKyH4wcEA091cr6HWslWCHzop2SD+T
dpvSgXJXpx1RYP/6X3sUf1mKAOMCgYEAwf1K4fOYZwyT44VPurxhmzgDWW2PKm6I
gCOZN9EN2Mvt0J5zKKoHw8ORHGN9zxLMyB11803Uwm7nceApM3FUacmLHP05Q1Vo
ukHVLoFQYwXLQzSWiZbtxcbMK3P1EU2Sg5+yfoRf6usmRIWDlr4+TIzT3a20nhV0
olOj3xFtC1ECgYBHyeiHXuAGH6j4U24MyqLfKUJbzSIcPdQ3L4MPRJZcZnjDrtW0
nmLMSq3bQvik23qYGI8iqhITEGbTDM16doGn+vxoSHPNyBgu7qzSZnH/i1Z1umyN
5KafUHkNdM0cxFtTuG9VGeXZaPQdUvw/nWItVyz0S9amYMHqOYKsZ9OQFQKBgQC6
tfYq//CBzqNQ63DPxJ0VbpYars6LApQy8RB5nqb7MVyV3MvuKakLjOHQNxpSAkBD
o8dxBEpxUZlGC4DcWInsv+U7Y6aH3l7MVqy+9AvRIzR+XNE/YJs+Lpc4g4UuwEDy
mvSLvREs5GOStAbxQe5oc2tAA/7B4Ni/nE0vWHBh4QKBgDUukLjK4i+AqCm6Z4iu
/FcKtNC2+BLxZ2sjaRVn78aQ2DXWaKWVaKwSBJOtLghOyjAzvH8VDOtvp92rQgDk
ltnoTp09B9B80dNOVqIi113Inr89N/QDNVYctqPbzizbWHlf3ENwVklwAXhmOIbN
1l0Cge8ERKGcAIl9SsTl+5Se
-----END PRIVATE KEY-----
116 changes: 116 additions & 0 deletions wcmp-app/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
# SPDX-FileCopyrightText: 2022-present Intel Corporation
#
# SPDX-License-Identifier: Apache-2.0

{{/*
Expand the name of the chart.
*/}}
{{- define "wcmp-app.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 "wcmp-app.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 "wcmp-app.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}

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

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

{{/*
Create the name of the service account to use
*/}}
{{- define "wcmp-app.serviceAccountName" -}}
{{- if .Values.serviceAccount.create }}
{{- default (include "wcmp-app.fullname" .) .Values.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}

{{/*
wcmp-app image name
*/}}
{{- define "wcmp-app.imagename" -}}
{{- if .Values.global.image.registry -}}
{{- printf "%s/" .Values.global.image.registry -}}
{{- else if .Values.image.registry -}}
{{- printf "%s/" .Values.image.registry -}}
{{- end -}}
{{- printf "%s:" .Values.image.repository -}}
{{- if .Values.global.image.tag -}}
{{- .Values.global.image.tag -}}
{{- else -}}
{{- tpl .Values.image.tag . -}}
{{- end -}}
{{- end -}}


{{/*
wcmp-app consensus image name
*/}}
{{- define "wcmp-app.store.consensus.imagename" -}}
{{- if or .Values.store.consensus.image.tag .Values.global.store.consensus.image.tag -}}
{{- if .Values.global.store.consensus.image.registry -}}
{{- printf "%s/" .Values.global.store.consensus.image.registry -}}
{{- else if .Values.store.consensus.image.registry -}}
{{- printf "%s/" .Values.store.consensus.image.registry -}}
{{- end -}}
{{- printf "%s:" .Values.store.consensus.image.repository -}}
{{- if .Values.global.store.consensus.image.tag -}}
{{- .Values.global.store.consensus.image.tag -}}
{{- else -}}
{{- .Values.store.consensus.image.tag -}}
{{- end -}}
{{- else -}}
""
{{- end -}}
{{- end -}}

{{/*
wcmp-app consensus store name
*/}}
{{- define "wcmp-app.store.consensus.name" -}}
{{- if .Values.store.consensus.name -}}
{{- printf "%s" .Values.store.consensus.name -}}
{{- else -}}
{{- printf "%s-consensus-store" ( include "wcmp-app.fullname" . ) -}}
{{- end -}}
{{- end -}}
18 changes: 18 additions & 0 deletions wcmp-app/templates/configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# SPDX-FileCopyrightText: 2022-present Intel Corporation
#
# SPDX-License-Identifier: Apache-2.0

apiVersion: v1
kind: ConfigMap
metadata:
name: {{ template "wcmp-app.fullname" . }}-config
labels:
app: {{ template "wcmp-app.fullname" . }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
release: "{{ .Release.Name }}"
heritage: "{{ .Release.Service }}"
data:
logging.yaml: |-
{{- if .Values.logging }}
{{ toYaml .Values.logging | indent 4 }}
{{- end}}
Loading

0 comments on commit 18f6e85

Please sign in to comment.