Skip to content
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

chore: update container args & fix GitHub actions #14

Merged
merged 6 commits into from
Oct 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/lint-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
python-version: 3.7

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

- name: Run chart-testing (list-changed)
id: list-changed
Expand Down
18 changes: 13 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,30 +1,38 @@
NAME := tekton-dashboard
CHART_DIR := charts/${NAME}
CHART_VERSION ?= latest
RESOURCE_YAML := ${CHART_DIR}/templates/resource.yaml

CHART_REPO := gs://jenkinsxio/charts

fetch:
rm -f ${CHART_DIR}/templates/*.yaml
mkdir -p ${CHART_DIR}/templates
ifeq ($(CHART_VERSION),latest)
curl -sS https://storage.googleapis.com/tekton-releases/dashboard/latest/release.yaml > ${CHART_DIR}/templates/resource.yaml
curl -sS https://storage.googleapis.com/tekton-releases/dashboard/latest/release.yaml > ${RESOURCE_YAML}
else
curl -sS https://storage.googleapis.com/tekton-releases/dashboard/previous/v${CHART_VERSION}/release.yaml > ${CHART_DIR}/templates/resource.yaml
curl -sS https://storage.googleapis.com/tekton-releases/dashboard/previous/v${CHART_VERSION}/release.yaml > ${RESOURCE_YAML}
endif
# Split and rename resource.yaml
jx gitops split -d ${CHART_DIR}/templates
jx gitops rename -d ${CHART_DIR}/templates
# kustomize the resources to include some helm template blocs
kustomize build ${CHART_DIR} | sed '/helmTemplateRemoveMe/d' > ${CHART_DIR}/templates/resource.yaml
# Remove namespace from metadata to force with helm install
find $(CHART_DIR)/templates -type f -name "*.yaml" -exec yq -i eval 'del(.metadata.namespace)' "{}" \;
# Amend subjects.namespace with release.namespace
find . -type f \( -name "*-crb.yaml" -o -name "*-rb.yaml" \) -exec yq -i '(.subjects[] | select(has("namespace"))).namespace = "{{ .Release.Namespace }}"' "{}" \;
# Add dynamic external-logs container arg
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
yq -i '.args = load("args.yaml")' $(CHART_DIR)/values.yaml
# kustomize the resources to include some helm template blocs
kustomize build ${CHART_DIR} | sed '/helmTemplateRemoveMe/d' > ${CHART_DIR}/templates/resource.yaml
jx gitops split -d ${CHART_DIR}/templates
jx gitops rename -d ${CHART_DIR}/templates
# Remove temporary files
rm -f ${RESOURCE_YAML} args.yaml
# Copy src templates
cp src/templates/* ${CHART_DIR}/templates
ifneq ($(CHART_VERSION),latest)
sed -i "s/^appVersion:.*/appVersion: ${CHART_VERSION}/" ${CHART_DIR}/Chart.yaml
sed -i "" -e "s/^appVersion:.*/appVersion: ${CHART_VERSION}/" ${CHART_DIR}/Chart.yaml
endif

build:
Expand Down
2 changes: 1 addition & 1 deletion charts/tekton-dashboard/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v2
description: A Helm chart for Tekton Pipelines Dashboard
name: tekton-dashboard
version: 0.0.5
version: 0.1.0
appVersion: 0.35.0
icon: https://avatars2.githubusercontent.com/u/47602533
home: https://github.com/jenkins-x/tekton-dashboard-helm-chart
Expand Down
2 changes: 2 additions & 0 deletions charts/tekton-dashboard/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,7 @@ apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

resources:
- templates/tekton-dashboard-deploy.yaml

patchesStrategicMerge:
- patches/tekton-dashboard-deploy.yaml
14 changes: 14 additions & 0 deletions charts/tekton-dashboard/patches/tekton-dashboard-deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: tekton-dashboard
spec:
template:
spec:
containers:
- name: tekton-dashboard
args:
- helmTemplateRemoveMe: |
{{- range $key, $value := .Values.args }}
- --{{ $key }}={{ $value }}
{{- end }}
69 changes: 31 additions & 38 deletions charts/tekton-dashboard/templates/tekton-dashboard-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,44 +31,37 @@ spec:
name: tekton-dashboard
spec:
containers:
- args:
- --port=9097
- --logout-url=
- --pipelines-namespace=tekton-pipelines
- --triggers-namespace=tekton-pipelines
- --read-only=true
- --log-level=info
- --log-format=json
- --namespace=
- --stream-logs=true
- --external-logs=
env:
- name: INSTALLED_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
image: gcr.io/tekton-releases/github.com/tektoncd/dashboard/cmd/dashboard:v0.35.0@sha256:057471aa317c900e30178d64d83fc9d32cf2fcd718632243f7b902403b64981b
livenessProbe:
httpGet:
path: /health
port: 9097
name: tekton-dashboard
ports:
- containerPort: 9097
readinessProbe:
httpGet:
path: /readiness
port: 9097
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
runAsGroup: 65532
runAsNonRoot: true
runAsUser: 65532
seccompProfile:
type: RuntimeDefault
- args:
{{- range $key, $value := .Values.args }}
- --{{ $key }}={{ $value }}
{{- end }}
env:
- name: INSTALLED_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
image: gcr.io/tekton-releases/github.com/tektoncd/dashboard/cmd/dashboard:v0.35.0@sha256:057471aa317c900e30178d64d83fc9d32cf2fcd718632243f7b902403b64981b
livenessProbe:
httpGet:
path: /health
port: 9097
name: tekton-dashboard
ports:
- containerPort: 9097
readinessProbe:
httpGet:
path: /readiness
port: 9097
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
runAsGroup: 65532
runAsNonRoot: true
runAsUser: 65532
seccompProfile:
type: RuntimeDefault
nodeSelector:
kubernetes.io/os: linux
serviceAccountName: tekton-dashboard
Expand Down
22 changes: 17 additions & 5 deletions charts/tekton-dashboard/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@ authHost:
# deploy oauth2 proxy as a dependency with tekton-dashboard-helm-chart to manage authorisation with GitHub
# add clientID, clientSecret, cookieSecret or use existingSecret to attach to a secret
oauth2-proxy:
# enable or disable oauth2-proxy: default = false
# enable or disable oauth2-proxy: default = false
enabled: false
config:
clientID: your-githubClient
clientSecret: your-githubSecret
# cookieSecret: your-cookieSecret
# existingSecret: test # enter secret name here
# cookieSecret: your-cookieSecret
# existingSecret: test # enter secret name here
extraArgs:
provider: github
# scope user:email (fix for version 6.13.1 Github issues)
# scope user:email (fix for version 6.13.1 Github issues)
scope: user:email
github-org: your-org
cookie-domain: .example.com
Expand All @@ -31,7 +31,7 @@ oauth2-proxy:
className: nginx
annotations:
acme.cert-manager.io/http01-edit-in-place: "true"
# add or remove cert manger dependent on use case. Add clusterIssuer lets-encrypt below
# add or remove cert manger dependent on use case. Add clusterIssuer lets-encrypt below
cert-manager.io/cluster-issuer: letsencrypt-yourEnv
kubernetes.io/tls-acme: "true"
hosts:
Expand All @@ -40,3 +40,15 @@ oauth2-proxy:
- hosts:
- example.com
secretName: example.com
# args passed to the dashboard container
args:
port: "9097"
logout-url: ""
pipelines-namespace: tekton-pipelines
triggers-namespace: tekton-pipelines
read-only: "true"
log-level: info
log-format: json
namespace: ""
stream-logs: "true"
external-logs: ""
Loading