|
1 |
| -<img width="1470" alt="digger-opensource-gitops-banner" src="https://github.com/diggerhq/digger/assets/1280498/7fb44db3-38ca-4021-8714-87a2f1a14982"> |
2 |
| - |
3 |
| -CI/CD for Terraform is [tricky](https://itnext.io/pains-in-terraform-collaboration-249a56b4534e). To make life easier, specialised CI systems aka [TACOS](https://itnext.io/spice-up-your-infrastructure-as-code-with-tacos-1a9c179e0783) exist - Terraform Cloud, Spacelift, Atlantis, etc. |
4 |
| - |
5 |
| -But why have 2 CI systems? Why not reuse the async jobs infrastructure with compute, orchestration, logs, etc of your existing CI? |
6 |
| - |
7 |
| -Digger runs terraform natively in your CI. This is: |
8 |
| - |
9 |
| -- Secure, because cloud access secrets aren't shared with a third-party |
10 |
| -- Cost-effective, because you are not paying for additional compute just to run your terraform |
11 |
| - |
12 |
| -## Differences Compared to Atlantis |
13 |
| - |
14 |
| -- No need to host and maintain a server |
15 |
| -- Secure by design |
16 |
| -- Scalable compute with jobs isolation |
17 |
| -- Role-based access control via OPA |
18 |
| -- Read more about differences with Atlantis in our blog post |
19 |
| - |
20 |
| -## Compared to Terraform Cloud and other TACOs |
21 |
| - |
22 |
| -- Open source |
23 |
| -- No duplication of the CI/CD stack |
24 |
| -- Secrets not shared with a third party |
25 |
| - |
26 |
| -## Support for other CI’s |
27 |
| - |
28 |
| -We are currently designing Digger to be Multi-CI, so that in addition to GitHub Actions, you can run Terraform/OpenTofu within other CI’s such as Gitlab CI, Azure DevOps, Bitbucket, TeamCity, Circle CI and Jenkins, while still having the option to orchestrate jobs using Digger’s Orchestrator Backend. |
29 |
| - |
30 |
| -Read more in this [blog](https://blog.digger.dev/how-we-are-designing-digger-to-support-multiple-ci-systems/), and please share your requirement on [Slack](https://bit.ly/diggercommunity) if you require support for other CI’s. Your feedback/insight would help us a lot as this feature is in active development. |
31 |
| - |
32 |
| - |
33 |
| - |
34 | 1 | # Digger Backend Helm Chart
|
35 | 2 |
|
36 |
| -## Installation steps |
37 |
| - |
38 |
| -The installation must be executed in two steps, as explaned in the [Digger official documentation](https://docs.digger.dev/self-host/deploy-docker-compose#create-github-app): |
39 |
| - |
40 |
| -1. Install the `digger-backend` helm chart from https://diggerhq.github.io/helm-charts/, leaving empty all the data related to the GitHub App |
41 |
| -2. Go to `your_digger_hostname/github/setup` to install and configure the GitHub App |
42 |
| -3. Configure in the helm values or in the external secret all the data related to the new GitHub app and upgrade the helm installation to reload the Digger application with the new configuration |
43 |
| - |
44 |
| -## Configuration Details |
45 |
| - |
46 |
| -To configure the Digger backend deployment with the Helm chart, you'll need to set several values in the `values.yaml` file. Below are the key configurations to consider: |
47 |
| - |
48 |
| -- `digger.image.repository`: The Docker image repository for the Digger backend (e.g., `registry.digger.dev/diggerhq/digger_backend`). |
49 |
| -- `digger.image.tag`: The specific version tag of the Docker image to deploy (e.g., `"v0.4.2"`). |
50 |
| - |
51 |
| -- `digger.service.type`: The type of Kubernetes service to create, such as `ClusterIP`, `NodePort`, or `LoadBalancer`. |
52 |
| -- `digger.service.port`: The port number that the service will expose (e.g., `3000`). |
53 |
| - |
54 |
| -- `digger.ingress.enabled`: Set to `true` to create an Ingress for the service. |
55 |
| -- `digger.annotations`: Add the needed annotations based on your ingress controller configuration. |
56 |
| -- `digger.ingress.host`: The hostname to use for the Ingress resource (e.g., `digger-backend.test`). |
57 |
| -- `digger.ingress.path`: The path for the Ingress resource (e.g., `/`). |
58 |
| -- `digger.ingress.className`: the classname to use for ingress (only considered for kuberetes >= 1.18) |
59 |
| -- `digger.ingress.tls.secretName`: The name of the TLS secret to use for Ingress encryption (e.g., `digger-backend-tls`). |
60 |
| - |
61 |
| -- `digger.secret.*`: Various secrets needed for the application, such as `HTTP_BASIC_AUTH_PASSWORD` and `BEARER_AUTH_TOKEN`. You can provide them directly or reference an existing Kubernetes secret by setting `useExistingSecret` to `true` and specifying `existingSecretName`. |
62 |
| - |
63 |
| -- `digger.postgres.*`: If you're using an external Postgres database, configure the `user`, `database`, and `host` accordingly. Ensure you provide the `password` either directly or through an existing secret in the `secret.*` section. |
64 |
| - |
65 |
| -Remember to replace placeholders and default values with your specific, sensitive information before deploying the chart. For example, it's essential to generate a strong `bearerAuthToken` and `postgresPassword` rather than using the defaults for security reasons. |
66 |
| - |
67 |
| -You can also deploy a PostgreSQL database ONLY FOR TEST PURPOSES configuring the `postgres.*` section: |
68 |
| - |
69 |
| -- `postgres.enabled`: Set to `true` if you want to deploy a postgres database |
70 |
| -- `postgres.secret.*`: As for the digger secret, you can pass the `postgres` user password directly or through an existing secret |
| 3 | +This Helm chart deploys the Digger backend orchestrator for managing Terraform/OpenTofu runs in your CI/CD pipelines. |
| 4 | + |
| 5 | +## Installation |
| 6 | + |
| 7 | +### Install from GitHub Container Registry |
| 8 | + |
| 9 | +```bash |
| 10 | +# Install directly |
| 11 | +helm install digger-backend oci://ghcr.io/diggerhq/helm-charts/digger-backend \ |
| 12 | + --namespace digger \ |
| 13 | + --create-namespace \ |
| 14 | + --values values.yaml |
| 15 | + |
| 16 | +# Or pull a specific version |
| 17 | +helm pull oci://ghcr.io/diggerhq/helm-charts/digger-backend --version 0.1.12 |
| 18 | +``` |
| 19 | + |
| 20 | +### Installation Steps |
| 21 | + |
| 22 | +The installation is a two-step process: |
| 23 | + |
| 24 | +1. **Initial deployment**: Install the helm chart with basic configuration |
| 25 | +2. **GitHub App setup**: Navigate to `https://your-digger-hostname/github/setup` to create and configure the GitHub App |
| 26 | +3. **Update configuration**: Add the GitHub App credentials to your values and upgrade the release |
| 27 | + |
| 28 | +## Configuration |
| 29 | + |
| 30 | +### Basic Configuration |
| 31 | + |
| 32 | +Create a `values.yaml` file with your configuration: |
| 33 | + |
| 34 | +```yaml |
| 35 | +digger: |
| 36 | + # Docker image |
| 37 | + image: |
| 38 | + repository: registry.digger.dev/diggerhq/digger_backend |
| 39 | + tag: "v0.6.106" # Should match appVersion in Chart.yaml |
| 40 | + |
| 41 | + # Service configuration |
| 42 | + service: |
| 43 | + type: ClusterIP |
| 44 | + port: 3000 |
| 45 | + |
| 46 | + # Ingress configuration |
| 47 | + ingress: |
| 48 | + enabled: true |
| 49 | + host: "digger.example.com" # Your domain |
| 50 | + annotations: {} # Add your ingress controller annotations |
| 51 | + tls: |
| 52 | + secretName: "digger-tls" # If using TLS |
| 53 | + |
| 54 | + # Required secrets |
| 55 | + secret: |
| 56 | + httpBasicAuthUsername: "admin" |
| 57 | + httpBasicAuthPassword: "<generate-strong-password>" |
| 58 | + bearerAuthToken: "<generate-strong-token>" |
| 59 | + hostname: "digger.example.com" |
| 60 | + |
| 61 | + # GitHub App credentials (filled after setup) |
| 62 | + githubOrg: "" |
| 63 | + githubAppID: "" # Note: uppercase ID |
| 64 | + githubAppClientID: "" |
| 65 | + githubAppClientSecret: "" |
| 66 | + githubAppKeyFile: "" # base64 encoded private key |
| 67 | + githubWebhookSecret: "" |
| 68 | + |
| 69 | + # PostgreSQL configuration |
| 70 | + postgres: |
| 71 | + user: "postgres" |
| 72 | + database: "digger" |
| 73 | + host: "your-postgres-host" |
| 74 | + password: "<generate-strong-password>" |
| 75 | + |
| 76 | + # Resource limits (optional) |
| 77 | + resources: |
| 78 | + requests: |
| 79 | + cpu: 100m |
| 80 | + memory: 128Mi |
| 81 | + limits: |
| 82 | + cpu: 500m |
| 83 | + memory: 512Mi |
| 84 | +``` |
| 85 | +
|
| 86 | +### Database Options |
| 87 | +
|
| 88 | +#### Option 1: External PostgreSQL (Recommended for production) |
| 89 | +```yaml |
| 90 | +digger: |
| 91 | + postgres: |
| 92 | + user: "digger" |
| 93 | + database: "digger" |
| 94 | + host: "postgresql.example.com" |
| 95 | + password: "your-secure-password" |
| 96 | + sslmode: "require" # or "disable" for non-SSL connections |
| 97 | +``` |
| 98 | +
|
| 99 | +#### Option 2: Built-in PostgreSQL (Testing only) |
| 100 | +```yaml |
| 101 | +postgres: |
| 102 | + enabled: true |
| 103 | + secret: |
| 104 | + postgresPassword: "<test-password>" |
| 105 | +``` |
| 106 | +
|
| 107 | +### Using Existing Secrets |
| 108 | +
|
| 109 | +Instead of putting secrets in values.yaml, reference an existing Kubernetes secret: |
| 110 | +
|
| 111 | +```yaml |
| 112 | +digger: |
| 113 | + secret: |
| 114 | + useExistingSecret: true |
| 115 | + existingSecretName: "digger-secrets" |
| 116 | +``` |
| 117 | +
|
| 118 | +## Upgrade After GitHub App Setup |
| 119 | +
|
| 120 | +After configuring the GitHub App at `/github/setup`, update your values with the app credentials and upgrade: |
| 121 | + |
| 122 | +```bash |
| 123 | +helm upgrade digger-backend oci://ghcr.io/diggerhq/helm-charts/digger-backend \ |
| 124 | + --namespace digger \ |
| 125 | + --values values.yaml |
| 126 | +``` |
0 commit comments