Skip to content
This repository has been archived by the owner on Apr 17, 2023. It is now read-only.

Terraform provider plugin for kops

License

Notifications You must be signed in to change notification settings

wandera/terraform-provider-kops

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

44 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

terraform-provider-kops - WIP

Build Status Go Report Card GitHub release License: MIT

Road to 0.0.1-alpha

  • Implement kops/v1alpha2/Cluster flattening to TF state
  • Implement kops_cluster resource state sync
  • Implement kops/v1alpha2/InstanceGroup flattening to TF state
  • Implement kops_instance_group resource state sync
  • Cover flattening/expanding of state by UTs
  • Fill in spec defaults using cloudup package
  • Deep validate spec using cloudup package
  • Run create cluster cmd

Roadmap

  • Run rolling-update cluster cmd automatically
  • Implement Cluster datasource
  • Implement InstanceGroup datasource
  • Implement Keystore datasource
  • Implement Secretstore datasource
  • Implement SSHSecretstore datasource
  • Add e2e tests

Usage

Provider

provider "kops" {
  state_store = "s3://cluster-example-state-storage"
}

Cluster

resource "kops_cluster" "cluster" {
  metadata {
    name = "cluster.example.com"
  }

  spec {
    cloud_provider      = "aws"
    kubernetes_version  = "1.10.11"

    network_cidr        = "10.0.0.0/16"
    non_masquerade_cidr = "10.0.0.0/16"

    topology {
      dns {
        type = "Public"
      }
    }

    networking {
      name = "kuberouter"
    }

    subnet {
      name = "eu-west-1a"
      cidr = "10.0.10.0/24"
      zone = "eu-west-1a"
      type = "Private"
    }

    subnet {
      name = "eu-west-1b"
      cidr = "10.0.11.0/24"
      zone = "eu-west-1b"
      type = "Private"
    }

    subnet {
      name = "eu-west-1c"
      cidr = "10.0.12.0/24"
      zone = "eu-west-1c"
      type = "Private"
    }

    etcd_cluster {
      name            = "main"
      enable_etcd_tls = "true"
      image           = "k8s.gcr.io/etcd:3.2.14"
      version         = "3.2.14"

      etcd_member {
        name             = "eu-west-1a"
        instance_group   = "master-eu-west-1a"
        encrypted_volume = "true"
      }

      etcd_member {
        name             = "eu-west-1b"
        instance_group   = "master-eu-west-1b"
        encrypted_volume = "true"
      }

      etcd_member {
        name             = "eu-west-1c"
        instance_group   = "master-eu-west-1c"
        encrypted_volume = "true"
      }
    }

    etcd_cluster {
      name            = "event"
      enable_etcd_tls = "true"
      image           = "k8s.gcr.io/etcd:3.2.14"
      version         = "3.2.14"

      etcd_member {
        name             = "eu-west-1a"
        instance_group   = "master-eu-west-1a"
        encrypted_volume = "true"
      }

      etcd_member {
        name             = "eu-west-1b"
        instance_group   = "master-eu-west-1b"
        encrypted_volume = "true"
      }

      etcd_member {
        name             = "eu-west-1c"
        instance_group   = "master-eu-west-1c"
        encrypted_volume = "true"
      }
    }
  }
}