Skip to content

Commit

Permalink
Adds runtimeclassname support in options field for deployment and s…
Browse files Browse the repository at this point in the history
…tatefulsets

Signed-off-by: PuneetPunamiya <[email protected]>
  • Loading branch information
PuneetPunamiya committed Dec 10, 2024
1 parent 4525300 commit 1da6727
Show file tree
Hide file tree
Showing 7 changed files with 502 additions and 4 deletions.
10 changes: 6 additions & 4 deletions docs/TektonConfig.md
Original file line number Diff line number Diff line change
Expand Up @@ -602,17 +602,18 @@ The following fields are supported in `deployment`
* `nodeSelector` - replaces the existing NodeSelector with this, if not empty
* `tolerations` - replaces the existing tolerations with this, if not empty
* `topologySpreadConstraints` - replaces the existing TopologySpreadConstraints with this, if not empty
* `runtimeClassName` - adds and updates runtimeClassName
* `volumes` - adds and updates volumes
* `initContainers` - 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**
* `args` - appends given args with existing arguments. **NOTE: THIS OPERATION DO NOT REPLACE EXISTING ARGS**
* `containers` - updates 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**
* `args` - appends given args with existing arguments. **NOTE: THIS OPERATION DO NOT REPLACE EXISTING ARGS**

#### StatefulSets
Supports to update the existing StatefulSet. But not supported to create new StatefulSet.
Expand All @@ -636,17 +637,18 @@ The following fields are supported in `StatefulSet`
* `nodeSelector` - replaces the existing NodeSelector with this, if not empty
* `tolerations` - replaces the existing tolerations with this, if not empty
* `topologySpreadConstraints` - replaces the existing TopologySpreadConstraints with this, if not empty
* `runtimeClassName` - adds and updates runtimeClassName
* `volumes` - adds and updates volumes
* `initContainers` - 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**
* `args` - appends given args with existing arguments. **NOTE: THIS OPERATION DO NOT REPLACE EXISTING ARGS**
* `containers` - updates 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**
* `args` - appends given args with existing arguments. **NOTE: THIS OPERATION DO NOT REPLACE EXISTING ARGS**

#### HorizontalPodAutoscalers
Supports to update the existing HorizontalPodAutoscaler(HPA) also supports to create new HPA.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,177 @@
---
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: adf5ca03f3b1b83fa0ccd493ab932fa3
spec:
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: disktype
operator: In
values:
- ssd
- nvme
- ramdisk
priorityClassName: test
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
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

Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: web
spec:
serviceName: "nginx"
replicas: 2
selector:
matchLabels:
app: nginx
template:
metadata:
labels:
app: nginx
spec:
containers:
- name: nginx
image: registry.k8s.io/nginx-slim:0.8
ports:
- containerPort: 80
name: web
volumeMounts:
- name: www
mountPath: /usr/share/nginx/html
volumeClaimTemplates:
- metadata:
name: www
spec:
accessModes: ["ReadWriteOnce"]
resources:
requests:
storage: 1Gi
Loading

0 comments on commit 1da6727

Please sign in to comment.