openebs-archive / jiva-operator

Kubernetes Operator for managing Jiva Volumes via custom resource.
https://openebs.io
Apache License 2.0
46 stars 44 forks source link

Helm Chart Friendly with Talos Linux Specificity #207

Open miragecentury opened 1 year ago

miragecentury commented 1 year ago

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:

Describe the solution you'd like

Environment: no relevant

Thanks for your advice and help.

jpecora716 commented 1 year ago

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!

leosunmo commented 8 months ago

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 "$@"