Skip to content

Commit

Permalink
Update kustomizations to add webhook deployment
Browse files Browse the repository at this point in the history
Modify webhook deployments manifests to make it work with
csv generation.

Update generate CSVs

Signed-off-by: Nikhil Thomas <[email protected]>
  • Loading branch information
nikhil-thomas committed Jul 2, 2021
1 parent fcc07bd commit a622fc2
Show file tree
Hide file tree
Showing 12 changed files with 209 additions and 36 deletions.
30 changes: 1 addition & 29 deletions config/base/webhook.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,32 +19,4 @@ metadata:
labels:
version: "devel"
operator.tekton.dev/release: "devel"
spec:
replicas: 1
selector:
matchLabels:
name: tekton-operator-webhook
template:
metadata:
labels:
name: tekton-operator-webhook
app: tekton-operator
spec:
serviceAccountName: tekton-operator
containers:
- name: webhook
image: "ko://github.com/tektoncd/operator/cmd/kubernetes/webhook"
env:
- name: SYSTEM_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
- name: CONFIG_LOGGING_NAME
value: config-logging
- name: WEBHOOK_SERVICE_NAME
value: tekton-operator-webhook
- name: WEBHOOK_SECRET_NAME
value: tekton-operator-webhook-certs
ports:
- name: https-webhook
containerPort: 8443
spec: {}
4 changes: 4 additions & 0 deletions config/kubernetes/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ patches:
target:
kind: Deployment
name: tekton-operator
- path: webhook.yaml
target:
kind: Deployment
name: tekton-operator-webhook

configMapGenerator:
- name: tekton-config-defaults
Expand Down
50 changes: 50 additions & 0 deletions config/kubernetes/webhook.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Copyright 2021 The Tekton Authors
#
# 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.

apiVersion: apps/v1
kind: Deployment
metadata:
name: tekton-operator-webhook
labels:
version: "devel"
operator.tekton.dev/release: "devel"
spec:
replicas: 1
selector:
matchLabels:
name: tekton-operator-webhook
template:
metadata:
labels:
name: tekton-operator-webhook
app: tekton-operator
spec:
serviceAccountName: tekton-operator
containers:
- name: tekton-operator-webhook
image: ko://github.com/tektoncd/operator/cmd/kubernetes/webhook
env:
- name: SYSTEM_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
- name: CONFIG_LOGGING_NAME
value: config-logging
- name: WEBHOOK_SERVICE_NAME
value: tekton-operator-webhook
- name: WEBHOOK_SECRET_NAME
value: tekton-operator-webhook-certs
ports:
- name: https-webhook
containerPort: 8443
6 changes: 4 additions & 2 deletions config/openshift/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ patches:
target:
kind: Deployment
name: tekton-operator
- path: webhook.yaml
target:
kind: Deployment
name: tekton-operator-webhook
- path: role.yaml
target:
kind: ClusterRole
Expand All @@ -38,8 +42,6 @@ patches:
kind: Deployment
name: tekton-operator-webhook

patchesStrategicMerge:
- 500-webhooks.yaml
resources:
- ../base/
- ../base/300-operator_v1alpha1_addon_crd.yaml
Expand Down
2 changes: 1 addition & 1 deletion config/openshift/operator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ spec:
- name: OPERATOR_NAME
value: redhat-openshift-pipelines-operator
- name: IMAGE_PIPELINES_PROXY
value: ko://github.com/tektoncd/operator/cmd/openshift/proxy-webhook
value: ko://github.com/tektoncd/operator/cmd/openshift/proxy-webhook
- name: IMAGE_JOB_PRUNER_TKN
value: gcr.io/tekton-releases/dogfooding/tkn@sha256:f69a02ef099d8915e9e4ea1b74e43b7a9309fc97cf23cb457ebf191e73491677
# - name: IMAGE_ADDONS_PARAM_TKN_IMAGE
Expand Down
30 changes: 28 additions & 2 deletions config/openshift/webhook.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,35 @@ apiVersion: apps/v1
kind: Deployment
metadata:
name: tekton-operator-webhook
labels:
version: "devel"
operator.tekton.dev/release: "devel"
spec:
replicas: 1
selector:
matchLabels:
name: tekton-operator-webhook
template:
metadata:
labels:
name: tekton-operator-webhook
app: tekton-operator
spec:
serviceAccountName: tekton-operator
containers:
- name: webhook
image: ko://github.com/tektoncd/operator/cmd/openshift/webhook
- name: tekton-operator-webhook
image: ko://github.com/tektoncd/operator/cmd/openshift/webhook
env:
- name: SYSTEM_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
- name: CONFIG_LOGGING_NAME
value: config-logging
- name: WEBHOOK_SERVICE_NAME
value: tekton-operator-webhook
- name: WEBHOOK_SECRET_NAME
value: tekton-operator-webhook-certs
ports:
- name: https-webhook
containerPort: 8443
5 changes: 5 additions & 0 deletions operatorhub/kubernetes/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ image-substitutions:
containerName: tekton-operator
envKeys:
- IMAGE_JOB_PRUNER_TKN
- image: ko://github.com/tektoncd/operator/cmd/kubernetes/webhook
replaceLocations:
containerTargets:
- deploymentName: tekton-operator-webhook
containerName: tekton-operator-webhook

# add thrid party images which are not replaced by operator
# but pulled directly by tasks here
Expand Down
6 changes: 5 additions & 1 deletion operatorhub/openshift/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,11 @@ image-substitutions:
envKeys:
- IMAGE_JOB_PRUNER_TKN
- IMAGE_ADDONS_PARAM_TKN_IMAGE

- image: ko://github.com/tektoncd/operator/cmd/openshift/webhook
replaceLocations:
containerTargets:
- deploymentName: tekton-operator-webhook
containerName: tekton-operator-webhook

# add thrid party images which are not replaced by operator
# but pulled directly by tasks here
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -665,6 +665,57 @@ spec:
name: openshift-pipelines-operator
resources: {}
serviceAccountName: openshift-pipelines-operator
- name: tekton-operator-webhook
spec:
replicas: 1
selector:
matchLabels:
name: tekton-operator-webhook
strategy: {}
template:
metadata:
labels:
app: tekton-operator
name: tekton-operator-webhook
spec:
containers:
- env:
- name: SYSTEM_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
- name: CONFIG_LOGGING_NAME
value: config-logging
- name: WEBHOOK_SERVICE_NAME
value: tekton-operator-webhook
- name: WEBHOOK_SECRET_NAME
value: tekton-operator-webhook-certs
image: ko://github.com/tektoncd/operator/cmd/openshift/webhook123
name: tekton-operator-webhook
ports:
- containerPort: 8443
name: https-webhook
resources: {}
- env:
- name: SYSTEM_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
- name: POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: OPERATOR_NAME
value: redhat-openshift-pipelines-operator
- name: IMAGE_PIPELINES_PROXY
value: ko://github.com/tektoncd/operator/cmd/openshift/proxy-webhook
- name: IMAGE_JOB_PRUNER_TKN
value: gcr.io/tekton-releases/dogfooding/tkn@sha256:f69a02ef099d8915e9e4ea1b74e43b7a9309fc97cf23cb457ebf191e73491677
image: ko://github.com/tektoncd/operator/cmd/openshift/operator
imagePullPolicy: Always
name: openshift-pipelines-operator
resources: {}
serviceAccountName: tekton-operator
strategy: deployment
installModes:
- supported: false
Expand Down Expand Up @@ -736,5 +787,38 @@ spec:
name: IMAGE_JOB_PRUNER_TKN
- image: registry.redhat.io/openshift-pipelines/pipelines-cli-tkn-rhel8@
name: IMAGE_ADDONS_PARAM_TKN_IMAGE
- image: ko://github.com/tektoncd/operator/cmd/openshift/webhook123
name: TEKTON_OPERATOR_WEBHOOK
replaces: 1.5.0
version: 1.6.0
webhookdefinitions:
- admissionReviewVersions:
- v1beta1
- v1
containerPort: 443
deploymentName: tekton-operator-webhook
failurePolicy: Fail
generateName: config.webhook.operator.tekton.dev
sideEffects: None
targetPort: 8443
type: ValidatingAdmissionWebhook
- admissionReviewVersions:
- v1beta1
- v1
containerPort: 443
deploymentName: tekton-operator-webhook
failurePolicy: Fail
generateName: validation.webhook.operator.tekton.dev
sideEffects: None
targetPort: 8443
type: ValidatingAdmissionWebhook
- admissionReviewVersions:
- v1beta1
- v1
containerPort: 443
deploymentName: tekton-operator-webhook
failurePolicy: Fail
generateName: webhook.operator.tekton.dev
sideEffects: None
targetPort: 8443
type: MutatingAdmissionWebhook
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ spec:
description: this enables to prune pipelinerun/taskrun
properties:
keep:
default: 1
description: number of resources to keep
type: integer
resources:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
apiVersion: v1
kind: Secret
metadata:
labels:
app: tekton-operator
name: tekton-operator-webhook
name: tekton-operator-webhook-certs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
apiVersion: v1
kind: Service
metadata:
creationTimestamp: null
labels:
app: tekton-operator
name: tekton-operator-webhook
operator.tekton.dev/release: devel
version: devel
name: tekton-operator-webhook
spec:
ports:
- name: https-webhook
port: 443
targetPort: 8443
selector:
app: tekton-operator
name: tekton-operator-webhook
status:
loadBalancer: {}

0 comments on commit a622fc2

Please sign in to comment.