Add an entry inside the /etc/hosts

Hello,

i have installed zero to jupyterhub, that work, and i want just to modify the /etc/hosts to add new entry, like

10.12.0.3 myserver

and i don’t know if we can do that with the helm config, i have an zero-to-jupyterhub-config.yml, does exist some parameters for that ?

Thank you

i finally find a method, i do that by editing and adding this lines in the values.yaml file

extraAnnotations: {}
extraLabels:
hub.jupyter.org/network-access-hub: ‘true’
extraEnv: {}
lifecycleHooks:
postStart:
exec:
command:
- “sh”
- “-c”
- >
echo “10.1.1.1 servername1\n10.1.1.2 servername2” >> /etc/hosts
initContainers: []
extraContainers: []
uid: 1000
fsGid: 100

if you know an another way to do that ?

thank you

Hi, I also want to modify the /etc/hosts to add new entry.
I tried rewrite the values.yaml, but I couldn’t write to /etc/hosts because I don’t have permission.

I added the following parameters to allow sudo, and although sudo is now available, but I was prompted for a password.
I don’t know the password for sudo.

singleuser:
  extraEnv:
    GRANT_SUDO: "yes"

Is there a way to find out the sudo password or change /etc/hosts?

Hello,

Can you share your value file ?

Thanks! Geronium.

This is my values.yaml.

proxy:
  service:
    type: NodePort

hub:
  config:
    Authenticator:
      admin_users: 
        - admin
    JupyterHub:
      authenticator_class: nativeauthenticator.NativeAuthenticator
      
singleuser:
  extraEnv:
    GRANT_SUDO: "yes"

  startTimeout: 60
  # uid: 0
  cmd:
  lifecycleHooks:
    postStart:
      exec:
        command:
        - "sh"
        - "-c"
        - >
          id;
          echo "192.168.121.183 minio-api.com" >> /etc/hosts

maybe i don’t have this error, because in the Dockerfile of singleuser image, i finished with an

USER root

maybe …