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.6"
      source = "shipa-corp/shipa"
    }
  }
}

provider "shipa" {
  host = "http://target.shipa.cloud:8080"
  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

Component

Description

Type

resource

shipa_cluster is Shipa's component for managing cluster binding.

string

cluster

Top level cluster definitions

name

The 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

endpoint

The Kubernetes cluster API address, token, and certificate that Shipa should use when connecting with the cluster.

Required: Yes

ingress_controllers

Specific 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

resources

Define the Shipa frameworks that should be bound to the cluster

Required: Yes

Endpoint

Component path: resource > cluster > endpoint

Component

Description

Type

addresses

The 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_cert

The 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

token

The 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

Component

Description

Type

type

The 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_type

The 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

debug

The level of logging produced when using the selected ingress controller.

Required: No

bool

ingress_ip

The 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

Component

Description

Type

frameworks

The name of the frameworks that should be bound to the cluster.

Required: Yes

string


Did this page help you?