Here my PatchStrategicMergeTransformer
:
apiVersion: builtin
kind: PatchStrategicMergeTransformer
metadata:
name: not-important-to-example
paths:
- patches/add-resources-patch.yaml
My patches/add-resources-patch.yaml
:
apiVersion: apps.openshift.io/v1
kind: DeploymentConfig
metadata:
name: portal
spec:
template:
spec:
containers:
- name: portal
resources:
limits:
cpu: "1"
memory: 512Mi
requests:
cpu: "0.5"
memory: 256Mi
My base/deploymentconfig.yaml
:
apiVersion: apps.openshift.io/v1
kind: DeploymentConfig
metadata:
name: portal
spec:
replicas: 1
strategy:
type: Rolling
rollingParams:
intervalSeconds: 1
maxSurge: 1
maxUnavailable: 0
timeoutSeconds: 180
template:
spec:
volumes:
- name: environments
configMap:
name: portal
containers:
- name: portal
image: portal
ports:
- containerPort: 8080
volumeMounts:
- name: environments
mountPath: /var/www/html/environments-ui
readinessProbe:
failureThreshold: 3
tcpSocket:
port: 8080
timeoutSeconds: 5
periodSeconds: 60
initialDelaySeconds: 5
livenessProbe:
failureThreshold: 3
tcpSocket:
port: 8080
timeoutSeconds: 1
periodSeconds: 10
initialDelaySeconds: 5
startupProbe:
failureThreshold: 30
tcpSocket:
port: 8080
timeoutSeconds: 2
periodSeconds: 10
initialDelaySeconds: 5
My patch is trying to add resources to container portal
. Resources are added, but base container definition is removed instead of keep them:
apiVersion: apps.openshift.io/v1
kind: DeploymentConfig
metadata:
labels:
CodiAplicacio: "2986"
CodiEntitat: CTT
CodiInap: GAA
CodiServei: "7_881"
app.kubernetes.io/component: portal
app.kubernetes.io/managed-by: kustomize
app.kubernetes.io/name: portal
app.kubernetes.io/part-of: espaidoc
app.kubernetes.io/version: 1.0.0
stage: pre
name: portal
spec:
replicas: 1
strategy:
rollingParams:
intervalSeconds: 1
maxSurge: 1
maxUnavailable: 0
timeoutSeconds: 180
type: Rolling
template:
metadata:
labels:
CodiAplicacio: "2986"
CodiEntitat: CTT
CodiInap: GAA
CodiServei: "7_881"
app.kubernetes.io/component: portal
app.kubernetes.io/managed-by: kustomize
app.kubernetes.io/name: portal
app.kubernetes.io/part-of: espaidoc
app.kubernetes.io/version: 1.0.0
stage: pre
spec:
containers:
- name: portal
resources:
limits:
cpu: "1"
memory: 512Mi
requests:
cpu: "0.5"
memory: 256Mi
volumes:
- configMap:
name: portal
name: environments
Any ideas?