Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
kubernetes_install_on_fedora [2018/04/09 09:38] – [download_kube_binaries] rpjdaykubernetes_install_on_fedora [2018/04/09 10:15] (current) – [cluster/get-kube-binaries.sh] rpjday
Line 42: Line 42:
  
 ==== download_kube_binaries() ==== ==== download_kube_binaries() ====
 +
 +This just turns around and calls a script for the download and extraction:
  
 <code> <code>
 +# Use the script from inside the Kubernetes tarball to fetch the client and
 +# server binaries (if not included in kubernetes.tar.gz).
 function download_kube_binaries { function download_kube_binaries {
   (   (
Line 58: Line 62:
 ==== cluster/get-kube-binaries.sh ==== ==== cluster/get-kube-binaries.sh ====
  
-The server tarball is downloaded and simply left under ''server/'' for later:+=== kubernetes-server-linux-amd64.tar.gz === 
 + 
 +As you can see, the server tarball is downloaded and simply left under ''server/'' for later:
  
 <code> <code>
Line 66: Line 72:
 </code> </code>
  
-On the other client, the client tarball is downloaded under ''client/'' and then "extracted":+so you can easily do that manually. 
 + 
 +=== kubernetes-client-linux-amd64.tar.gz === 
 + 
 +Unlike the server tarball, the client tarball is not only downloaded under ''client/'', it is then "extracted":
  
 <code> <code>
Line 75: Line 85:
 </code> </code>
  
-What happens:+The client tarball consists of the single executable ''kubectl'': 
 + 
 +<code> 
 +$ tar tvf kubernetes-client-linux-amd64.tar.gz  
 +drwxr-xr-x root/root         0 2018-03-26 13:46 kubernetes/ 
 +drwxr-xr-x root/root         0 2018-03-26 13:46 kubernetes/client/ 
 +drwxr-xr-x root/root         0 2018-03-26 13:46 kubernetes/client/bin/ 
 +-rwxr-xr-x root/root  54277699 2018-03-26 13:46 kubernetes/client/bin/kubectl 
 +
 +</code> 
 + 
 +which will be "installed" and which you'll have to add to your search path shortly. 
 + 
 +Here's the ''extract_arch_tarball()'' function in that script:
  
 <code> <code>
Line 94: Line 117:
 </code> </code>
  
-The client tarball consists of nothing but ''kubernetes/client/bin/kubectl''.+In short, from the ''${KUBE_ROOT}'' directory (and in the context of a 64-bit Fedora system), extract that single ''kubectl'' executable: 
 + 
 +<code> 
 +$ mkdir -p platforms/linux/amd64 
 +$ tar xvf ../kubernetes-client-linux-amd64.tar.gz \ 
 +> --strip-components 3 \ 
 +> -C platforms/linux/amd64 
 +
 +</code> 
 + 
 +<code> 
 +$ tree platforms 
 +platforms 
 +└── linux 
 +    └── amd64 
 +        └── kubectl 
 +
 +</code> 
 + 
 +Finally, make sure you can find ''kubectl'' on your search path somehow: 
 + 
 +<code> 
 +PATH=$PATH:/home/rpjday/kubernetes/dl/kubernetes/platforms/linux/amd64 
 +</code>
 ===== create_cluster ===== ===== create_cluster =====
 +
 +==== Overview ====
 +
 +This function kicks off a new cluster:
 +
 +<code>
 +function create_cluster {
 +  if [[ -n "${KUBERNETES_SKIP_CREATE_CLUSTER-}" ]]; then
 +    exit 0
 +  fi
 +  echo "Creating a kubernetes on ${KUBERNETES_PROVIDER:-gce}..."
 +  (
 +    cd kubernetes
 +    ./cluster/kube-up.sh
 +    echo "Kubernetes binaries at ${PWD}/cluster/"
 +    if [[ ":$PATH:" != *":${PWD}/cluster:"* ]]; then
 +      echo "You may want to add this directory to your PATH in \$HOME/.profile"
 +    fi
 +
 +    echo "Installation successful!"
 +  )
 +}
 +</code>
 +
 +You might want to add the ''cluster/'' directory to your search path for later:
 +
 +<code>
 +PATH=$PATH:/home/rpjday/kubernetes/dl/kubernetes/cluster
 +</code>
 +==== create_cluster() ====
 +
 +This function calls the underlying script ''cluster/kube-up.sh'':
 +
 +<code>
 +function create_cluster {
 +  if [[ -n "${KUBERNETES_SKIP_CREATE_CLUSTER-}" ]]; then
 +    exit 0
 +  fi
 +  echo "Creating a kubernetes on ${KUBERNETES_PROVIDER:-gce}..."
 +  (
 +    cd kubernetes
 +    ./cluster/kube-up.sh
 +    echo "Kubernetes binaries at ${PWD}/cluster/"
 +    if [[ ":$PATH:" != *":${PWD}/cluster:"* ]]; then
 +      echo "You may want to add this directory to your PATH in \$HOME/.profile"
 +    fi
 +
 +    echo "Installation successful!"
 +  )
 +}
 +</code>
  • kubernetes_install_on_fedora.1523266720.txt.gz
  • Last modified: 2018/04/09 09:38
  • by rpjday