Skip to content

Commit

Permalink
Support addition of new containers provided as options
Browse files Browse the repository at this point in the history
If a container or initContainer is provided in options of deployment or
statefulset, if a container or initContainer with that name exists,
the properties for of that container will be updated with the values
provided in options.
With that change, if there is no match, the container or initContainer
from options will be added to the deployments and statefulsets.
  • Loading branch information
enarha authored and tekton-robot committed Feb 11, 2025
1 parent e5a1789 commit 97b76ef
Show file tree
Hide file tree
Showing 7 changed files with 653 additions and 9 deletions.
8 changes: 4 additions & 4 deletions docs/TektonConfig.md
Original file line number Diff line number Diff line change
Expand Up @@ -606,12 +606,12 @@ The following fields are supported in `deployment`
* `topologySpreadConstraints` - replaces the existing TopologySpreadConstraints with this, if not empty
* `runtimeClassName` - adds and updates runtimeClassName
* `volumes` - adds and updates volumes
* `initContainers` - updates init-containers
* `initContainers` - adds and updates init-containers
* `resources` - replaces the resources requirements with this, if not empty
* `envs` - adds and updates environments
* `volumeMounts` - adds and updates VolumeMounts
* `args` - appends given args with existing arguments. **NOTE: THIS OPERATION DO NOT REPLACE EXISTING ARGS**
* `containers` - updates containers
* `containers` - adds and updates containers
* `resources` - replaces the resources requirements with this, if not empty
* `envs` - adds and updates environments
* `volumeMounts` - adds and updates VolumeMounts
Expand Down Expand Up @@ -641,12 +641,12 @@ The following fields are supported in `StatefulSet`
* `topologySpreadConstraints` - replaces the existing TopologySpreadConstraints with this, if not empty
* `runtimeClassName` - adds and updates runtimeClassName
* `volumes` - adds and updates volumes
* `initContainers` - updates init-containers
* `initContainers` - adds and updates init-containers
* `resources` - replaces the resources requirements with this, if not empty
* `envs` - adds and updates environments
* `volumeMounts` - adds and updates VolumeMounts
* `args` - appends given args with existing arguments. **NOTE: THIS OPERATION DO NOT REPLACE EXISTING ARGS**
* `containers` - updates containers
* `containers` - adds and updates containers
* `resources` - replaces the resources requirements with this, if not empty
* `envs` - adds and updates environments
* `volumeMounts` - adds and updates VolumeMounts
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,188 @@
---
apiVersion: v1
kind: Namespace
metadata:
name: tekton-pipelines

---
apiVersion: v1
kind: ConfigMap
metadata:
name: config-defaults
namespace: tekton-pipelines
creationTimestamp: null
labels:
app.kubernetes.io/instance: default
app.kubernetes.io/part-of: tekton-pipelines
data:
test: "123"

---
apiVersion: v1
kind: ConfigMap
metadata:
name: config-events
namespace: tekton-pipelines
creationTimestamp: null
data:
event1: no-data

---
apiVersion: v1
kind: ConfigMap
metadata:
name: config-leader-election
namespace: tekton-pipelines-resolvers
labels:
app.kubernetes.io/component: resolvers
app.kubernetes.io/instance: default
app.kubernetes.io/part-of: tekton-pipelines
data:
buckets: "2"

---
apiVersion: apps/v1
kind: Deployment
metadata:
name: tekton-pipelines-controller
namespace: tekton-pipelines
creationTimestamp: null
labels:
app.kubernetes.io/name: controller
controlled-by-options: "true"
annotations:
hpa-enabled: "false"
status: {}
spec:
strategy: {}
replicas: 4
selector:
matchLabels:
app.kubernetes.io/name: controller
template:
metadata:
creationTimestamp: null
annotations:
annotation-foo: annotation-bar
labels:
app.kubernetes.io/name: controller
label-foo: label-bar
operator.tekton.dev/deployment-spec-applied-hash: 431f8b0948750a2b5e232680c9655a1f
spec:
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: disktype
operator: In
values:
- ssd
- nvme
- ramdisk
priorityClassName: test
runtimeClassName: foo
serviceAccountName: tekton-pipelines-controller
nodeSelector:
zone: east
tolerations:
- key: zone
operator: Equal
value: west
effect: NoSchedule
topologySpreadConstraints:
- maxSkew: 1
topologyKey: kubernetes.io/hostname
whenUnsatisfiable: DoNotSchedule
labelSelector:
matchLabels:
app: foo
matchLabelKeys:
- pod-template-hash
containers:
- name: container-xyz
resources: {}
- name: tekton-pipelines-controller
image: gcr.io/tekton-releases/github.com/tektoncd/pipeline/cmd/controller:v0.50.1@sha256:9025991c337374dadce6d49e29fbcf86b233ab8f5f96748c67293b2285c3e0b6
args:
- "-entrypoint-image"
- "gcr.io/tekton-releases/github.com/tektoncd/pipeline/cmd/entrypoint:v0.50.1@sha256:0c66040a16142a598d5aa9f310b1cbf66e843aa7114188f5d0ab5d36b463a09b"
- "--disable-ha=false"
volumeMounts:
- name: config-logging
mountPath: /etc/config-logging-tmp
- name: config-registry-cert
mountPath: /etc/config-registry-cert
- name: custom-mount
mountPath: /etc/custom-mount
env:
- name: SYSTEM_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
- name: CONFIG_DEFAULTS_NAME
value: config-defaults
- name: CONFIG_LOGGING_NAME
value: pipeline-config-logging
- name: ENV_FOO
value: bar
- name: ENV_FROM_CONFIG_MAP
valueFrom:
configMapKeyRef:
name: config-map-foo
key: foo
optional: true
resources:
limits:
cpu: "2"
memory: "4Gi"
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop:
- "ALL"
runAsUser: 65532
runAsGroup: 65532
runAsNonRoot: true
seccompProfile:
type: RuntimeDefault
ports:
- name: probes
containerPort: 8080
livenessProbe:
httpGet:
path: /health
port: probes
scheme: HTTP
initialDelaySeconds: 5
periodSeconds: 10
timeoutSeconds: 5
readinessProbe:
httpGet:
path: /readiness
port: probes
scheme: HTTP
initialDelaySeconds: 5
periodSeconds: 10
timeoutSeconds: 5
- args:
- --secure-listen-address=0.0.0.0:9443
- --upstream=http://127.0.0.1:9090/
- --logtostderr=true
- --v=6
image: registry.redhat.io/openshift4/ose-kube-rbac-proxy:v4.12
name: kube-rbac-proxy
resources:
limits:
cpu: 500m
memory: 128Mi
volumes:
- name: config-logging
hostPath:
path: /etc/config-logging
- name: config-registry-cert
configMap:
name: config-registry-cert
- name: my-custom-logs
hostPath:
path: /var/custom/logs
Loading

0 comments on commit 97b76ef

Please sign in to comment.