Cluster Management

The Shipa provider for Terraform allows you to manage the clusters you bind to Shipa directly from Terraform.

The example below shows the different options that can be leveraged when binding clusters to Shipa through Terraform:

Binding Clusters

terraform {
  required_providers {
    shipa = {
      version = "0.0.13"
      source = "shipa-corp/shipa"
    }
  }
}

provider "shipa" {
  host = "http://target.shipa.cloud:80"
  token = "<your-shipa-token>"
}

resource "shipa_cluster" "clbind" {
  cluster {
    name = "bind-cl1"
    endpoint {
      addresses = ["https://k8s-api.com:443"]
      ca_cert = <<-EOT
      -----BEGIN CERTIFICATE-----
      -----END CERTIFICATE-----
      EOT
      token = "xxxxxxx"
    }
    ingress_controllers {
      type = "istio"
      service_type = "loadbalancer"
      debug = false
      ingress_ip = "xx.xx.xx.xx"
    }
    resources {
      frameworks {
        name = ["fw1", "fw2", "fw3"]
      }
    }
  }
}

Top-Level Attributes

ComponentDescriptionType
resourceshipa_cluster is Shipa's component for managing cluster binding.string
clusterTop level cluster definitions
nameThe name of the cluster that will be used as the identifier when binding it to Shipa.

The cluster name used here does not need to match the actual cluster name.

Required: Yes
string
endpointThe Kubernetes cluster API address, token, and certificate that Shipa should use when connecting with the cluster.

Required: Yes
ingress_controllersSpecific ingress configuration that should be used by Shipa when binding frameworks to the cluster.

Required: No
If not defined, Shipa will automatically select Traefik and pre-configure it
resourcesDefine the Shipa frameworks that should be bound to the cluster

Required: Yes

Endpoint

Component path: resource > cluster > endpoint

ComponentDescriptionType
addressesThe Kubernetes cluster API address that Shipa should use when connecting to the cluster.

You can find detailed information on how to find your cluster information here

Required: Yes
string
ca_certThe CA Cert that should be used by Shipa when connecting to the cluster API

You can find detailed information on how to find your cluster information here

Required: Yes
string
tokenThe Shipa admin account token that was previously added to your cluster so Shipa can successfully connect to it.

You can find detailed information on how to create a service account for Shipa in your cluster here

Required: Yes
string

Ingress Controllers

Component path: resource > cluster > ingress_controllers

ComponentDescriptionType
typeThe ingress controller that should be used by Shipa when connecting frameworks to the cluster.

Options:
istio
traefik

Required: Yes

If you are binding frameworks where Istio is the selected ingress controller, make sure Istio is already installed and available in the cluster. More information available here

When connecting frameworks where Traefik is the selected ingress controller, Shipa can automatically configure Traefik
string
service_typeThe service type that should be used by Shipa when deploying applications through the framework to the cluster

Options:
loadbalancer
clusterip
nodeport

Required: No

If not selected, Shipa will automatically assign LoadBalancer as the default option.
string
debugThe level of logging produced when using the selected ingress controller.

Required: No
bool
ingress_ipThe ingress controller IP that Shipa should use when creating application endpoints.

Required: No
Condition: If Traefik is selected, Shipa can auto-configure it. If Istio is selected, then you must enter the Istio service IP. More information available here
string

Resources

Component path: resource > cluster > resources

ComponentDescriptionType
frameworksThe name of the frameworks that should be bound to the cluster.

Required: Yes
string