fix(triggers): updates tekton triggers chart
This patch updates the tekton trigger charts to: 1. align with the latest upstream manifests where resources between the webhook and the controller are now separated out; 2. add liveness and readiness probes to the webhook deployment; 3. changed the naming convention of the files to be: <k8s resource>-<name separated by _>.yaml for easier identification. Signed-off-by: Tin Lam <tin@irrational.io> Change-Id: I8adac3f4882b8ad38bfe57d5873f36c86aa7f0a0
This commit is contained in:
parent
31df1636d8
commit
e00a3f52eb
@ -1,4 +1,4 @@
|
|||||||
{{- define "clusterrole_admin-triggers" -}}
|
{{- define "clusterrole-admin" -}}
|
||||||
---
|
---
|
||||||
kind: ClusterRole
|
kind: ClusterRole
|
||||||
apiVersion: rbac.authorization.k8s.io/v1
|
apiVersion: rbac.authorization.k8s.io/v1
|
||||||
@ -93,4 +93,4 @@ rules:
|
|||||||
- watch
|
- watch
|
||||||
...
|
...
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{- include "helpers.template.overlay" ( dict "Global" $ "template_definition" "clusterrole_admin-triggers" ) }}
|
{{- include "helpers.template.overlay" ( dict "Global" $ "template_definition" "clusterrole-admin" ) }}
|
@ -1,4 +1,4 @@
|
|||||||
{{- define "clusterrole_aggregate_edit-triggers" -}}
|
{{- define "clusterrole-aggregate_edit" -}}
|
||||||
---
|
---
|
||||||
apiVersion: rbac.authorization.k8s.io/v1
|
apiVersion: rbac.authorization.k8s.io/v1
|
||||||
kind: ClusterRole
|
kind: ClusterRole
|
||||||
@ -27,4 +27,4 @@ rules:
|
|||||||
- watch
|
- watch
|
||||||
...
|
...
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{- include "helpers.template.overlay" ( dict "Global" $ "template_definition" "clusterrole_aggregate_edit-triggers" ) }}
|
{{- include "helpers.template.overlay" ( dict "Global" $ "template_definition" "clusterrole-aggregate_edit" ) }}
|
@ -1,4 +1,4 @@
|
|||||||
{{- define "clusterrole_aggregate_view-triggers" -}}
|
{{- define "clusterrole-aggregate_view" -}}
|
||||||
---
|
---
|
||||||
apiVersion: rbac.authorization.k8s.io/v1
|
apiVersion: rbac.authorization.k8s.io/v1
|
||||||
kind: ClusterRole
|
kind: ClusterRole
|
||||||
@ -21,4 +21,4 @@ rules:
|
|||||||
- watch
|
- watch
|
||||||
...
|
...
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{- include "helpers.template.overlay" ( dict "Global" $ "template_definition" "clusterrole_aggregate_view-triggers" ) }}
|
{{- include "helpers.template.overlay" ( dict "Global" $ "template_definition" "clusterrole-aggregate_view" ) }}
|
@ -1,4 +1,4 @@
|
|||||||
{{- define "clusterrolebinding_controller-triggers" -}}
|
{{- define "clusterrolebinding-controller_admin" -}}
|
||||||
---
|
---
|
||||||
apiVersion: rbac.authorization.k8s.io/v1
|
apiVersion: rbac.authorization.k8s.io/v1
|
||||||
kind: ClusterRoleBinding
|
kind: ClusterRoleBinding
|
||||||
@ -15,4 +15,4 @@ subjects:
|
|||||||
namespace: {{ $.Release.Namespace }}
|
namespace: {{ $.Release.Namespace }}
|
||||||
...
|
...
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{- include "helpers.template.overlay" ( dict "Global" $ "template_definition" "clusterrolebinding_controller-triggers" ) }}
|
{{- include "helpers.template.overlay" ( dict "Global" $ "template_definition" "clusterrolebinding-controller_admin" ) }}
|
@ -0,0 +1,18 @@
|
|||||||
|
{{- define "clusterrolebinding-webhook_admin" -}}
|
||||||
|
---
|
||||||
|
apiVersion: rbac.authorization.k8s.io/v1
|
||||||
|
kind: ClusterRoleBinding
|
||||||
|
metadata:
|
||||||
|
labels: {{- include "helpers.labels.labels" (dict "Global" $ "Component" "tekton" "PartOf" "tekton-triggers") | nindent 4 }}
|
||||||
|
name: tekton-triggers-webhook-admin
|
||||||
|
roleRef:
|
||||||
|
kind: ClusterRole
|
||||||
|
name: tekton-triggers-admin
|
||||||
|
apiGroup: rbac.authorization.k8s.io
|
||||||
|
subjects:
|
||||||
|
- kind: ServiceAccount
|
||||||
|
name: tekton-triggers-webhook
|
||||||
|
namespace: {{ $.Release.Namespace }}
|
||||||
|
...
|
||||||
|
{{- end -}}
|
||||||
|
{{- include "helpers.template.overlay" ( dict "Global" $ "template_definition" "clusterrolebinding-webhook_admin" ) }}
|
@ -1,4 +1,4 @@
|
|||||||
{{- define "config_logging-triggers" -}}
|
{{- define "config-logging" -}}
|
||||||
---
|
---
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: ConfigMap
|
kind: ConfigMap
|
||||||
@ -12,4 +12,4 @@ data:
|
|||||||
loglevel.eventlistener: {{ $.Values.config.loglevel.eventlistener | quote }}
|
loglevel.eventlistener: {{ $.Values.config.loglevel.eventlistener | quote }}
|
||||||
...
|
...
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{- include "helpers.template.overlay" ( dict "Global" $ "template_definition" "config_logging-triggers" ) }}
|
{{- include "helpers.template.overlay" ( dict "Global" $ "template_definition" "config-logging" ) }}
|
@ -1,4 +1,4 @@
|
|||||||
{{- define "config_observability-triggers" -}}
|
{{- define "config-observability" -}}
|
||||||
---
|
---
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: ConfigMap
|
kind: ConfigMap
|
||||||
@ -7,4 +7,4 @@ metadata:
|
|||||||
data:
|
data:
|
||||||
{{- $.Values.configobservability | toYaml | nindent 2 }}
|
{{- $.Values.configobservability | toYaml | nindent 2 }}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{- include "helpers.template.overlay" ( dict "Global" $ "template_definition" "config_observability-triggers" ) }}
|
{{- include "helpers.template.overlay" ( dict "Global" $ "template_definition" "config-observability" ) }}
|
@ -1,4 +1,4 @@
|
|||||||
{{- define "config_validation-triggers" -}}
|
{{- define "config-validation" -}}
|
||||||
---
|
---
|
||||||
apiVersion: admissionregistration.k8s.io/v1
|
apiVersion: admissionregistration.k8s.io/v1
|
||||||
kind: ValidatingWebhookConfiguration
|
kind: ValidatingWebhookConfiguration
|
||||||
@ -20,4 +20,4 @@ webhooks:
|
|||||||
operator: Exists
|
operator: Exists
|
||||||
...
|
...
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{- include "helpers.template.overlay" ( dict "Global" $ "template_definition" "config_validation-triggers" ) }}
|
{{- include "helpers.template.overlay" ( dict "Global" $ "template_definition" "config-validation" ) }}
|
@ -21,7 +21,7 @@ spec:
|
|||||||
annotations:
|
annotations:
|
||||||
cluster-autoscaler.kubernetes.io/safe-to-evict: "false"
|
cluster-autoscaler.kubernetes.io/safe-to-evict: "false"
|
||||||
spec:
|
spec:
|
||||||
serviceAccountName: tekton-triggers-controller
|
serviceAccountName: tekton-triggers-webhook
|
||||||
nodeSelector: {{- include "helpers.pod.node_selector" ( dict "Global" $ "Application" "tekton_webhook" ) | nindent 8 }}
|
nodeSelector: {{- include "helpers.pod.node_selector" ( dict "Global" $ "Application" "tekton_webhook" ) | nindent 8 }}
|
||||||
terminationGracePeriodSeconds: 30
|
terminationGracePeriodSeconds: 30
|
||||||
containers:
|
containers:
|
||||||
@ -51,6 +51,20 @@ spec:
|
|||||||
securityContext:
|
securityContext:
|
||||||
allowPrivilegeEscalation: false
|
allowPrivilegeEscalation: false
|
||||||
runAsUser: 65532
|
runAsUser: 65532
|
||||||
|
readinessProbe:
|
||||||
|
httpGet:
|
||||||
|
path: /
|
||||||
|
scheme: HTTPS
|
||||||
|
port: {{ $.Values.params.endpoints.ports.webhook.target }}
|
||||||
|
initialDelaySeconds: 30
|
||||||
|
periodSeconds: 15
|
||||||
|
livenessProbe:
|
||||||
|
httpGet:
|
||||||
|
path: /
|
||||||
|
scheme: HTTPS
|
||||||
|
port: {{ $.Values.params.endpoints.ports.webhook.target }}
|
||||||
|
initialDelaySeconds: 60
|
||||||
|
periodSeconds: 30
|
||||||
volumes: []
|
volumes: []
|
||||||
...
|
...
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
{{- define "webhook-triggers" -}}
|
{{- define "mutatingwebhookconfig-webhook" -}}
|
||||||
---
|
---
|
||||||
apiVersion: admissionregistration.k8s.io/v1
|
apiVersion: admissionregistration.k8s.io/v1
|
||||||
kind: MutatingWebhookConfiguration
|
kind: MutatingWebhookConfiguration
|
||||||
@ -16,4 +16,4 @@ webhooks:
|
|||||||
name: webhook.triggers.tekton.dev
|
name: webhook.triggers.tekton.dev
|
||||||
...
|
...
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{- include "helpers.template.overlay" ( dict "Global" $ "template_definition" "webhook-triggers" ) }}
|
{{- include "helpers.template.overlay" ( dict "Global" $ "template_definition" "mutatingwebhookconfig-webhook" ) }}
|
19
charts/tekton-triggers/templates/role-admin.yaml
Normal file
19
charts/tekton-triggers/templates/role-admin.yaml
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
{{- define "role_admin-triggers" -}}
|
||||||
|
---
|
||||||
|
kind: Role
|
||||||
|
apiVersion: rbac.authorization.k8s.io/v1
|
||||||
|
metadata:
|
||||||
|
labels: {{- include "helpers.labels.labels" (dict "Global" $ "Component" "tekton" "PartOf" "tekton-triggers") | nindent 4 }}
|
||||||
|
name: tekton-triggers-admin
|
||||||
|
namespace: {{ $.Release.Namespace }}
|
||||||
|
rules:
|
||||||
|
- apiGroups:
|
||||||
|
- policy
|
||||||
|
resources:
|
||||||
|
- podsecuritypolicies
|
||||||
|
resourceNames:
|
||||||
|
- tekton-triggers
|
||||||
|
verbs:
|
||||||
|
- use
|
||||||
|
{{- end -}}
|
||||||
|
{{- include "helpers.template.overlay" ( dict "Global" $ "template_definition" "role_admin-triggers" ) }}
|
@ -1,10 +1,10 @@
|
|||||||
{{- define "role_admin-triggers" -}}
|
{{- define "role-webhook_admin" -}}
|
||||||
---
|
---
|
||||||
kind: Role
|
kind: Role
|
||||||
apiVersion: rbac.authorization.k8s.io/v1
|
apiVersion: rbac.authorization.k8s.io/v1
|
||||||
metadata:
|
metadata:
|
||||||
labels: {{- include "helpers.labels.labels" (dict "Global" $ "Component" "tekton" "PartOf" "tekton-triggers") | nindent 4 }}
|
labels: {{- include "helpers.labels.labels" (dict "Global" $ "Component" "tekton" "PartOf" "tekton-triggers") | nindent 4 }}
|
||||||
name: tekton-triggers-admin
|
name: tekton-triggers-admin-webhook
|
||||||
namespace: {{ $.Release.Namespace }}
|
namespace: {{ $.Release.Namespace }}
|
||||||
rules:
|
rules:
|
||||||
- apiGroups:
|
- apiGroups:
|
||||||
@ -28,4 +28,4 @@ rules:
|
|||||||
- patch
|
- patch
|
||||||
- watch
|
- watch
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{- include "helpers.template.overlay" ( dict "Global" $ "template_definition" "role_admin-triggers" ) }}
|
{{- include "helpers.template.overlay" ( dict "Global" $ "template_definition" "role-webhook_admin" ) }}
|
@ -1,4 +1,4 @@
|
|||||||
{{- define "rolebinding_controller-triggers" -}}
|
{{- define "rolebinding-controller_admin" -}}
|
||||||
|
|
||||||
---
|
---
|
||||||
apiVersion: rbac.authorization.k8s.io/v1
|
apiVersion: rbac.authorization.k8s.io/v1
|
||||||
@ -18,4 +18,4 @@ roleRef:
|
|||||||
name: tekton-triggers-admin
|
name: tekton-triggers-admin
|
||||||
apiGroup: rbac.authorization.k8s.io
|
apiGroup: rbac.authorization.k8s.io
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{- include "helpers.template.overlay" ( dict "Global" $ "template_definition" "rolebinding_controller-triggers" ) }}
|
{{- include "helpers.template.overlay" ( dict "Global" $ "template_definition" "rolebinding-controller_admin" ) }}
|
@ -0,0 +1,20 @@
|
|||||||
|
{{- define "rolebinding-webhook_admin" -}}
|
||||||
|
---
|
||||||
|
apiVersion: rbac.authorization.k8s.io/v1
|
||||||
|
kind: RoleBinding
|
||||||
|
metadata:
|
||||||
|
name: tekton-triggers-webhook-admin
|
||||||
|
namespace: tekton-pipelines
|
||||||
|
labels:
|
||||||
|
app.kubernetes.io/instance: tekton-triggers
|
||||||
|
app.kubernetes.io/part-of: tekton-triggers
|
||||||
|
subjects:
|
||||||
|
- kind: ServiceAccount
|
||||||
|
name: tekton-triggers-webhook
|
||||||
|
namespace: {{ $.Release.Namespace }}
|
||||||
|
roleRef:
|
||||||
|
kind: Role
|
||||||
|
name: tekton-triggers-admin-webhook
|
||||||
|
apiGroup: rbac.authorization.k8s.io
|
||||||
|
{{- end -}}
|
||||||
|
{{- include "helpers.template.overlay" ( dict "Global" $ "template_definition" "rolebinding-webhook_admin" ) }}
|
11
charts/tekton-triggers/templates/serviceaccount-webhook.yaml
Normal file
11
charts/tekton-triggers/templates/serviceaccount-webhook.yaml
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
{{- define "serviceaccount-webhook" -}}
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: ServiceAccount
|
||||||
|
metadata:
|
||||||
|
labels: {{- include "helpers.labels.labels" (dict "Global" $ "Component" "tekton" "PartOf" "tekton-triggers") | nindent 4 }}
|
||||||
|
name: tekton-triggers-webhook
|
||||||
|
namespace: {{ $.Release.Namespace }}
|
||||||
|
...
|
||||||
|
{{- end -}}
|
||||||
|
{{- include "helpers.template.overlay" ( dict "Global" $ "template_definition" "serviceaccount-webhook" ) }}
|
@ -1,4 +1,4 @@
|
|||||||
{{- define "webhook_validation-triggers" -}}
|
{{- define "validatingwebhookconfig-webhook" -}}
|
||||||
---
|
---
|
||||||
apiVersion: admissionregistration.k8s.io/v1
|
apiVersion: admissionregistration.k8s.io/v1
|
||||||
kind: ValidatingWebhookConfiguration
|
kind: ValidatingWebhookConfiguration
|
||||||
@ -16,4 +16,4 @@ webhooks:
|
|||||||
name: validation.webhook.triggers.tekton.dev
|
name: validation.webhook.triggers.tekton.dev
|
||||||
...
|
...
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{- include "helpers.template.overlay" ( dict "Global" $ "template_definition" "webhook_validation-triggers" ) }}
|
{{- include "helpers.template.overlay" ( dict "Global" $ "template_definition" "validatingwebhookconfig-webhook" ) }}
|
@ -4,35 +4,16 @@ set -eux
|
|||||||
|
|
||||||
TEKTON_NS="tekton-pipelines"
|
TEKTON_NS="tekton-pipelines"
|
||||||
|
|
||||||
# Runs the tekton pipeline trigger test
|
|
||||||
function retry {
|
|
||||||
local n=1
|
|
||||||
local max=5
|
|
||||||
local delay=10
|
|
||||||
|
|
||||||
while true; do
|
|
||||||
"$@" && break || {
|
|
||||||
if [[ $n -lt $max ]]; then
|
|
||||||
(( n++ ))
|
|
||||||
sleep $delay
|
|
||||||
else
|
|
||||||
echo "failed after $n attempts." >&2
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
done
|
|
||||||
}
|
|
||||||
|
|
||||||
sleep 60
|
sleep 60
|
||||||
|
|
||||||
kubectl -n $TEKTON_NS apply -f ./tools/gate/tekton/yaml/role-resources/secret.yaml
|
kubectl -n $TEKTON_NS apply -f ./tools/gate/tekton/yaml/role-resources/secret.yaml
|
||||||
kubectl -n $TEKTON_NS apply -f ./tools/gate/tekton/yaml/role-resources/serviceaccount.yaml
|
kubectl -n $TEKTON_NS apply -f ./tools/gate/tekton/yaml/role-resources/serviceaccount.yaml
|
||||||
kubectl -n $TEKTON_NS apply -f ./tools/gate/tekton/yaml/role-resources/clustertriggerbinding-roles
|
kubectl -n $TEKTON_NS apply -f ./tools/gate/tekton/yaml/role-resources/clustertriggerbinding-roles
|
||||||
kubectl -n $TEKTON_NS apply -f ./tools/gate/tekton/yaml/role-resources/triggerbinding-roles
|
kubectl -n $TEKTON_NS apply -f ./tools/gate/tekton/yaml/role-resources/triggerbinding-roles
|
||||||
retry kubectl -n $TEKTON_NS apply -f ./tools/gate/tekton/yaml/triggertemplates/triggertemplate.yaml
|
kubectl -n $TEKTON_NS apply -f ./tools/gate/tekton/yaml/triggertemplates/triggertemplate.yaml
|
||||||
retry kubectl -n $TEKTON_NS apply -f ./tools/gate/tekton/yaml/triggerbindings/triggerbinding.yaml
|
kubectl -n $TEKTON_NS apply -f ./tools/gate/tekton/yaml/triggerbindings/triggerbinding.yaml
|
||||||
retry kubectl -n $TEKTON_NS apply -f ./tools/gate/tekton/yaml/triggerbindings/triggerbinding-message.yaml
|
kubectl -n $TEKTON_NS apply -f ./tools/gate/tekton/yaml/triggerbindings/triggerbinding-message.yaml
|
||||||
retry kubectl -n $TEKTON_NS apply -f ./tools/gate/tekton/yaml/eventlisteners/eventlistener.yaml
|
kubectl -n $TEKTON_NS apply -f ./tools/gate/tekton/yaml/eventlisteners/eventlistener.yaml
|
||||||
|
|
||||||
kubectl -n $TEKTON_NS get svc
|
kubectl -n $TEKTON_NS get svc
|
||||||
kubectl -n $TEKTON_NS get pod
|
kubectl -n $TEKTON_NS get pod
|
||||||
|
Loading…
x
Reference in New Issue
Block a user