randymay
randymay

Reputation: 443

Installing Jenkins-X on GKE

This may sound like a stupid question, but I am installing Jenkins-X on a Kubernetes cluster on GKE. When I install through Cloud Shell, the /usr/local/bin folder I am moving it to is refreshed every time the shell is restarted.

My question is two-fold:

  1. Am I correct in installing Jenkins-X through Cloud Shell (and not on a particular node)?
  2. How can I get it so the /jx folder is available when the Cloud Shell is restarted (or at least have the /jx folder on the path at all times)?

Upvotes: 0

Views: 458

Answers (2)

Tomáš Poch
Tomáš Poch

Reputation: 890

I am running jx from the Cloud shell

  1. In the cloud shell you are already logged in and you have a project configured. To prevent jx to re-login to google cloud/project use the following arguments

    jx create cluster gke  --skip-login=true --project-id projectId
    
  2. download jx to ~/bin and update $PATH to include both ~/bin and ~/.jx/bin. Put the following to ~/.profile

    if [ -d "$HOME/bin" ] ; then
        PATH="$HOME/bin:$PATH"
    fi
    
    PATH="$HOME/.jx/bin:$PATH"
    

    The .jx/bin is the place where JX downloads helm if needed.

Upvotes: 2

MaratB
MaratB

Reputation: 689

Google Cloud Shell VMs are ephemeral and they are discarded shortly after the end of a session. However, your home directory persists, so anything installed in the home directory will remain from session to session.

I am not familiar with Jenkins-X. If it requires a daemon process running in the background, Cloud Shell is not a good option and you should probably set up a GCE instance. If you just need to run some command-line utilities to control a GKE cluster, make sure that whatever you install goes into your home directory where it will persist across Cloud Shell sessions.

Upvotes: 1

Related Questions