Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Helm Chart Friendly with Talos Linux Specificity #207

Open
miragecentury opened this issue Mar 18, 2023 · 2 comments · May be fixed by #220
Open

Helm Chart Friendly with Talos Linux Specificity #207

miragecentury opened this issue Mar 18, 2023 · 2 comments · May be fixed by #220

Comments

@miragecentury
Copy link

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.

@jpecora716
Copy link

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
Copy link

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 added a commit to leosunmo/jiva-operator that referenced this issue Dec 28, 2023
Tackles issue openebs-archive#207. Adds the ability to enable HostPID: true for the csi Node DaemonSet.
It also adds the ability to inject a custom configuration in to the hardcoded `openebs-jiva-csi-iscsiadm` ConfigMap.

These changes are pretty small but ensures that the Jiva Operator can more easily be used with (Talos)[https://www.talos.dev/].
Talos requires some modifications for it to work properly with Talos.
Details here: https://www.talos.dev/v1.6/kubernetes-guides/configuration/replicated-local-storage-with-openebs-jiva/#patching-the-jiva-installation

Signed-off-by: Leo Palmer Sunmo <leo.sunmo@gmail.com>
@leosunmo leosunmo linked a pull request Dec 28, 2023 that will close this issue
7 tasks
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 a pull request may close this issue.

3 participants