Commit daeb877e authored by Sebastien Gardoll's avatar Sebastien Gardoll
Browse files

add specific informations about Kubernetes on Linux

parent b1b0ecd3
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
# Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
config: 5181bd2b8280e663a350317fc93a53af
config: 4d3597b4651c71301cf359fad5392948
tags: 645f666f9bcd5a90fca523b33c5a78b7
+34 −4
Original line number Diff line number Diff line
@@ -15,13 +15,33 @@ Setup
=====

Before using Kubernetes, you need to have a Kubernetes cluster, and the kubectl command-line tool must be configured to communicate with your cluster.
For example, you can install *minikube* and *kubectl* on a Mac laptop, then start a Kubernetes cluster as follows::
For example, you can install *minikube* and *kubectl* on a Mac or Linux laptop
(procedure is given `here <https://kubernetes.io/docs/tasks/tools/install-minikube/>`__).

  minikube start --vm-driver=xhyve
For MacOSX, start a Minikube cluster as follows::

  minikube start --vm-driver=xhyve # Wait until completion (takes long time)

  kubectl config use-context minikube

For Linux, start a Minikube cluster with KVM as follows::

  minikube start --vm-driver=kvm2 # Wait until completion (takes long time)

  kubectl config use-context minikube

All Kubernetes files to follow this tutorial are contained in the *kubernetes* sub-dirctory.
KVM2 driver is available `here <https://github.com/kubernetes/minikube/blob/master/docs/drivers.md#kvm2-driver>`__.

Remarks:

* All Kubernetes files to follow this tutorial are contained in the *kubernetes*
  sub-dirctory.
* Minikube install a 20 Go VM on your disk (located in ~/.minikube)
* If minikube fails to create a VM or if you get anything wrong, delete the VM:

.. code-block:: bash

  minikube delete 


Solr
@@ -49,6 +69,8 @@ To test that the two Solr instances are working, enter the container and query l
  /]# curl 'http://localhost:8984/solr/datasets/select?q=*%3A*&wt=json&indent=true'




Index Node
==========

@@ -79,4 +101,12 @@ Cleanup

To clean up all pods, services and deployments::

  kubectl delete deployment,svc esgf-solr esgf-index-node
  kubectl delete deploy --all

To shutdown Minikube VM::

  minikube stop

To delete Minikube VM::

  minikube delete
 No newline at end of file
+68 −72
Original line number Diff line number Diff line
@@ -4,7 +4,7 @@
Single Host Deployment
**********************

*Tested with ESGF_VERSION=1.1*
*Tested with ESGF_VERSION=1.4*

Abstract
========
@@ -18,31 +18,43 @@ Pre-Requisites
==============

*  A host system with the latest version of Docker Engine installed (at
   this time, Docker 1.12+). Tested on MacOSX and Linux CentOS.
   this time, Docker 1.17.x). Tested on MacOSX (Version 17.09.1-ce-mac42) and Linux CentOS.
*  Java SDK (at this time 1.8), keytool is required (add it to the PATH var env).
*  Docker-compose (at this time 1.14.0), installation procedure
*  Docker Compose (at this time 1.17.x), installation procedure
   `here <https://docs.docker.com/compose/install/#install-compose>`__
   (on a Mac, Compose is automatically installed as part of the standard Docker installation).
   
Cleanup
=======

If you are following these instructions *not* for the first time,
it might be a good idea to completely reset the system so you can start from a clean slate. To do so,
stop all running containers, and remove all data volumes and all configuration.
From the top-level *esgf-docker/* directory, issue the commands::

    docker-compose down
    docker rm $(docker ps -a -q)
    docker volume ls -qf dangling=true | xargs docker volume rm
    rm -rf $ESGF_CONFIG/*


Setup
=====

*  Clone the current repository, cd to the top-level directory. Checkout
   the latest stable branch, which is named "vN.M" (for example, "v1.1"). ::
   the master branch, which is the latest stable branch::

     git clone https://github.com/ESGF/esgf-docker.git
     cd esgf-docker
     git tag -l
     git checkout vN.M

   Note: if you want to create a new branch based on a tag, use the command::

     git checkout tags/<tag_name> -b <branch_name>
     git checkout master

*  Define your environment:
*  Define your environment. Note that on a Mac the Docker engine has access only to the filesystem under the user home directory,
   so all environment variables that reference directories must use paths under the user home directory.

   * Add the path to the keytool install directory::
   
       export PATH='/path/to/keytool/install/dir':$PATH
       which keytool
   
   *  **ESGF_HOSTNAME** must reference the Fully Qualified Domain Name of the host where the containers will be running:

@@ -53,6 +65,7 @@ Setup
     * On mac, choose a custom host name, and bind it to the current IP address of the Mac, for example::

          export ESGF_HOSTNAME=my-node.esgf.org
          echo $ESGF_HOSTNAME 

       You must edit */private/etc/hosts* and map *my-node.esgf.org* to the current Mac IP address
       (which you can find from the Control Panel Network Settings), for example::
@@ -61,38 +74,22 @@ Setup
          ...
          192.168.0.5 my-node.esgf.org

     *  On mac using docker-machine:
     
        * set ESGF_HOSTNAME, for example::
         
            export ESGF_HOSTNAME=my-esgf-node
        
        * create a docker-machine with a name that matches a chosen ESGF_HOSTNAME, for example::
        
            docker-machine create --driver virtualbox --virtualbox-memory=4096 --virtualbox-cpu-count=2 my-esgf-node
          
        * determine the IP address of the new docker-machine::
   
            docker-machine ip my-esgf-node
          
        * edit */private/etc/hosts* and map *my-esgf-node* to the docker-machine IP address, e.g.::
        
            cat /private/etc/hosts
            ...
            192.168.99.101  my-esgf-node
          
        * make sure to run::
        
            eval $(docker-machine env my-esgf-node)
            
          to ensure your docker commands use the new docker-machine and not the default.

   * **ESGF_CONFIG** must reference a directory on the host system that will store 
     all the site-specific configuration, e.g.::

       export ESGF_CONFIG=~/esgf_config
       mkdir -p $ESGF_CONFIG

   * **ESGF_VERSION** must specify the version of the ESGF/Docker stack to be used,
     which is recommended to be the latest stable version, e.g.::

       export ESGF_VERSION=1.4

   * **ESGF_IMAGES_HUB** must reference the name of the Docker repository to pull the images from, which for this
     exercise should be *esgfhub*::

       export ESGF_IMAGES_HUB=esgfhub

   * **ESGF_DATA_DIR** must reference the root of the data directory on your host.

     * for example on linux::
@@ -103,31 +100,21 @@ Setup
        
         export ESGF_DATA_DIR=~/esgf_data 
         
       (since on a mac the Docker engine only has access to the filesystem under the user home directory).
       
     Then create the directory if not existing already::
     
       mkdir -p $ESGF_DATA_DIR

   * **ESGF_VERSION** is the version of the ESGF/Docker stack to be used, 
     which is recommended to be the latest stable version, e.g.::
     Note that this location is currently not really used to store any data.

       export ESGF_VERSION=1.1

* Initialize your node configuration: create a self-signed certificate 
  for $ESGF_HOSTNAME and populate the $ESGF_CONFIG directory with initial content. From the scripts/ directory::
  for $ESGF_HOSTNAME and populate the $ESGF_CONFIG directory with initial content::
  
    ./esgf_node_init.sh
    ls -l $ESGF_CONFIG

  Note: if you are going through these instructions more than one time, 
  make sure you don't have previous containers that were configured with a different version of the certificates. 
  So before re-initializing the node, make sure to stop all running containers. It might be also useful to remove all previously created volumes. From
  the top-level *esgf-docker/* directory, issue the commands::
  Note: if you are on a Mac, ensure **gtar** and **xz** utilities are installed before running the :code:`esgf_node_init.sh` script::
    
    docker-compose down 
    docker rm $(docker ps -a -q)
    docker volume ls -qf dangling=true | xargs docker volume rm
    ./scripts/esgf_node_init.sh
    ls -l $ESGF_CONFIG

  Note: it's been observed that the Docker engine on a mac might not track time correctly 
  if the mac goes into sleep mode, which may cause problems with the validity of the certificates. 
@@ -140,25 +127,22 @@ Execution
   If not done now, the images will be pulled down automatically one by
   one when each service is started. Note that downloading or
   pre-downloading all the images (which amount to several GBs) may take
   a considerable time, depending on your internet connection. From the *scripts/* directory::
   a considerable time, depending on your internet connection.::
   
     ./docker_pull_all.sh $ESGF_VERSION
     ./scripts/docker_pull_all.sh $ESGF_VERSION
     docker images | grep $ESGF_VERSION

   Make sure the hash of each image is what you would expect from the $ESGF_VERSION you are using.

*  Start all ESGF services in daemon mode, then look at the combined
   logs. Even if the images have been pre-download, starting all the
   services the first time may take a few minutes as the host system is
   allocating memory, disk space, and initializing each service.
   
   * if you have pre-downloaded the images, issue::
     
       docker images 
     
     to make sure the version of the images matches what you expect from $ESGF_VERSION
 
   * from the top-level *esgf-docker/* directory::
   From the top-level *esgf-docker/* directory::

       docker-compose up -d
       docker-compose logs -f
       # in another terminal:
       docker ps

*  Do some testing. Note that you will have to instruct your browser to
@@ -178,10 +162,22 @@ Execution
    
        http://$ESGF_HOSTNAME/thredds

   * Re-initialize the TDS catalogs::

        https://$ESGF_HOSTNAME/thredds/admin/debug?Catalogs/reinit

     Use username = *dnode_user* and password = *changeit* .
        
   * Download one of the test files. 
     You will have to log onto the ORP with the same openid as above.

* Change the ESGF root password. You must first stop the containers,
   * Test the Solr admin interface::

        https://$ESGF_HOSTNAME/solr

* **NOTE: changing password not currently working in ESGF_VERSION=1.4: will be fixed in ESGF_VERSION=1.5.**
  
  Change the ESGF root password. You must first stop the containers,
  then run a script that picks up the new password from an environment
  variable. This must be done after the containers have been started at
  least once, because the initial default password is hard-coded into the postgres image.
@@ -194,9 +190,9 @@ Execution
  
      export ESGF_PASSWORD=abc123
      
  * From the *scripts/* directory:: 
  * Change the password:: 
  
      ./change_password.sh
      ./scripts/change_password.sh
      
  * Restart the ESGF services to make sure everything still works::
  
+58 −25
Original line number Diff line number Diff line
@@ -4,7 +4,7 @@
 *
 * Sphinx stylesheet -- basic theme.
 *
 * :copyright: Copyright 2007-2014 by the Sphinx team, see AUTHORS.
 * :copyright: Copyright 2007-2017 by the Sphinx team, see AUTHORS.
 * :license: BSD, see LICENSE for details.
 *
 */
@@ -52,6 +52,8 @@ div.sphinxsidebar {
    width: 230px;
    margin-left: -100%;
    font-size: 90%;
    word-wrap: break-word;
    overflow-wrap : break-word;
}

div.sphinxsidebar ul {
@@ -83,10 +85,6 @@ div.sphinxsidebar #searchbox input[type="text"] {
    width: 170px;
}

div.sphinxsidebar #searchbox input[type="submit"] {
    width: 30px;
}

img {
    border: 0;
    max-width: 100%;
@@ -124,6 +122,8 @@ ul.keywordmatches li.goodmatch a {

table.contentstable {
    width: 90%;
    margin-left: auto;
    margin-right: auto;
}

table.contentstable p.biglink {
@@ -151,9 +151,14 @@ table.indextable td {
    vertical-align: top;
}

table.indextable dl, table.indextable dd {
table.indextable ul {
    margin-top: 0;
    margin-bottom: 0;
    list-style-type: none;
}

table.indextable > tbody > tr > td > ul {
    padding-left: 0em;
}

table.indextable tr.pcap {
@@ -185,8 +190,22 @@ div.genindex-jumpbox {
    padding: 0.4em;
}

/* -- domain module index --------------------------------------------------- */

table.modindextable td {
    padding: 2px;
    border-collapse: collapse;
}

/* -- general body styles --------------------------------------------------- */

div.body p, div.body dd, div.body li, div.body blockquote {
    -moz-hyphens: auto;
    -ms-hyphens: auto;
    -webkit-hyphens: auto;
    hyphens: auto;
}

a.headerlink {
    visibility: hidden;
}
@@ -212,10 +231,6 @@ div.body td {
    text-align: left;
}

.field-list ul {
    padding-left: 1em;
}

.first {
    margin-top: 0 !important;
}
@@ -332,10 +347,6 @@ table.docutils td, table.docutils th {
    border-bottom: 1px solid #aaa;
}

table.field-list td, table.field-list th {
    border: 0 !important;
}

table.footnote td, table.footnote th {
    border: 0 !important;
}
@@ -372,6 +383,20 @@ div.figure p.caption span.caption-number {
div.figure p.caption span.caption-text {
}

/* -- field list styles ----------------------------------------------------- */

table.field-list td, table.field-list th {
    border: 0 !important;
}

.field-list ul {
    margin: 0;
    padding-left: 1em;
}

.field-list p {
    margin: 0;
}

/* -- other body styles ----------------------------------------------------- */

@@ -422,15 +447,6 @@ dl.glossary dt {
    font-size: 1.1em;
}

.field-list ul {
    margin: 0;
    padding-left: 1em;
}

.field-list p {
    margin: 0;
}

.optional {
    font-size: 1.3em;
}
@@ -489,6 +505,13 @@ pre {
    overflow-y: hidden;  /* fixes display issues on Chrome browsers */
}

span.pre {
    -moz-hyphens: none;
    -ms-hyphens: none;
    -webkit-hyphens: none;
    hyphens: none;
}

td.linenos pre {
    padding: 5px 0px;
    border: 0;
@@ -525,11 +548,11 @@ div.code-block-caption span.caption-number {
div.code-block-caption span.caption-text {
}

div.container {
div.literal-block-wrapper {
    padding: 1em 1em 0;
}

div.container div.highlight {
div.literal-block-wrapper div.highlight {
    margin: 0;
}

@@ -580,6 +603,16 @@ span.eqno {
    float: right;
}

span.eqno a.headerlink {
    position: relative;
    left: 0px;
    z-index: 1;
}

div.math:hover a.headerlink {
    visibility: visible;
}

/* -- printout stylesheet --------------------------------------------------- */

@media print {
−2.68 KiB (756 B)
Loading image diff...
Loading