Giter Club home page Giter Club logo

ssh-bastion's Introduction

ssh-bastion

An ssh-bastion pod to make access to openshift clusters easy

  1. Make sure that oc is configured to talk to the cluster

  2. Optionally configure the namespace where the bastion will run:

    export SSH_BASTION_NAMESPACE=openshift-ssh-bastion
    

    By default openshift-ssh-bastion is used.

  3. Run:

    curl https://raw.githubusercontent.com/eparis/ssh-bastion/master/deploy/deploy.sh | bash
    

    This will create a new pod running an sshd server. The sshd server is exposed via a k8s service backed by a loadbalancer(based on your cloud platform). The service hostname will provide access to the sshd server. (See below for how to get the hostname)

    The sshd server is configured to allow login as user core using the same private key that was used to create the cluster.

  4. SSH as the core user to/through the bastion.

    • Use the -A option (ForwardAgent) for your key to be automatically forwarded to the nodes from the bastion pod.
    • You can use a helper script to ssh directly to a node by the node's name (from oc get node). This script uses ssh authentication forwarding so you can directly hop from the bastion to the cluster nodes.

    If you need to use a non-default SSH key, you can:

    • Export the SSH_KEY_PATH environment variable to change its location. For example:
      export SSH_KEY_PATH=~/.ssh/my_kustom_cey.pem
      
    • Run something like ssh-agent and add your key to that utility
    • Directly add or update the SSH keys in your OCP deployment see Update SSH Keys.
  5. The bastion address can be found by running:

    oc get service --all-namespaces -l run=ssh-bastion -o go-template='{{ with (index (index .items 0).status.loadBalancer.ingress 0) }}{{ or .hostname .ip }}{{end}}'
    

ssh-bastion's People

Contributors

eparis avatar sanchezl avatar jsafrane avatar p0lyn0mial avatar petr-balogh avatar mtnbikenc avatar bparees avatar ironcladlou avatar derekwaynecarr avatar harche avatar kikisdeliveryservice avatar vareti avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.