Compare commits

..

1 Commits

Author SHA1 Message Date
Youcef Guichi 314defb171 add envFromRef tpl to initcontainers 2023-04-03 10:54:50 +02:00
88 changed files with 199 additions and 1233 deletions
-1
View File
@@ -96,7 +96,6 @@ jobs:
sed -i "s/version: $CHART_VERSION/version: $increased_version/" charts/onechart/Chart.yaml
sed -i "s/version: $CHART_VERSION/version: $increased_version/" charts/cron-job/Chart.yaml
sed -i "s/version: $CHART_VERSION/version: $increased_version/" charts/static-site/Chart.yaml
git status
git add .
-201
View File
@@ -1,201 +0,0 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
+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.4.0
version: 0.2.0
-1
View File
@@ -1,6 +1,5 @@
{{- 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" (printf "%s-%s" $.Release.Name .name) }}
name: {{ template "common.robustName" .fileName }}
namespace: {{ $.Release.Namespace }}
data:
{{ .fileName }}: |
+1 -11
View File
@@ -1,20 +1,10 @@
{{- define "common.envFromRef.tpl" -}}
{{- if or (or (or (or (or (.Values.vars) (.Values.secretEnabled)) .Values.sealedSecrets) .Values.secretName) .Values.existingConfigMaps) .Values.existingSecrets -}}
{{- if or (or (or (.Values.vars) (.Values.secretEnabled)) .Values.sealedSecrets) .Values.secretName }}
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,5 +1,5 @@
{{- define "common.volumeMountsRef.tpl" -}}
{{- if or (or (or (.Values.volumes) (.Values.sealedFileSecrets)) .Values.fileSecrets) .Values.existingFileSecrets -}}
{{- if or (or (or (.Values.volumes) (.Values.sealedFileSecrets)) .Values.fileSecrets) .Values.existingFileSecrets }}
volumeMounts: &volumeMounts
{{- range .Values.volumes }}
{{- if not (hasPrefix "init-" .name) }}
@@ -13,17 +13,11 @@ volumeMounts: &volumeMounts
{{- range .Values.sealedFileSecrets }}
- name: {{ .name }}
mountPath: {{ .path }}
{{- if .subPath}}
subPath: {{ .subPath }}
{{- end }}
readOnly: true
{{- end }}
{{- range .Values.fileSecrets }}
- name: {{ .name }}
mountPath: {{ .path }}
{{- if .subPath}}
subPath: {{ .subPath }}
{{- end }}
readOnly: true
{{- end }}
{{- range .Values.existingFileSecrets }}
+2 -2
View File
@@ -1,5 +1,5 @@
{{- define "common.volumesRef.tpl" -}}
{{- if or (or (or (.Values.volumes) (.Values.sealedFileSecrets)) .Values.fileSecrets) .Values.existingFileSecrets -}}
{{- if or (or (or (.Values.volumes) (.Values.sealedFileSecrets)) .Values.fileSecrets) .Values.existingFileSecrets }}
volumes:
{{- range .Values.volumes }}
- name: {{ .name }}
@@ -10,7 +10,7 @@ volumes:
name: {{ .existingConfigMap }}
{{- else if .fileName }}
configMap:
name: {{ template "common.robustName" (printf "%s-%s" $.Release.Name .name) }}
name: {{ template "common.robustName" .fileName }}
{{- else if .hostPath }}
hostPath:
path: {{ .hostPath.path }}
+3 -3
View File
@@ -1,6 +1,6 @@
dependencies:
- name: common
repository: file://../common
version: 0.4.0
digest: sha256:d4eccd332ada7362f429e04b82022f5605a02e2d3aa7b9fdf8adaf4f6c9e03eb
generated: "2023-10-20T10:53:13.982995773+02:00"
version: 0.2.0
digest: sha256:ea028bf07fdc361daabca0c0155e4511cc4fffda94d2f697f4d16013f250c8a8
generated: "2023-02-17T15:14:21.719376584+01: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.62.0
version: 0.47.0
dependencies:
- name: common
version: 0.4.0
version: 0.2.0
repository: file://../common
Binary file not shown.
Binary file not shown.
-1
View File
@@ -1,7 +1,6 @@
[
{
"schemaIDs": [
"#/properties/schedule",
"#/properties/image",
"#/properties/shell",
"#/properties/command"
-2
View File
@@ -25,12 +25,10 @@ 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:
@@ -1 +0,0 @@
{{- include "common.customFileConfigmap.tpl" . -}}
@@ -1,11 +0,0 @@
suite: test cron job
templates:
- cronJob.yaml
tests:
- it: Should set schedule
set:
schedule: "*/1 * * * *"
asserts:
- equal:
path: spec.schedule
value: "*/1 * * * *"
-7
View File
@@ -238,13 +238,6 @@
"description": "The command to run in the cronjob",
"default": "echo \"I'm alive\""
},
"schedule": {
"$id": "#/properties/schedule",
"type": "string",
"title": "Schedule",
"description": "Schedule your cronjob",
"default": "*/1 * * * *"
},
"vars": {
"$id": "#/properties/vars",
"type": "object",
-1
View File
@@ -5,7 +5,6 @@ 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.4.0
digest: sha256:d4eccd332ada7362f429e04b82022f5605a02e2d3aa7b9fdf8adaf4f6c9e03eb
generated: "2023-10-20T10:52:47.237955041+02:00"
version: 0.2.0
digest: sha256:ea028bf07fdc361daabca0c0155e4511cc4fffda94d2f697f4d16013f250c8a8
generated: "2023-02-17T15:13:57.926786542+01: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.62.0
version: 0.47.0
dependencies:
- name: common
version: 0.4.0
version: 0.2.0
repository: file://../common
Binary file not shown.
Binary file not shown.
+5 -15
View File
@@ -142,33 +142,23 @@
{
"schemaIDs": [
"#/properties/podDisruptionBudgetEnabled",
"#/properties/spreadAcrossNodes",
"#/properties/podAnnotations",
"#/properties/podLabels"
"#/properties/spreadAcrossNodes"
],
"uiSchema": {},
"metaData": {
"name": "Deployment fine-tuning",
"name": "High Availability",
"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/name",
"#/properties/description",
"#/properties/ownerName",
"#/properties/ownerIm",
"#/properties/podAnnotations",
"#/properties/gitSha",
"#/properties/gitRepository",
"#/properties/documentation",
"#/properties/logs",
"#/properties/metrics",
"#/properties/traces",
"#/properties/issues"
"#/properties/gitRepository"
],
"uiSchema": {},
"metaData": {
"name": "Service Catalog",
"name": "Misc",
"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 -15
View File
@@ -39,9 +39,6 @@ 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 }}
@@ -58,6 +55,7 @@ spec:
- name: {{ .name }}
image: "{{ .image }}:{{ .tag }}"
imagePullPolicy: {{ .imagePullPolicy | default "IfNotPresent" }}
{{- include "common.envFromRef.tpl" $ | nindent 10 }}
{{- if .command }}
command:
- {{ $.Values.shell }}
@@ -66,15 +64,11 @@ spec:
{{- end }}
volumeMounts:
{{- range $.Values.volumes }}
{{- if (or (hasPrefix "shared-" .name) (hasPrefix "init-" .name))}}
{{if (or (hasPrefix "shared-" .name) (hasPrefix "init-" .name))}}
- mountPath: {{ .path }}
name: {{ .name }}
{{- end }}
{{- end }}
{{- if .securityContext }}
securityContext:
{{- toYaml .securityContext | nindent 12 }}
{{- end}}
{{- end }}
containers:
- name: {{ template "robustName" .Release.Name }}
@@ -94,7 +88,7 @@ spec:
- name: http
containerPort: {{ .Values.containerPort }}
protocol: TCP
{{- else }}
{{ else }}
{{- range .Values.ports }}
- name: {{ .name }}
containerPort: {{ .containerPort }}
@@ -124,13 +118,8 @@ spec:
{{- include "common.volumeMountsRef.tpl" . | nindent 10 }}
{{- if not .Values.resources.ignore }}
resources:
{{- if .Values.resources.ignoreLimits }}
requests:
{{- toYaml .Values.resources.requests | nindent 14 }}
{{- else }}
{{- toYaml .Values.resources | nindent 12 }}
{{- end }}
{{- end }}
{{- if .Values.sidecar }}
- name: {{ template "robustName" .Release.Name }}-sidecar
securityContext: *securityContext
@@ -141,7 +130,7 @@ spec:
- -c
- {{ .Values.sidecar.command | quote }}
{{- end }}
{{- if or (or (or (or (or (.Values.vars) (.Values.secretEnabled)) .Values.sealedSecrets) .Values.secretName) .Values.existingConfigMaps) .Values.existingSecrets }}
{{- if or (or (.Values.vars) (.Values.secretEnabled)) .Values.sealedSecrets }}
envFrom: *envFrom
{{- end }}
{{- if or (or (.Values.volumes) (.Values.sealedFileSecrets)) .Values.fileSecrets }}
+2 -33
View File
@@ -5,44 +5,13 @@ metadata:
namespace: {{ .Release.Namespace }}
labels:
{{- include "helm-chart.labels" . | nindent 4 }}
{{- if or (or (or (or (or .Values.gitRepository .Values.gitSha) .Values.serviceName) .Values.serviceDescription) .Values.ownerName) .Values.ownerIm }}
{{- if or .Values.gitRepository .Values.gitSha }}
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:
@@ -62,7 +31,7 @@ spec:
{{- if .Values.nodePort }}
nodePort: {{ .Values.nodePort }}
{{- end }}
{{- else }}
{{ else }}
{{- range .Values.ports }}
- name: {{ .name }}
port: {{ if .svcPort }}{{ .svcPort }}{{ else }}{{ .containerPort }}{{ end }}
@@ -1,42 +0,0 @@
{{ if .Values.monitor.enabled }}
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: {{ template "robustName" .Release.Name }}
namespace: {{ .Release.Namespace }}
labels:
{{- include "helm-chart.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:
endpoints:
- interval: 60s
params:
format:
- prometheus
path: {{ default "/metrics" .Values.monitor.path }}
{{ if .Values.monitor.portName }}
port: {{ .Values.monitor.portName }}
{{ else if not .Values.ports }}
port: http
{{ else }}
port: {{ index .Values.ports 0 "name" }}
{{ end }}
scheme: {{ default "http" .Values.monitor.scheme }}
{{ if .Values.monitor.scrapeTimeout }}
scrapeTimeout: {{ .Values.monitor.scrapeTimeout }}
{{ end }}
namespaceSelector:
matchNames:
- "{{ .Release.Namespace }}"
selector:
matchLabels:
{{- include "helm-chart.selectorLabels" . | nindent 6 }}
{{ end }}
@@ -18,21 +18,3 @@ tests:
asserts:
- 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
@@ -18,22 +18,6 @@ tests:
- name: google-account-key
mountPath: /google-account-key
readOnly: true
- it: Should mount volume with optional subPath
set:
fileSecrets:
- name: google-account-key
path: /config/google-account-key
subPath: google-account-key
secrets:
key.json: supersecret
asserts:
- equal:
path: spec.template.spec.containers[0].volumeMounts
value:
- name: google-account-key
mountPath: /config/google-account-key
subPath: google-account-key
readOnly: true
- it: Should reference volume
set:
fileSecrets:
@@ -27,12 +27,5 @@ tests:
path: spec.template.spec.initContainers[0].command
value: ['/bin/sh', '-c', 'while true; do date; sleep 2; done && ls /data && printf something']
- it: Should set security context
set:
initContainers:
- securityContext:
runAsNonRoot: true
asserts:
- equal:
path: spec.template.spec.initContainers[0].securityContext.runAsNonRoot
value: true
@@ -1,17 +0,0 @@
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
@@ -16,25 +16,3 @@ tests:
asserts:
- isNull:
path: spec.template.spec.containers[0].resources
- it: Should ignore resources limits when ignoreLimits flag is set
set:
resources:
ignoreLimits: true
asserts:
- isNull:
path: spec.template.spec.containers[0].resources.limits
- isNotNull:
path: spec.template.spec.containers[0].resources.requests
- it: Should create requests when ignoreLimits flag is set
set:
resources:
ignoreLimits: true
requests:
cpu: "1000m"
memory: "200Mi"
asserts:
- isNotNull:
path: spec.template.spec.containers[0].resources.requests
- equal:
path: spec.template.spec.containers[0].resources.requests.cpu
value: 1000m
@@ -31,20 +31,3 @@ 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: release-name-volume-name
name: myfile-conf
- equal:
path: spec.template.spec.containers[0].volumeMounts
value:
@@ -4,32 +4,11 @@ templates:
tests:
- it: Should set Gimlet taxonomy
set:
gitRepository: laszlocph/demo-app
gitRepository: github.com/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: laszlocph/demo-app
gimlet.io/git-repository: github.com/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
-86
View File
@@ -15,7 +15,6 @@
"nameOverride": "",
"fullnameOverride": "",
"podAnnotations": {},
"podLabels": {},
"podSecurityContext": {
"fsGroup": 999
},
@@ -190,81 +189,6 @@
"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",
@@ -359,16 +283,6 @@
true
]
},
"ignoreLimits": {
"$id": "#/properties/resources/properties/ignoreLimits",
"type": "boolean",
"title": "Ignore limits",
"description": "If set to true, limits in resource configuration will be ignored",
"default": false,
"examples": [
true
]
},
"requests": {
"$id": "#/properties/resources/properties/requests",
"type": "object",
+1 -6
View File
@@ -20,8 +20,6 @@ fullnameOverride: ""
podAnnotations: {}
podLabels: {}
podSecurityContext:
fsGroup: 999
@@ -41,6 +39,7 @@ nodeSelector: {}
tolerations: []
probe:
enabled: false
path: "/"
@@ -70,7 +69,3 @@ podDisruptionBudgetEnabled: true
spreadAcrossNodes: false
nodePortEnabled: false
# Set true to enable service monitor.
monitor:
enabled: false
+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.62.0
version: 0.1.0
+4 -3
View File
@@ -3,13 +3,14 @@
"schemaIDs": [
"#/properties/gitCloneUrl",
"#/properties/buildImage",
"#/properties/buildTag",
"#/properties/buildScript",
"#/properties/builtAssets"
],
"uiSchema": {
"#/properties/buildScript": {
"ui:widget": "textarea",
"ui:rows": 10
"#/properties/buildScript":{
"ui:widget": "textarea"
}
},
"metaData": {
+2 -13
View File
@@ -5,15 +5,6 @@ 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:
@@ -32,9 +23,7 @@ spec:
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- if .Values.serviceAccount }}
serviceAccountName: {{ .Values.serviceAccount }}
{{- end }}
serviceAccountName: {{ template "robustName" .Release.Name }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
volumes:
@@ -42,7 +31,7 @@ spec:
emptyDir: {}
initContainers:
- name: init-con
image: {{ .Values.buildImage }}
image: {{ .Values.buildImage }}:{{ .Values.buildTag }}
{{- if .Values.buildScript }}
command:
- sh
-10
View File
@@ -2,18 +2,8 @@ apiVersion: v1
kind: Service
metadata:
name: {{ template "robustName" .Release.Name }}
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:
type: {{ .Values.service.type }}
ports:
@@ -0,0 +1,12 @@
{{- if .Values.serviceAccount.create -}}
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ template "robustName" .Release.Name }}
labels:
{{- include "staticSite.labels" . | nindent 4 }}
{{- with .Values.serviceAccount.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- end }}
@@ -5,8 +5,11 @@ tests:
- it: Should set image, tag and command
set:
gitCloneUrl: https:/github.com/mycompany/myrepo.git
buildImage: nginx:x.y.z
buildImage: nginx
buildTag: x.y.z
asserts:
- equal:
path: spec.template.spec.initContainers[0].image
value: nginx:x.y.z
+14 -5
View File
@@ -8,7 +8,8 @@
"examples": [
{
"gitCloneUrl": "https://github.com/gimlet-io/hugo-site.git",
"buildImage": "node:latest",
"buildImage": "node",
"buildTag": "latest",
"buildScript": "npm install && npm install -g gatsby-cli && gatsby build",
"builtAssets": "public/"
}
@@ -16,6 +17,7 @@
"required": [
"gitCloneUrl",
"buildImage",
"buildTag",
"buildScript",
"builtAssets"
],
@@ -25,21 +27,27 @@
"type": "string",
"title": "Repo url",
"description": "The static site's git repository",
"default": "https://github.com/gimlet-io/reactjs-test-app.git"
"default": "https://github.com/gimlet-io/hugo-site.git"
},
"buildImage": {
"$id": "#/properties/buildImage",
"type": "string",
"title": "Build image",
"description": "The image that will be used for the build proccess",
"default": "node:latest"
"default":"bitnami/git"
},
"buildTag": {
"$id": "#/properties/buildTag",
"type": "string",
"title": "Image tag",
"default": "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\nnpm install\nnpm run build"
"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"
},
"builtAssets": {
@@ -47,7 +55,7 @@
"type": "string",
"title": "Built assets",
"description": "The folder containing the build's generated files",
"default": "build/"
"default": "public/"
},
"ingress": {
"$id": "#/properties/ingress",
@@ -111,6 +119,7 @@
}
}
}
},
"additionalProperties": true
}
+23 -4
View File
@@ -13,6 +13,15 @@ imagePullSecrets: []
nameOverride: ""
fullnameOverride: ""
serviceAccount:
# Specifies whether a service account should be created
create: true
# Annotations to add to the service account
annotations: {}
# The name of the service account to use.
# If not set and create is true, a name is generated using the fullname template
name: ""
podAnnotations: {}
podSecurityContext: {}
@@ -53,8 +62,18 @@ tolerations: []
affinity: {}
# values to build and deploy static sites
gitCloneUrl: https://github.com/gimlet-io/reactjs-test-app.git
buildImage: "node:latest"
gitCloneUrl: https://github.com/gimlet-io/hugo-site.git
buildImage: bitnami/git # the image must have git installed
buildTag: latest
buildScript: |
npm install && npm run build
builtAssets: build/
# !/usr/bin/env bash
# pre -reqs
apt-get update && apt-get install -y wget
# Setting up Hugo
wget https://github.com/gohugoio/hugo/releases/download/v0.111.3/hugo_0.111.3_Linux-64bit.tar.gz &&
tar -xzf hugo_0.111.3_Linux-64bit.tar.gz &&
chmod +x hugo
./hugo
builtAssets: public/
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.
Binary file not shown.
Binary file not shown.
+95 -605
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.
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.
Binary file not shown.
+3 -5
View File
@@ -2,9 +2,11 @@ ingress:
host: chart-example.local
ingressClassName: nginx
gitRepository: laszlocph/demo-app
gitRepository: github.com/laszlocph/demo-app
gitSha: xyz
vars:
MY_VAR: "value"
volumes:
- name: testing
@@ -14,7 +16,3 @@ volumes:
- name: empty
path: /deleteme2
emptyDir: true
vars:
var1: value1
var2: value2