atlantis
by Trozz
A Helm chart for Atlantis https://www.runatlantis.io
About this chart
Atlantis
Atlantis is a tool for safe collaboration on Terraform repositories.
Introduction
This chart creates a single pod in a StatefulSet running Atlantis. Atlantis persists Terraform plan files and lock files to disk for the duration of a Pull/Merge Request. These files are stored in a PersistentVolumeClaim to survive Pod failures.
Prerequisites
- Kubernetes 1.9+
- PersistentVolume support
Required Configuration
In order for Atlantis to start and run successfully:
-
At least one of the following sets of credentials must be defined:
githubgitlabbitbucket
Refer to values.yaml for detailed examples. They can also be provided directly through a Kubernetes
Secret, use the variablevcsSecretNameto reference it. -
Supply a value for
orgWhitelist, e.g.github.org/myorg/*.
Additional manifests
It is possible to add additional manifests into a deployment, to extend the chart. One of the reason is to deploy a manifest specific to a cloud provider ( BackendConfig on GKE for example ).
extraManifests:
- apiVersion: cloud.google.com/v1beta1
kind: BackendConfig
metadata:
name: "{{ .Release.Name }}-test"
spec:
securityPolicy:
name: "gcp-cloud-armor-policy-test"
Customization
The following options are supported. See values.yaml for more detailed documentation and examples:
| Parameter | Description | Default |
|---|---|---|
dataStorage | Amount of storage available for Atlantis' data directory (mostly used to check out git repositories). | 5Gi |
aws.config | Contents of a file to be mounted to ~/.aws/config. | n/a |
aws.credentials | Contents of a file to be mounted to ~/.aws/credentials. | n/a |
awsSecretName | Secret name containing AWS credentials - will override aws.credentials and aws.config. Will be used a volume mount on $HOME/.aws, so it needs a credentials key. The key config is optional. See the file templates/secret-aws.yml for more info on the Secret contents. | n/a |
bitbucket.user | Name of the Atlantis Bitbucket user. | n/a |
bitbucket.token | Personal access token for the Atlantis Bitbucket user. | n/a |
bitbucket.secret | Webhook secret for Bitbucket repositories (Bitbucket Server only). | n/a |
bitbucket.baseURL | Base URL of Bitbucket Server installation. | n/a |
environment | Map of environment variables for the container. | {} |
environmentSecrets | Array of Kubernetes secrets that can be used to set environment variables. See values.yaml for example. | {} |
environmentRaw | Array environment variables in plain Kubernetes yaml format. See values.yaml for example. | [] |
loadEnvFromSecrets | Array of Kubernetes secrets to set all key-value pairs as environment variables. See values.yaml for example. | [] |
loadEnvFromConfigMaps | Array of Kubernetes ConfigMaps to set all key-value pairs as environment variables. See values.yaml for example. | [] |
extraVolumes | List of additional volumes available to the pod. | [] |
extraVolumeMounts | List of additional volumes mounted to the container. | [] |
imagePullSecrets | List of secrets for pulling images from private registries. | [] |
gitconfig | Contents of a file to be mounted to ~/.gitconfig. Use to allow redirection for Terraform modules in private git repositories. | n/a |
gitconfigSecretName | Name of a pre-existing Kubernetes Secret containing a gitconfig key. Use this instead of gitconfig (optional) | n/a |
command | Optionally override the command field of the Atlantis Docker container. If not set, the default Atlantis ENTRYPOINT is used. Must be an array. | n/a |
github.user | Name of the Atlantis GitHub user. | n/a |
github.token | Personal access token for the Atlantis GitHub user. | n/a |
github.secret | Repository or organization-wide webhook secret for the Atlantis GitHub integration. All repositories in GitHub that are to be integrated with Atlantis must share the same value. | n/a |
github.hostname | Hostname of your GitHub Enterprise installation. | n/a |
gitlab.user | Repository or organization-wide secret for the Atlantis GitLab,integration. All repositories in GitLab that are to be integrated with Atlantis must share the same value. | n/a |
gitlab.token | Personal access token for the Atlantis GitLab user. | n/a |
gitlab.secret | Webhook secret for the Atlantis GitLab integration. All repositories in GitLab that are to be integrated with Atlantis must share the same value. | n/a |
gitlab.hostname | Hostname of your GitLab Enterprise installation. | n/a |
vcsSecretName | Name of a pre-existing Kubernetes Secret containing token and secret keys set to your VCS provider's API token and webhook secret, respectively. Use this instead of github.token/github.secret, etc. (optional) | n/a |
podTemplate.annotations | Additional annotations to use for the StatefulSet. | n/a |
podTemplate.annotations | Additional annotations to use for pods. | {} |
podTemplate.labels | Additional labels to use for pods. | {} |
statefulSet.annotations | Additional annotations to use for StatefulSet. | {} |
statefulSet.labels | Additional labels to use for StatefulSet. | {} |
logLevel | Level to use for logging. Either debug, info, warn, or error. | n/a |
orgWhitelist | Whitelist of repositories from which Atlantis will accept webhooks. This value must be set for Atlantis to function correctly. Accepts wildcard characters (*). Multiple values may be comma-separated. | none |
config | Override atlantis main configuration by config map. It's allow some additional functionality like slack |
Deploy atlantis with OpenTenant
Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has atlantis on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.
- Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
- Place the chartatlantis is pinned at v3.12.11 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
- ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below opentenant validate opentenant.yaml terraform init && terraform apply