openshift.j2 1.1 KB

123456789101112131415161718192021222324
  1. #!/bin/bash
  2. if [ ! -d ~/.kube ]; then
  3. mkdir -m 0700 ~/.kube
  4. fi
  5. cmd=`basename $0`
  6. user=`id -u`
  7. group=`id -g`
  8. image_tag=v{{ openshift_version }}
  9. >&2 echo """
  10. ================================================================================
  11. ATTENTION: You are running ${cmd} via a wrapper around 'docker run {{ openshift.common.cli_image }}:${image_tag}'.
  12. This wrapper is intended only to be used to bootstrap an environment. Please
  13. install client tools on another host once you have granted cluster-admin
  14. privileges to a user.
  15. {% if openshift.common.deployment_type in ['openshift-enterprise','atomic-enterprise'] %}
  16. See https://docs.openshift.com/enterprise/latest/cli_reference/get_started_cli.html
  17. {% else %}
  18. See https://docs.openshift.org/latest/cli_reference/get_started_cli.html
  19. {% endif %}
  20. =================================================================================
  21. """
  22. docker run -i --privileged --net=host --user=${user}:${group} -v ~/.kube:/root/.kube -v /tmp:/tmp -v {{ openshift.common.config_base}}:{{ openshift.common.config_base }} -e KUBECONFIG=/root/.kube/config --entrypoint ${cmd} --rm {{ openshift.common.cli_image }}:${image_tag} "${@}"