diff --git a/source/developer_guide/interact_with_k8s.rst b/source/developer_guide/interact_with_k8s.rst index 1c22d467fe1596faaded41ed1caa92d8660b4b0c..9a7c0c251841af70ac06cca536ec807fa8cdae83 100644 --- a/source/developer_guide/interact_with_k8s.rst +++ b/source/developer_guide/interact_with_k8s.rst @@ -132,7 +132,8 @@ while testing you app in a browser. The do helm script ------------------------------------------------------------------------------- -The script ``do_helm.sh`` is present in both example project, it's purpose is +The script ``do_helm.sh`` is available `here <https://gitlab.pasteur.fr/hub/shiny-k8s-example/-/blob/advanced-scripts/dohelm.sh>`_ +present in both example project, it's purpose is to mimics what happens in the CI, and deploy to kubernetes the application. The script @@ -150,7 +151,7 @@ The script .. code-block:: bash - :caption: The script ``do_helm.sh`` present in the skeleton of the project + :caption: The script ``do_helm.sh`` is available at https://gitlab.pasteur.fr/hub/shiny-k8s-example/-/tree/advanced-scripts. :linenos: #!/usr/bin/env bash @@ -158,6 +159,11 @@ The script touch tokens.sh source ./tokens.sh # put `export SECRET_KEY="..."` in this file + if [ ! -e .gitlab-ci.yml ]; then + echo "You are not at the root of your project (where .gitlab-ci.yml is), we cannot run." + exit 1 + fi + NAMESPACE="rshiny-dev" CI_PROJECT_NAMESPACE="hub" CI_PROJECT_NAME="shiny-k8s-example" @@ -176,12 +182,12 @@ The script helm ${ACTION} --namespace=${NAMESPACE} \ --render-subchart-notes \ - --set shiny-server.ingress.className=${INGRESS_CLASS} \ - --set shiny-server.ingress.hostname=${PUBLIC_URL} \ - --set shiny-server.imageFullNameAndTag=${IMAGE} \ - --set shiny-server.registry.username=${DEPLOY_USER} \ - --set shiny-server.registry.password=${DEPLOY_TOKEN} \ - --set shiny-server.registry.host=${CI_REGISTRY} \ + --set shiny-k8s-toolkit-helm.ingress.className=${INGRESS_CLASS} \ + --set shiny-k8s-toolkit-helm.ingress.hostname=${PUBLIC_URL} \ + --set shiny-k8s-toolkit-helm.imageFullNameAndTag=${IMAGE} \ + --set shiny-k8s-toolkit-helm.registry.username=${DEPLOY_USER} \ + --set shiny-k8s-toolkit-helm.registry.password=${DEPLOY_TOKEN} \ + --set shiny-k8s-toolkit-helm.registry.host=${CI_REGISTRY} \ ${CI_COMMIT_REF_SLUG}-${CHART_LOCATION} ./${CHART_LOCATION}/ @@ -189,7 +195,7 @@ If you use the script as is, it produce on the ouput the yaml template that would be applied by helm to deploy your application to Kubernetes. You should first adapte variables to your settings (line 6-8). -Commenting line 20, will make the action to be ``upgrade --install``, and +Commenting line 25, will make the action to be ``upgrade --install``, and thus running the script will actually deploy the application. Here is an example output: diff --git a/source/user_guide/helm_settings.rst b/source/user_guide/helm_settings.rst index f48ad9d39a8f1ca046ed5d85fdd41e1710bebdd1..ecd53402567fe74e9098f6dd1aa4486e8eeac2c2 100644 --- a/source/user_guide/helm_settings.rst +++ b/source/user_guide/helm_settings.rst @@ -312,7 +312,7 @@ Here are all the settings you may want to change .. code-block:: yaml :linenos: - shiny-server: + shiny-k8s-toolkit-helm: registry: private: false nodowntime: @@ -357,7 +357,7 @@ your sources. :caption: private/internal project :linenos: - shiny-server: + shiny-k8s-toolkit-helm: registry: private: true @@ -367,7 +367,7 @@ your sources. :caption: public project :linenos: - shiny-server: + shiny-k8s-toolkit-helm: registry: private: false @@ -396,7 +396,7 @@ your quota (cf :ref:`See quota and logs <quota and logs>`). .. code-block:: yaml - shiny-server: + shiny-k8s-toolkit-helm: nodowntime: enabled: false @@ -412,7 +412,7 @@ will consume resources, so keep an eye on your quota and your resources. .. code-block:: yaml - shiny-server: + shiny-k8s-toolkit-helm: autoscaling: enabled: false minReplicas: 1 @@ -432,7 +432,7 @@ and also the quota you need. .. code-block:: yaml - shiny-server: + shiny-k8s-toolkit-helm: resources: requests: memory: "256Mi" @@ -450,7 +450,7 @@ define the maximum size of such file. .. code-block:: yaml - shiny-server: + shiny-k8s-toolkit-helm: ingress: annotations: nginx.ingress.kubernetes.io/affinity: cookie @@ -476,7 +476,7 @@ You can have folders for a persistent storage : .. code-block:: yaml - shiny-server: + shiny-k8s-toolkit-helm: storage: enabled: false size: "1Gi" @@ -518,7 +518,7 @@ application is removed. .. code-block:: yaml - shiny-server: + shiny-k8s-toolkit-helm: autoscaling: enabled: true nodowntime: