Installing Jenkins-X on GKE

5/7/2018

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)?
-- randymay
google-kubernetes-engine
jenkins
kubernetes

2 Answers

5/17/2018

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.

-- tom.poch
Source: StackOverflow

5/7/2018

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.

-- MaratB
Source: StackOverflow