Skip to content

Instantly share code, notes, and snippets.

@coulof
Created June 8, 2020 13:56
Show Gist options
  • Save coulof/d4260e4e17910bbdefbbecce4286074f to your computer and use it in GitHub Desktop.
Save coulof/d4260e4e17910bbdefbbecce4286074f to your computer and use it in GitHub Desktop.
csi-isilon custom X_NODE_IP
spec:
template:
spec:
initContainers:
- name: config
image: "ruby:2.7"
command: ['sh', '-c', 'erb /tmpl/entrypoint.sh.erb > /custom/entrypoint.sh && chmod +x /custom/entrypoint.sh']
volumeMounts:
- name: cfgtmpl
mountPath: /tmpl
- name: configdir
mountPath: /custom
containers:
- name: driver
command: ["/custom/entrypoint.sh"]
volumeMounts:
- mountPath: /custom
name: configdir
volumes:
- name: cfgtmpl
configMap:
name: nodeip-cfg
- name: configdir
emptyDir: {}
apiVersion: v1
kind: ConfigMap
metadata:
name: nodeip-cfg
namespace: isilon
data:
entrypoint.sh.erb: |
#!/bin/sh
export X_NODE_IP=<%= %x@ip -4 addr show dev ens33 | grep inet@[/inet\s+(\d+(\.\d+){3})/,1] %>
exec "/csi-isilon"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment