Commit 652a6e65 authored by FulcrandG's avatar FulcrandG
Browse files

Testing helm job

parent a4ae5efd
Loading
Loading
Loading
Loading

jobs/helm_deploy/README.md

deleted100644 → 0
+0 −42
Original line number Diff line number Diff line
# ☸️  Helm

🚧 *Work in progress*

<!--

Deploy on your kubernetes cluster using Helm charts.

* In issue branch: review environment
* In master branch: staging environment
* In master branch: production environment (manual)

* Chart and values files must be in repo, see Variables section
* Use [helm secrets](https://github.com/futuresimple/helm-secrets) to encrypt/decrypt secrets values files
* Values files must be named like `<ENV>.yaml` for clear text and `secrets.<ENV>.yaml` for encrypted

**Specifications**

* File: https://gitlab.com/go2scale/jobs/raw/2020-03-05_3/jobs/helm.gitlab-ci.yml
* Publications: *TODO*
* Image:
    * Repository: https://gitlab.com/go2scale/dockerfiles/helm
    * Documentation: https://go2scale.gitlab.io/dockerfiles/helm

**Variables**

| Name | Description | Default |
| ---- | ----------- | ------- |
| `REVIEW_DISABLE` | Disable review deployment | |
| `STAGING_DISABLE` | Disable staging deployment | |
| `PRODUCTION_DISABLE` | Disable production deployment | |
| `CHART_PATH` | Path of helm chart to use | `/charts/$CI_PROJECT_NAME` |
| `VALUES_PATH` | Path of values files to use | `./conf/values` |

**Secret variables**

| Name | Description | Type |
| ---- | ----------- | ------- |
| `PGP_PUBLIC` | Public PGP key to decrypt secrets values | `file` |
| `PGP_PRIVATE` | Private PGP key to decrypt secrets values | `file` |

-->
+0 −1
Original line number Diff line number Diff line
* **[helm_deploy-0.0.1](<include tag>)** (initial version)
+46 −0
Original line number Diff line number Diff line
# ☸️  Helm Review

## Description

Deploy your [helm](https://helm.sh/docs/intro/quickstart/) charts as a review environment when a pipeline is run in a merge request

## How to use it

1. Prepare your project with the files needed for the [helm chart](https://helm.sh/docs/chart_template_guide/getting_started/)
2. Add the corresponding URL to your `.gitlab-ci.yml` file (see [Getting
   started](/getting-started)). Example:

    ```yaml
    include:
      - remote: 'https://jobs.go2scale.io/helm_review.yml'
    ```

3. If you need to customize the job (stage, variables, ...) 👉 check the [jobs
   customization](/getting-started/#jobs-customization)
4. Well done, your job is ready to work ! 😀

## Job details

* Job name: `helm_review`
* Docker image:
[`lachlanevenson/k8s-helm:v3.0.2`](https://hub.docker.com/r/lachlanevenson/k8s-helm/)
* Default stage: `review`
* When: `always`

### Variables

| Name | Description | Default |
| ---- | ----------- | ------- |
| `CHART_PATH` <img width=250/> | Path to the directory of the chart <img width=400/> | `./charts/$CI_PROJECT_NAME` |
| `VALUES_PATH` | Path to value files | `./conf/values` |
| `REGISTRY` | Registry from where to pull container image | `${CI_REGISTRY_IMAGE}` |
| `KUBECTL_URL` | Url to get kubectl binary | `https://storage.googleapis.com/kubernetes-release/release/v1.17.0/bin/linux/amd64/kubectl` |
| `HELMSECRETS_URL` | Url to get kubectl secrets plugin | `https://github.com/futuresimple/helm-secrets` |
| `HELMSECRETS_VERSION` | Version of kubectl secrets plugin | `v2.0.2` |
| `STABLE_REPO_URL` | Url of stable repo to add to helm | `https://kubernetes-charts.storage.googleapis.com/` |
| `HELM_ADDITIONAL_OPTIONS` | Additional settings to give to helm for deployment | ` ` |

### Secrets

Secrets files are encrypted with the helm plugin [secrets](https://github.com/zendesk/helm-secrets).
It will allow to decrypt any secrets.review.yaml that you have in your `${VALUES_PATH}`, like a database password for example.
+2 −39
Original line number Diff line number Diff line
# "Helm" jobs
# "Helm review" jobs
# See https://gitlab.com/go2scale/jobs/ for more informations

.helm:
@@ -75,40 +75,3 @@ cleanup_review:
  except:
    refs:
      - master
 No newline at end of file

#test_stage:
#  extends: deploy_stage
#  stage: application_level
#  script:
#    - helm secrets diff upgrade ${CI_PROJECT_PATH_SLUG} ${CHART_PATH} -f ${VALUES_PATH}/${ENV}.yaml -f ${VALUES_PATH}/secrets.${ENV}.yaml --set-string image.tag=${CI_COMMIT_SHORT_SHA} --namespace "$KUBE_NAMESPACE" --allow-unreleased

# deploy_stage:
#   extends: .helm
#   stage: staging
#   environment:
#     name: staging
#     url: https://${CI_ENVIRONMENT_SLUG}.${CI_PROJECT_NAME}.${KUBE_INGRESS_BASE_DOMAIN}/
#   only:
#     - master
#   except:
#     variables:
#       - ${STAGING_DISABLE}

#test_production:
#  extends: deploy_production
#  stage: application_level
#  script:
#    - helm secrets diff upgrade ${CI_PROJECT_PATH_SLUG} ${CHART_PATH} -f ${VALUES_PATH}/${ENV}.yaml -f ${VALUES_PATH}/secrets.${ENV}.yaml --set-string image.tag=${CI_COMMIT_SHORT_SHA} --namespace "$KUBE_NAMESPACE" --allow-unreleased

# deploy_production:
#   extends: .helm
#   stage: production
#   environment:
#     name: production
#     url: https://${CI_PROJECT_NAME}.${KUBE_INGRESS_BASE_DOMAIN}/
#   when: manual
#   only:
#     - master
#   except:
#     variables:
#       - ${PRODUCTION_DISABLE}
Loading