Skip to content

johncosta/terraform-digitalocean-kubernetes

Repository files navigation

DigitalOcean Terraform Module

Terraform module which creates a DigitalOcean Kubernetes cluster using prescrive defaults.

This module is inspired by terraform-aws-eks

DeepSource GitHub Super-Linter TerraformRegistry

Documentation

External Documentation

Features

  • EKS Cluster
  • Specified Private VPC
  • Exported URNs for DigitalOcean Projects
  • Generated and Export for Kubeconfig file

Using this module

module "k8s" {
  source  = "terraform-digitalocean-kubernetes"
  version = "0.1.4"

  cluster_name_prefix          = "test"
  cluster_region               = "nyc1"
  cluster_version_prefix       = "1.28."

  default_node_pool_node_count = 1
  default_node_pool_node_size  = "s-2vcpu-2gb"

  cluster_ipv4_cidr            = "10.1.0.0/20"

  # writes the kubeconfig to the local filesystem
  path_to_kubeconfig         = "/full/path/to/.kube"
  use_cluster_name_in_config = true

  cluster_addons = {
    /*
     * Add ArgoCD into its own namespace
     */
    argo = {
      enabled = true
      config = {
        subdomain_create = true
      }
    }
    /*
     * Add ingress-nginx and cert-manager into their own namespaces
     */
    ingress = {
      enabled = true
      config  = {
        domain_root              = "example.com"
        domain_certificate_email = "name@example.com"
      }
    }
  }

  # required provider configuration
  providers = {
    digitalocean = digitalocean
  }
}

Retrieving ArgoCD Password

If you're using the ArgoCD addon, you can retrieve the password by running the following command:

Run the following command to retrieve the ArgoCD password:
```shell
kubectl -n argo get secret argocd-initial-admin-secret -o jsonpath="{.data.password}" | base64 -d

Use admin and the password to access the ArgoCD UI.

About

Terraform module to create a Kubernetes cluster and associated resources.

Resources

License

Stars

1 star

Watchers

1 watching

Forks

Packages

 
 
 

Contributors