Compare commits

...

24 Commits

Author SHA1 Message Date
davidfrickert 0e0f29ee43 CronJob - Allow file ConfigMap & disabling command override (#90)
* allow file configmap on cron-job chart

* Allow disabling the command override in cronjob container

* Use name of volume instead of fileName for configmap naming

* Add YAML separator to configmaps to allow multiple configmap volumes

- before this change if you tried to use e.g. multiple file configmaps they would all be appended in one YAML file due to no usage of separators, which would lead to only one of the file confimaps actually be created.

* Fix broken test due to file configmap naming change
2023-11-16 15:39:13 +01:00
Github Action 5f0d40f05f The next release version will be 0.61.0 2023-11-11 20:37:45 +00:00
Github Action 410f2b6047 Publishing 0.60.0 to the Helm repository 2023-11-11 20:37:45 +00:00
Laszlo Fogas 9022b34793 Supporting v1alpha1 opensca.dev release 2023-11-11 21:37:04 +01:00
Github Action 366eca776f The next release version will be 0.60.0 2023-11-09 12:38:32 +00:00
Github Action 365544204c Publishing 0.59.0 to the Helm repository 2023-11-09 12:38:32 +00:00
Youcef Guichi 9e1c6f7474 Merge pull request #86 from gimlet-io/minor-changes
Minor changes
2023-11-09 13:26:02 +01:00
Youcef Guichi 84a18e1a01 Minor changes 2023-11-09 13:22:44 +01:00
Raz Amir c7da3a4a4f Add podLabels to onechart (#83)
* Add podLabels to onechart

* add unittest
2023-11-07 13:01:15 +01:00
Laszlo Fogas d66a75ec36 osca.dev fields (#82) 2023-10-30 17:55:07 +01:00
Github Action 91667083fc The next release version will be 0.59.0 2023-10-20 08:57:29 +00:00
Github Action 6673e96e94 Publishing 0.58.0 to the Helm repository 2023-10-20 08:57:28 +00:00
Laszlo Fogas 593756f621 Merge pull request #80 from gimlet-io/new-features
Added ability to refrence an env from an existing configMaps and secrets
2023-10-20 10:55:41 +02:00
Laszlo Fogas 8032acb1b9 Default value for optional; bumping common chart version 2023-10-20 10:54:33 +02:00
Youcef Guichi aafc0bbfab Removed envfrom -- Updated unittest 2023-10-20 10:36:50 +02:00
Youcef Guichi 8720c33db4 Added ability to refrence an env from an existing configMaps and secrets 2023-10-19 11:33:48 +02:00
Github Action 775bd4b50c The next release version will be 0.58.0 2023-08-22 13:16:43 +00:00
Github Action 59f8aee710 Publishing 0.57.0 to the Helm repository 2023-08-22 13:16:42 +00:00
Laszlo Fogas 3b9b6e30ae Support for Gimlet metadata annotations 2023-08-22 15:16:12 +02:00
Github Action 3a04385235 The next release version will be 0.57.0 2023-08-22 12:47:38 +00:00
Github Action bde9fdfe3f Publishing 0.56.0 to the Helm repository 2023-08-22 12:47:37 +00:00
Laszlo Fogas 5eca12d8e1 Static-site json schema updated to match the default values.yaml 2023-08-22 14:47:01 +02:00
Github Action ea74075201 The next release version will be 0.56.0 2023-08-21 14:59:28 +00:00
Github Action c4f6e01ae5 Publishing 0.55.0 to the Helm repository 2023-08-21 14:59:27 +00:00
50 changed files with 586 additions and 146 deletions
+1 -1
View File
@@ -15,4 +15,4 @@ type: library
# 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.3.1
version: 0.4.0
+1
View File
@@ -1,5 +1,6 @@
{{- define "common.configmap.tpl" -}}
{{- if .Values.vars }}
---
apiVersion: v1
kind: ConfigMap
metadata:
@@ -1,11 +1,11 @@
{{- define "common.customFileConfigmap.tpl" -}}
{{- range .Values.volumes }}
{{- if .fileName }}
---
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ template "common.robustName" .fileName }}
name: {{ template "common.robustName" (printf "%s-%s" $.Release.Name .name) }}
namespace: {{ $.Release.Namespace }}
data:
{{ .fileName }}: |
+11 -1
View File
@@ -1,10 +1,20 @@
{{- define "common.envFromRef.tpl" -}}
{{- if or (or (or (.Values.vars) (.Values.secretEnabled)) .Values.sealedSecrets) .Values.secretName -}}
{{- if or (or (or (or (or (.Values.vars) (.Values.secretEnabled)) .Values.sealedSecrets) .Values.secretName) .Values.existingConfigMaps) .Values.existingSecrets -}}
envFrom: &envFrom
{{- if .Values.vars }}
- configMapRef:
name: {{ template "common.robustName" .Release.Name }}
{{- end }}
{{- range .Values.existingSecrets }}
- secretRef:
name: {{ .name }}
optional: {{ .optional | default false }}
{{- end }}
{{- range .Values.existingConfigMaps }}
- configMapRef:
name: {{ .name }}
optional: {{ .optional | default false }}
{{- end }}
{{- if .Values.secretEnabled }}
- secretRef:
name: {{ include "common.robustName" $.Release.Name }}
+1 -1
View File
@@ -10,7 +10,7 @@ volumes:
name: {{ .existingConfigMap }}
{{- else if .fileName }}
configMap:
name: {{ template "common.robustName" .fileName }}
name: {{ template "common.robustName" (printf "%s-%s" $.Release.Name .name) }}
{{- else if .hostPath }}
hostPath:
path: {{ .hostPath.path }}
+3 -3
View File
@@ -1,6 +1,6 @@
dependencies:
- name: common
repository: file://../common
version: 0.3.1
digest: sha256:64689b29ef8b2262efbd5d49bccf40f798698d426dcfdc7c632aaf183a8cc681
generated: "2023-08-18T08:34:24.144108449+02:00"
version: 0.4.0
digest: sha256:d4eccd332ada7362f429e04b82022f5605a02e2d3aa7b9fdf8adaf4f6c9e03eb
generated: "2023-10-20T10:53:13.982995773+02:00"
+2 -2
View File
@@ -15,9 +15,9 @@ 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.55.0
version: 0.61.0
dependencies:
- name: common
version: 0.3.1
version: 0.4.0
repository: file://../common
Binary file not shown.
Binary file not shown.
+2
View File
@@ -25,10 +25,12 @@ spec:
{{- if .Values.vars }}
imagePullPolicy: {{ .Values.image.pullPolicy }}
{{- end }}
{{- if .Values.overrideCommand }}
command:
- {{ .Values.shell }}
- -c
- {{ .Values.command | quote }}
{{- end }}
{{- include "common.envFromRef.tpl" . | nindent 14 }}
{{- include "common.volumeMountsRef.tpl" . | nindent 14 }}
resources:
@@ -0,0 +1 @@
{{- include "common.customFileConfigmap.tpl" . -}}
+1
View File
@@ -5,6 +5,7 @@ image:
schedule: "*/1 * * * *"
command: |
echo "I'm alive"
overrideCommand: true
shell: "/bin/sh"
nameOverride: ""
+3 -3
View File
@@ -1,6 +1,6 @@
dependencies:
- name: common
repository: file://../common
version: 0.3.1
digest: sha256:64689b29ef8b2262efbd5d49bccf40f798698d426dcfdc7c632aaf183a8cc681
generated: "2023-08-18T08:31:18.469039683+02:00"
version: 0.4.0
digest: sha256:d4eccd332ada7362f429e04b82022f5605a02e2d3aa7b9fdf8adaf4f6c9e03eb
generated: "2023-10-20T10:52:47.237955041+02:00"
+2 -2
View File
@@ -15,9 +15,9 @@ 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.55.0
version: 0.61.0
dependencies:
- name: common
version: 0.3.1
version: 0.4.0
repository: file://../common
Binary file not shown.
Binary file not shown.
+15 -5
View File
@@ -142,23 +142,33 @@
{
"schemaIDs": [
"#/properties/podDisruptionBudgetEnabled",
"#/properties/spreadAcrossNodes"
"#/properties/spreadAcrossNodes",
"#/properties/podAnnotations",
"#/properties/podLabels"
],
"uiSchema": {},
"metaData": {
"name": "High Availability",
"name": "Deployment fine-tuning",
"icon": "M9 12l2 2 4-4M7.835 4.697a3.42 3.42 0 001.946-.806 3.42 3.42 0 014.438 0 3.42 3.42 0 001.946.806 3.42 3.42 0 013.138 3.138 3.42 3.42 0 00.806 1.946 3.42 3.42 0 010 4.438 3.42 3.42 0 00-.806 1.946 3.42 3.42 0 01-3.138 3.138 3.42 3.42 0 00-1.946.806 3.42 3.42 0 01-4.438 0 3.42 3.42 0 00-1.946-.806 3.42 3.42 0 01-3.138-3.138 3.42 3.42 0 00-.806-1.946 3.42 3.42 0 010-4.438 3.42 3.42 0 00.806-1.946 3.42 3.42 0 013.138-3.138z"
}
},
{
"schemaIDs": [
"#/properties/podAnnotations",
"#/properties/name",
"#/properties/description",
"#/properties/ownerName",
"#/properties/ownerIm",
"#/properties/gitSha",
"#/properties/gitRepository"
"#/properties/gitRepository",
"#/properties/documentation",
"#/properties/logs",
"#/properties/metrics",
"#/properties/traces",
"#/properties/issues"
],
"uiSchema": {},
"metaData": {
"name": "Misc",
"name": "Service Catalog",
"icon": "M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-3 7h3m-3 4h3m-6-4h.01M9 16h.01"
}
}
+4 -1
View File
@@ -39,6 +39,9 @@ spec:
gimlet.io/git-repository: {{ .Values.gitRepository }}
{{- end }}
labels:
{{- with .Values.podLabels }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- include "helm-chart.selectorLabels" . | nindent 8 }}
spec:
{{- with .Values.imagePullSecrets }}
@@ -138,7 +141,7 @@ spec:
- -c
- {{ .Values.sidecar.command | quote }}
{{- end }}
{{- if or (or (.Values.vars) (.Values.secretEnabled)) .Values.sealedSecrets }}
{{- if or (or (or (or (or (.Values.vars) (.Values.secretEnabled)) .Values.sealedSecrets) .Values.secretName) .Values.existingConfigMaps) .Values.existingSecrets }}
envFrom: *envFrom
{{- end }}
{{- if or (or (.Values.volumes) (.Values.sealedFileSecrets)) .Values.fileSecrets }}
+32 -1
View File
@@ -5,13 +5,44 @@ metadata:
namespace: {{ .Release.Namespace }}
labels:
{{- include "helm-chart.labels" . | nindent 4 }}
{{- if or .Values.gitRepository .Values.gitSha }}
{{- if or (or (or (or (or .Values.gitRepository .Values.gitSha) .Values.serviceName) .Values.serviceDescription) .Values.ownerName) .Values.ownerIm }}
annotations:
{{- if .Values.gitRepository }}
gimlet.io/git-repository: {{ .Values.gitRepository }}
{{- $parts := split "/" .Values.gitRepository }}
v1alpha1.opensca.dev/vcs.owner: {{ $parts._0 }}
v1alpha1.opensca.dev/vcs.name: {{ $parts._1 }}
{{- end }}
{{- if .Values.gitSha }}
gimlet.io/git-sha: {{ .Values.gitSha }}
v1alpha1.opensca.dev/version.sha: {{ .Values.gitSha }}
{{- end }}
{{- if .Values.serviceName }}
v1alpha1.opensca.dev/name: {{ .Values.serviceName | quote }}
{{- end }}
{{- if .Values.serviceDescription }}
v1alpha1.opensca.dev/description: {{ .Values.serviceDescription | quote }}
{{- end }}
{{- if .Values.ownerName }}
v1alpha1.opensca.dev/owner.name: {{ .Values.ownerName | quote }}
{{- end }}
{{- if .Values.ownerIm }}
v1alpha1.opensca.dev/owner.im: {{ .Values.ownerIm | quote }}
{{- end }}
{{- if .Values.documentation }}
v1alpha1.opensca.dev/documentation: {{ .Values.documentation | quote }}
{{- end }}
{{- if .Values.logs }}
v1alpha1.opensca.dev/logs: {{ .Values.logs | quote }}
{{- end }}
{{- if .Values.metrics }}
v1alpha1.opensca.dev/metrics: {{ .Values.metrics | quote }}
{{- end }}
{{- if .Values.issues }}
v1alpha1.opensca.dev/issues: {{ .Values.issues | quote }}
{{- end }}
{{- if .Values.traces }}
v1alpha1.opensca.dev/traces: {{ .Values.traces | quote }}
{{- end }}
{{- end }}
spec:
@@ -16,5 +16,23 @@ tests:
name: release-name
- it: Should not reference configmap if vars are not set
asserts:
- isNull:
- isNull:
path: spec.template.spec.containers[0].envFrom
- it: Should reference to existing configmaps
set:
existingConfigMaps:
- name: firstcm
optional: true
- name: secondcm
optional: true
asserts:
- contains:
path: spec.template.spec.containers[0].envFrom
content:
configMapRef:
name: firstcm
optional: true
configMapRef:
name: secondcm
optional: true
@@ -0,0 +1,17 @@
suite: test deployment
templates:
- deployment.yaml
- configmap.yaml
tests:
- it: Should set custom labels
set:
podLabels:
label1: val1
label2: val2
asserts:
- equal:
path: spec.template.metadata.labels.label1
value: val1
- equal:
path: spec.template.metadata.labels.label2
value: val2
@@ -31,3 +31,20 @@ tests:
content:
secretRef:
name: release-name
- it: Should reference to existing secrets
set:
existingSecrets:
- name: firstsecret
optional: true
- name: secondsecret
optional: true
asserts:
- contains:
path: spec.template.spec.containers[0].envFrom
content:
secretRef:
name: firstsecret
optional: true
secretRef:
name: secondsecret
optional: true
@@ -169,7 +169,7 @@ tests:
value:
- name: volume-name
configMap:
name: myfile-conf
name: release-name-volume-name
- equal:
path: spec.template.spec.containers[0].volumeMounts
value:
@@ -4,11 +4,32 @@ templates:
tests:
- it: Should set Gimlet taxonomy
set:
gitRepository: github.com/laszlocph/demo-app
gitRepository: laszlocph/demo-app
gitSha: xyz
serviceName: cart-backend
serviceDescription: "Backend to manage shopping cart state, written in Go"
ownerName: "backend-team"
ownerIm: "#backend-team"
documentation: https://confluence.mycompany.com/cart-backend
logs: https://grafana.mycompany.com/logs
metrics: https://grafana.mycompany.com/cart-dashboard
issues: https://jira.mycompany.com/cart-backend
traces: https://jaeger.mycompany.com/cart-dashboard
asserts:
- equal:
path: metadata.annotations
value:
gimlet.io/git-repository: github.com/laszlocph/demo-app
gimlet.io/git-repository: laszlocph/demo-app
gimlet.io/git-sha: xyz
v1alpha1.opensca.dev/vcs.owner: laszlocph
v1alpha1.opensca.dev/vcs.name: demo-app
v1alpha1.opensca.dev/version.sha: xyz
v1alpha1.opensca.dev/name: cart-backend
v1alpha1.opensca.dev/description: "Backend to manage shopping cart state, written in Go"
v1alpha1.opensca.dev/owner.name: "backend-team"
v1alpha1.opensca.dev/owner.im: "#backend-team"
v1alpha1.opensca.dev/documentation: https://confluence.mycompany.com/cart-backend
v1alpha1.opensca.dev/logs: https://grafana.mycompany.com/logs
v1alpha1.opensca.dev/metrics: https://grafana.mycompany.com/cart-dashboard
v1alpha1.opensca.dev/issues: https://jira.mycompany.com/cart-backend
v1alpha1.opensca.dev/traces: https://jaeger.mycompany.com/cart-dashboard
+76
View File
@@ -15,6 +15,7 @@
"nameOverride": "",
"fullnameOverride": "",
"podAnnotations": {},
"podLabels": {},
"podSecurityContext": {
"fsGroup": 999
},
@@ -189,6 +190,81 @@
"required": [],
"additionalProperties": true
},
"podLabels": {
"$id": "#/properties/podLabels",
"type": "object",
"title": "Pod labels",
"description": "Labels to place on pods",
"default": {},
"examples": [
{}
],
"required": [],
"additionalProperties": true
},
"name": {
"$id": "#/properties/name",
"type": "string",
"title": "Service Name",
"description": "The service name for unique identification",
"default": ""
},
"description": {
"$id": "#/properties/description",
"type": "string",
"title": "Service Description",
"description": "Human readable text description of the service",
"default": ""
},
"ownerName": {
"$id": "#/properties/ownerName",
"type": "string",
"title": "Owner",
"description": "The person or team who is responsible for this service",
"default": ""
},
"ownerIm": {
"$id": "#/properties/ownerIm",
"type": "string",
"title": "Owner IM",
"description": "Instant messaging channel, or direct message handle of the owner. prefix with # for channels, prefix with @ for direct messages.",
"default": ""
},
"documentation": {
"$id": "#/properties/documentation",
"type": "string",
"title": "Link to Documentation",
"description": "Link to documentation. The link's preferred usage is in a href html tag.",
"default": ""
},
"logs": {
"$id": "#/properties/logs",
"type": "string",
"title": "Link to Logs",
"description": "Link to log aggregation platform. The link's preferred usage is in a href html tag.",
"default": ""
},
"metrics": {
"$id": "#/properties/metrics",
"type": "string",
"title": "Link to Metrics",
"description": "Link to metrics dashboard. The link's preferred usage is in a href html tag.",
"default": ""
},
"issues": {
"$id": "#/properties/issues",
"type": "string",
"title": "Link to Issues",
"description": "Link to issue tracker. The link's preferred usage is in a href html tag.",
"default": ""
},
"traces": {
"$id": "#/properties/traces",
"type": "string",
"title": "Link to Traces",
"description": "Link to application traces. The link's preferred usage is in a href html tag.",
"default": ""
},
"gitSha": {
"$id": "#/properties/gitSha",
"type": "string",
+2 -1
View File
@@ -20,6 +20,8 @@ fullnameOverride: ""
podAnnotations: {}
podLabels: {}
podSecurityContext:
fsGroup: 999
@@ -39,7 +41,6 @@ nodeSelector: {}
tolerations: []
probe:
enabled: false
path: "/"
+1 -1
View File
@@ -14,5 +14,5 @@ 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.55.0
version: 0.61.0
@@ -5,6 +5,15 @@ metadata:
namespace: {{ .Release.Namespace }}
labels:
{{- include "staticSite.labels" . | nindent 4 }}
{{- if or .Values.gitRepository .Values.gitSha }}
annotations:
{{- if .Values.gitRepository }}
gimlet.io/git-repository: {{ .Values.gitRepository }}
{{- end }}
{{- if .Values.gitSha }}
gimlet.io/git-sha: {{ .Values.gitSha }}
{{- end }}
{{- end }}
spec:
replicas: {{ .Values.replicaCount }}
selector:
+4 -4
View File
@@ -25,21 +25,21 @@
"type": "string",
"title": "Repo url",
"description": "The static site's git repository",
"default": "https://github.com/gimlet-io/hugo-site.git"
"default": "https://github.com/gimlet-io/reactjs-test-app.git"
},
"buildImage": {
"$id": "#/properties/buildImage",
"type": "string",
"title": "Build image",
"description": "The image that will be used for the build proccess",
"default": "bitnami/git:latest"
"default": "node:latest"
},
"buildScript": {
"$id": "#/properties/buildScript",
"type": "string",
"title": "Build script",
"description": "Commands required for the build to be completed",
"default": "# !/usr/bin/env bash\n# pre -reqs\napt-get update && apt-get install -y wget\n\n# Setting up Hugo \nwget https://github.com/gohugoio/hugo/releases/download/v0.111.3/hugo_0.111.3_Linux-64bit.tar.gz &&\ntar -xzf hugo_0.111.3_Linux-64bit.tar.gz &&\nchmod +x hugo\n\n./hugo"
"default": "# !/usr/bin/env bash\n\nnpm install\nnpm run build"
},
"builtAssets": {
@@ -47,7 +47,7 @@
"type": "string",
"title": "Built assets",
"description": "The folder containing the build's generated files",
"default": "public/"
"default": "build/"
},
"ingress": {
"$id": "#/properties/ingress",
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+335 -113
View File
File diff suppressed because it is too large Load Diff
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+1 -1
View File
@@ -2,7 +2,7 @@ ingress:
host: chart-example.local
ingressClassName: nginx
gitRepository: github.com/laszlocph/demo-app
gitRepository: laszlocph/demo-app
gitSha: xyz