Skip to content

jhole89/terraform-kubernetes-portainer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

terraform-kubernetes-portainer

Local Verify Cluster E2E Go Report Card Latest Release TF Registry License

terraform-kubernetes-portainer is a Terraform module for running Portainer on a Kubernetes cluster. Portainer enables you to deploy applications to your Kubernetes cluster without the need for manifests or helm charts. It is available through the Terraform registry.

Twitter URL

Important note ⚠️

This has an upwards dependency on the portainer-k8s-beta image which itself is only in beta.

Features

The module will create the following Kubernetes resources:

  • Kubernetes Namespace
  • Kubernetes ServiceAccount
  • Kubernetes ClusterRoleBinding
  • Kubernetes PersistentVolumeClaim
  • Kubernetes Deployment
  • Kubernetes Service with LoadBalancer

Usage example

For a complete example, see examples/complete.

provider "kubernetes" {
  config_path = var.kubeconf_path

  config_context_auth_info = var.config_user
  config_context_cluster   = var.cluster_name
}

module "portainer" {
  source       = "jhole89/portainer/kubernetes"
  version      = "1.0.0"
}

IMPORTANT: The master branch is used in examples just as an example. Do not pin to master because there may be breaking changes between releases. Instead, pin to the release tag (e.g. ?ref=tags/x.y.z) from latest releases.

Requirements

Name Version
terraform ~> 0.12.0
kubernetes ~> 1.11

Providers

Name Version
kubernetes ~> 1.11

Inputs

Name Description Type Default Required
edge_port Agent EDGE port. number 8000 no
http_port LoadBalancer HTTP port. number 9000 no
image Docker image. string "portainer/portainer-k8s-beta:linux-amd64" no
labels App labels to be used for namespace, service, and deployment. map(string) {} no
name App name to be used for namespace, service, and deployment. string "portainer" no
service_type Determines how the service is exposed string "ClusterIP" no
storage_class Persisted Volume storage class string "local-path" no
storage_size Persisted Volume storage size string "128Mi" no

Outputs

Name Description
crb_name n/a
deployment_name n/a
ingress n/a
namespace n/a
pvc_name n/a
service_account_name n/a
service_name n/a
service_url n/a
service_version n/a

Contributing

Report issues/questions/feature requests on in the issues section.

Full contributing guidelines are covered here.

Authors

Created by Joel Lutman - [email protected]

License

This module is 100% Open Source and licensed under the APACHE2.

Share the Love

Like this project? Please give it a ★ on GitHub! (it helps a lot)