jiva-operator icon indicating copy to clipboard operation
jiva-operator copied to clipboard

Helm Chart Friendly with Talos Linux Specificity

Open miragecentury opened this issue 1 year ago • 2 comments

Describe the problem/challenge you have I want to use OpenEBS Jiva in my cluster and use only helm to install it. My Cluster is built with Sidero and uses Talos Linux.

In the documentation of Talos, they explain how to install OpenEBS Jiva but it requires two small patches:

  • Re-Configure the ConfigMap openebs-jiva-csi-iscsiadm ( to be able to use iscsiadm )
apiVersion: v1
kind: ConfigMap
metadata:
  name: openebs-jiva-csi-iscsiadm
  namespace: openebs
data:
  iscsiadm: |
    #!/bin/sh
    iscsid_pid=$(pgrep iscsid)
    nsenter --mount="/proc/${iscsid_pid}/ns/mnt" --net="/proc/${iscsid_pid}/ns/net" -- /usr/local/sbin/iscsiadm "$@"
  • Re-Configure the DaemonSet openebs-jiva-csi-node to access to the hostPID
kubectl --namespace openebs patch daemonset openebs-jiva-csi-node --type=json --patch '[{"op": "add", "path": "/spec/template/spec/hostPID", "value": true}]'

Describe the solution you'd like

  • Add in the helm template, the capacity to overwrite the value of the ConfigMap
  • Add in the helm template, the value of hostPID to false by default in the DaemonSet Specs Template.

Environment: no relevant

Thanks for your advice and help.

miragecentury avatar Mar 18 '23 16:03 miragecentury

You can use kustomize as a post renderer. I use flux with the following:

  postRenderers:
    - kustomize:
        patchesStrategicMerge:
          - kind: DaemonSet
            apiVersion: apps/v1
            metadata:
              name: openebs-jiva-csi-node
            spec:
              template:
                spec:
                  hostPID: true
          - kind: ConfigMap
            apiVersion: v1
            metadata:
              name: openebs-jiva-csi-iscsiadm
            data:
              iscsiadm: |
                #!/bin/sh
                iscsid_pid=$(pgrep iscsid)
                nsenter --mount="/proc/${iscsid_pid}/ns/mnt" --net="/proc/${iscsid_pid}/ns/net" -- /usr/local/sbin/iscsiadm "$@"

Hopefully it helps!

jpecora716 avatar Sep 08 '23 00:09 jpecora716

Thanks for saving me a bunch of time @jpecora716 !

I rewrote it to work with the new recommended patches directive.

  postRenderers:
    - kustomize:
        patches:
          - target:
              group: apps
              version: v1
              kind: DaemonSet
              name: '.*-csi-node'
            patch: |
              - op: replace
                path: /spec/template/spec/hostPID
                value: true
          - target:
              version: v1
              kind: ConfigMap
              name: '.*-csi-iscsiadm'
            patch: |
              - op: replace
                path: /data/iscsiadm
                value: |
                  #!/bin/sh
                  iscsid_pid=$(pgrep iscsid)
                  nsenter --mount="/proc/${iscsid_pid}/ns/mnt" --net="/proc/${iscsid_pid}/ns/net" -- /usr/local/sbin/iscsiadm "$@"

leosunmo avatar Dec 28 '23 15:12 leosunmo