Skip to content

Conversation

@gianlucam76
Copy link
Member

@gianlucam76 gianlucam76 commented Jan 14, 2026

Profiles can now references ConfigMap/Secret instances containing
StrategicMerge or JSON Patch.

The namespace/name of the referenced ConfigMap/Secret can be expressed
as template.

Here is an example of a ClusterProfile Spec using PatchesFrom:

    patchesFrom:
    - kind: ConfigMap
      name: '{{ .Cluster.metadata.name}}-patches'
      namespace: '{{ .Cluster.metadata.namespace}}'
      optional: true
    - kind: ConfigMap
      name: '{{ .Cluster.metadata.name}}-jsonpatch'
      namespace: '{{ .Cluster.metadata.namespace}}'
      optional: true

and here are the ConfigMap one with StrategicMerge and one with JSON Patch

apiVersion: v1
data:
  deployment-labels: |-
    patch: |
      apiVersion: apps/v1
      kind: Deployment
      metadata:
        name: not-important
        labels:
          fv-5z5y6jvl78: fv-tawxs7qu93
    target:
      kind: Deployment
  fv-kwoqx4usiv: |-
    patch: |
      apiVersion: apps/v1
      kind: Deployment
      metadata:
        name: not-important
      spec:
        template:
          spec:
            tolerations:
            - key: fv-kwoqx4usiv
              operator: Equal
              value: example-value
              effect: NoSchedule
    target:
      kind: Deployment
  service-labels: |-
    patch: |
      apiVersion: v1
      kind: Service
      metadata:
        name: not-important
        labels:
          fv-5z5y6jvl78: fv-tawxs7qu93
    target:
      kind: Service
kind: ConfigMap
metadata:
  name: clusterapi-workload-patches
  namespace: default
apiVersion: v1
data:
  fv-kukz6aqz2x: |-
    patch: |-
      - op: add
        path: /metadata/annotations/fv-wfkjbenge9
        value: fv-mrxtndu2kx
    target:
      kind: Deployment
kind: ConfigMap
metadata:
  name: clusterapi-workload-jsonpatch
  namespace: default

Profiles can now references ConfigMap/Secret instances containing
StrategicMerge or JSON Patch.

The namespace/name of the referenced ConfigMap/Secret can be expressed
as template.

Here is an example of a ClusterProfile Spec using PatchesFrom:

````yaml
    patchesFrom:
    - kind: ConfigMap
      name: '{{ .Cluster.metadata.name}}-patches'
      namespace: '{{ .Cluster.metadata.namespace}}'
      optional: false
    - kind: ConfigMap
      name: '{{ .Cluster.metadata.name}}-jsonpatch'
      namespace: '{{ .Cluster.metadata.namespace}}'
      optional: false
```

and here are the ConfigMap one with StrategicMerge and one with JSON Patch

```yaml
apiVersion: v1
data:
  deployment-labels: |-
    patch: |
      apiVersion: apps/v1
      kind: Deployment
      metadata:
        name: not-important
        labels:
          fv-5z5y6jvl78: fv-tawxs7qu93
    target:
      kind: Deployment
  fv-kwoqx4usiv: |-
    patch: |
      apiVersion: apps/v1
      kind: Deployment
      metadata:
        name: not-important
      spec:
        template:
          spec:
            tolerations:
            - key: fv-kwoqx4usiv
              operator: Equal
              value: example-value
              effect: NoSchedule
    target:
      kind: Deployment
  service-labels: |-
    patch: |
      apiVersion: v1
      kind: Service
      metadata:
        name: not-important
        labels:
          fv-5z5y6jvl78: fv-tawxs7qu93
    target:
      kind: Service
kind: ConfigMap
metadata:
  name: clusterapi-workload-patches
  namespace: default
```

```yaml
apiVersion: v1
data:
  fv-kukz6aqz2x: |-
    patch: |-
      - op: add
        path: /metadata/annotations/fv-wfkjbenge9
        value: fv-mrxtndu2kx
    target:
      kind: Deployment
kind: ConfigMap
metadata:
  name: clusterapi-workload-jsonpatch
  namespace: default
```
@gianlucam76 gianlucam76 merged commit c4a530a into projectsveltos:main Jan 15, 2026
15 of 16 checks passed
@gianlucam76 gianlucam76 deleted the patches-from branch January 15, 2026 08:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant