Terraform Installation
This guide will walk you through the process of installing ScaleOps via Terraform.
Overview
ScaleOps provides a Terraform module that:
- Creates the ScaleOps namespace
- Applies the ScaleOps CRDs and waits for them to be established
- Installs the ScaleOps Helm release
Prerequisites
- Terraform 1.0 or higher
- kubectl access to the target cluster
- ScaleOps token
Usage
Configure the helm and kubernetes providers for your cluster, then call the ScaleOps module:
Amazon EKS
data "aws_eks_cluster" "this" {
name = "<CLUSTER_NAME>"
}
provider "kubernetes" {
host = data.aws_eks_cluster.this.endpoint
cluster_ca_certificate = base64decode(data.aws_eks_cluster.this.certificate_authority[0].data)
exec {
api_version = "client.authentication.k8s.io/v1beta1"
command = "aws"
# Requires the AWS CLI to be installed where Terraform is executed
args = ["eks", "get-token", "--cluster-name", "<CLUSTER_NAME>"]
}
}
provider "helm" {
kubernetes {
host = data.aws_eks_cluster.this.endpoint
cluster_ca_certificate = base64decode(data.aws_eks_cluster.this.certificate_authority[0].data)
exec {
api_version = "client.authentication.k8s.io/v1beta1"
command = "aws"
args = ["eks", "get-token", "--cluster-name", "<CLUSTER_NAME>"]
}
}
}
module "scaleops" {
source = "https://scriptshelf.scaleops.com/install/integrate.tf.tar.gz"
scaleops_token = "<SCALEOPS_TOKEN>"
cluster_name = "<CLUSTER_NAME>"
}Then apply the configuration:
terraform init
terraform applyNote: The module applies CRDs using
kubernetes_manifest, which requires the cluster to be reachable duringterraform plan.
Inputs
| Name | Description | Default | Required |
|---|---|---|---|
scaleops_token | ScaleOps token for authentication to the ScaleOps registry | - | Yes |
cluster_name | Name of the cluster where ScaleOps will be installed | - | Yes |
chart_version | ScaleOps Helm chart version, or latest | latest | No |
scaleops_namespace | Namespace where ScaleOps will be installed | scaleops-system | No |
helm_repository | ScaleOps Helm chart repository URL | https://registry.scaleops.com/charts | No |
image_registry | Container image registry for ScaleOps images | registry.scaleops.com | No |
extra_values | Additional Helm values as YAML documents | [] | No |