Skip to content

Commit 3326b76

Browse files
authored
Merge pull request #14 from spring-financial-group/update-chart-testing
chore: update container args & fix GitHub actions
2 parents 283c0b9 + 88f6dac commit 3326b76

File tree

7 files changed

+79
-50
lines changed

7 files changed

+79
-50
lines changed

.github/workflows/lint-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
python-version: 3.7
2222

2323
- name: Set up chart-testing
24-
uses: helm/chart-testing-action@v2.4.0
24+
uses: helm/chart-testing-action@v2.6.1
2525

2626
- name: Run chart-testing (list-changed)
2727
id: list-changed

Makefile

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,38 @@
11
NAME := tekton-dashboard
22
CHART_DIR := charts/${NAME}
33
CHART_VERSION ?= latest
4+
RESOURCE_YAML := ${CHART_DIR}/templates/resource.yaml
45

56
CHART_REPO := gs://jenkinsxio/charts
67

78
fetch:
89
rm -f ${CHART_DIR}/templates/*.yaml
910
mkdir -p ${CHART_DIR}/templates
1011
ifeq ($(CHART_VERSION),latest)
11-
curl -sS https://storage.googleapis.com/tekton-releases/dashboard/latest/release.yaml > ${CHART_DIR}/templates/resource.yaml
12+
curl -sS https://storage.googleapis.com/tekton-releases/dashboard/latest/release.yaml > ${RESOURCE_YAML}
1213
else
13-
curl -sS https://storage.googleapis.com/tekton-releases/dashboard/previous/v${CHART_VERSION}/release.yaml > ${CHART_DIR}/templates/resource.yaml
14+
curl -sS https://storage.googleapis.com/tekton-releases/dashboard/previous/v${CHART_VERSION}/release.yaml > ${RESOURCE_YAML}
1415
endif
16+
# Split and rename resource.yaml
1517
jx gitops split -d ${CHART_DIR}/templates
1618
jx gitops rename -d ${CHART_DIR}/templates
17-
# kustomize the resources to include some helm template blocs
18-
kustomize build ${CHART_DIR} | sed '/helmTemplateRemoveMe/d' > ${CHART_DIR}/templates/resource.yaml
1919
# Remove namespace from metadata to force with helm install
2020
find $(CHART_DIR)/templates -type f -name "*.yaml" -exec yq -i eval 'del(.metadata.namespace)' "{}" \;
2121
# Amend subjects.namespace with release.namespace
2222
find . -type f \( -name "*-crb.yaml" -o -name "*-rb.yaml" \) -exec yq -i '(.subjects[] | select(has("namespace"))).namespace = "{{ .Release.Namespace }}"' "{}" \;
23+
# Add dynamic external-logs container arg
24+
yq '.spec.template.spec.containers[0].args[] | split("=") | [.[0] | sub("^--","") , .[1] ] as $$item ireduce({}; .[$$item[0]] = $$item[1])' $(CHART_DIR)/templates/tekton-dashboard-deploy.yaml > args.yaml
25+
yq -i '.args = load("args.yaml")' $(CHART_DIR)/values.yaml
26+
# kustomize the resources to include some helm template blocs
27+
kustomize build ${CHART_DIR} | sed '/helmTemplateRemoveMe/d' > ${CHART_DIR}/templates/resource.yaml
2328
jx gitops split -d ${CHART_DIR}/templates
2429
jx gitops rename -d ${CHART_DIR}/templates
30+
# Remove temporary files
31+
rm -f ${RESOURCE_YAML} args.yaml
32+
# Copy src templates
2533
cp src/templates/* ${CHART_DIR}/templates
2634
ifneq ($(CHART_VERSION),latest)
27-
sed -i "s/^appVersion:.*/appVersion: ${CHART_VERSION}/" ${CHART_DIR}/Chart.yaml
35+
sed -i "" -e "s/^appVersion:.*/appVersion: ${CHART_VERSION}/" ${CHART_DIR}/Chart.yaml
2836
endif
2937

3038
build:

charts/tekton-dashboard/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
apiVersion: v2
22
description: A Helm chart for Tekton Pipelines Dashboard
33
name: tekton-dashboard
4-
version: 0.0.5
4+
version: 0.1.0
55
appVersion: 0.35.0
66
icon: https://avatars2.githubusercontent.com/u/47602533
77
home: https://github.com/jenkins-x/tekton-dashboard-helm-chart

charts/tekton-dashboard/kustomization.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,7 @@ apiVersion: kustomize.config.k8s.io/v1beta1
22
kind: Kustomization
33

44
resources:
5+
- templates/tekton-dashboard-deploy.yaml
56

67
patchesStrategicMerge:
8+
- patches/tekton-dashboard-deploy.yaml
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
name: tekton-dashboard
5+
spec:
6+
template:
7+
spec:
8+
containers:
9+
- name: tekton-dashboard
10+
args:
11+
- helmTemplateRemoveMe: |
12+
{{- range $key, $value := .Values.args }}
13+
- --{{ $key }}={{ $value }}
14+
{{- end }}

charts/tekton-dashboard/templates/tekton-dashboard-deploy.yaml

Lines changed: 31 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -31,44 +31,37 @@ spec:
3131
name: tekton-dashboard
3232
spec:
3333
containers:
34-
- args:
35-
- --port=9097
36-
- --logout-url=
37-
- --pipelines-namespace=tekton-pipelines
38-
- --triggers-namespace=tekton-pipelines
39-
- --read-only=true
40-
- --log-level=info
41-
- --log-format=json
42-
- --namespace=
43-
- --stream-logs=true
44-
- --external-logs=
45-
env:
46-
- name: INSTALLED_NAMESPACE
47-
valueFrom:
48-
fieldRef:
49-
fieldPath: metadata.namespace
50-
image: gcr.io/tekton-releases/github.com/tektoncd/dashboard/cmd/dashboard:v0.35.0@sha256:057471aa317c900e30178d64d83fc9d32cf2fcd718632243f7b902403b64981b
51-
livenessProbe:
52-
httpGet:
53-
path: /health
54-
port: 9097
55-
name: tekton-dashboard
56-
ports:
57-
- containerPort: 9097
58-
readinessProbe:
59-
httpGet:
60-
path: /readiness
61-
port: 9097
62-
securityContext:
63-
allowPrivilegeEscalation: false
64-
capabilities:
65-
drop:
66-
- ALL
67-
runAsGroup: 65532
68-
runAsNonRoot: true
69-
runAsUser: 65532
70-
seccompProfile:
71-
type: RuntimeDefault
34+
- args:
35+
{{- range $key, $value := .Values.args }}
36+
- --{{ $key }}={{ $value }}
37+
{{- end }}
38+
env:
39+
- name: INSTALLED_NAMESPACE
40+
valueFrom:
41+
fieldRef:
42+
fieldPath: metadata.namespace
43+
image: gcr.io/tekton-releases/github.com/tektoncd/dashboard/cmd/dashboard:v0.35.0@sha256:057471aa317c900e30178d64d83fc9d32cf2fcd718632243f7b902403b64981b
44+
livenessProbe:
45+
httpGet:
46+
path: /health
47+
port: 9097
48+
name: tekton-dashboard
49+
ports:
50+
- containerPort: 9097
51+
readinessProbe:
52+
httpGet:
53+
path: /readiness
54+
port: 9097
55+
securityContext:
56+
allowPrivilegeEscalation: false
57+
capabilities:
58+
drop:
59+
- ALL
60+
runAsGroup: 65532
61+
runAsNonRoot: true
62+
runAsUser: 65532
63+
seccompProfile:
64+
type: RuntimeDefault
7265
nodeSelector:
7366
kubernetes.io/os: linux
7467
serviceAccountName: tekton-dashboard

charts/tekton-dashboard/values.yaml

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,16 @@ authHost:
1010
# deploy oauth2 proxy as a dependency with tekton-dashboard-helm-chart to manage authorisation with GitHub
1111
# add clientID, clientSecret, cookieSecret or use existingSecret to attach to a secret
1212
oauth2-proxy:
13-
# enable or disable oauth2-proxy: default = false
13+
# enable or disable oauth2-proxy: default = false
1414
enabled: false
1515
config:
1616
clientID: your-githubClient
1717
clientSecret: your-githubSecret
18-
# cookieSecret: your-cookieSecret
19-
# existingSecret: test # enter secret name here
18+
# cookieSecret: your-cookieSecret
19+
# existingSecret: test # enter secret name here
2020
extraArgs:
2121
provider: github
22-
# scope user:email (fix for version 6.13.1 Github issues)
22+
# scope user:email (fix for version 6.13.1 Github issues)
2323
scope: user:email
2424
github-org: your-org
2525
cookie-domain: .example.com
@@ -31,7 +31,7 @@ oauth2-proxy:
3131
className: nginx
3232
annotations:
3333
acme.cert-manager.io/http01-edit-in-place: "true"
34-
# add or remove cert manger dependent on use case. Add clusterIssuer lets-encrypt below
34+
# add or remove cert manger dependent on use case. Add clusterIssuer lets-encrypt below
3535
cert-manager.io/cluster-issuer: letsencrypt-yourEnv
3636
kubernetes.io/tls-acme: "true"
3737
hosts:
@@ -40,3 +40,15 @@ oauth2-proxy:
4040
- hosts:
4141
- example.com
4242
secretName: example.com
43+
# args passed to the dashboard container
44+
args:
45+
port: "9097"
46+
logout-url: ""
47+
pipelines-namespace: tekton-pipelines
48+
triggers-namespace: tekton-pipelines
49+
read-only: "true"
50+
log-level: info
51+
log-format: json
52+
namespace: ""
53+
stream-logs: "true"
54+
external-logs: ""

0 commit comments

Comments
 (0)