Skip to content

convictionsai/terraform-kubernetes-deployment

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Unified deployment module

This module is to be sourced from other repositories that need to deploy a service to kubernetes.

Usage

Terraform

provider "kubernetes" {
    config_path = "~/.kube/config"
}

variable "tag" {}

locals {
    settings = {
        name      = "test-app-1"
        namespace = "convictionsai"
        type      = "backend"
        version   = var.tag
        resources = {
            replicas = 1
            requests = {
                cpu    = "500m"
                memory = "500Mi"
            }
            limits = {
                cpu    = "500m"
                memory = "500Mi"
            }
        }
        networking = {
            ingress = {
                hostname = "api.convictions.ai"
                path     = "/"
            }
            ports = [
                {
                    name = "http"
                    port = 8080
                }
            ]
        }
        env = {
            PORT        = 8080
            DB_HOST     = "mysql"
            DB_PORT     = 3306
            DB_USERNAME = "changeme"
            DB_PASSWORD = "changeme"
        }
    }
}

module "deploy" {
    source   = "git::ssh://[email protected]:convictionsai/terraform-kubernetes-deployment.git?ref=0.0.2"
    settings = local.settings
}

YAML

settings:
  name: app
  namespace: convictionsai
  type: backend
  resources:
    replicas: 1
    requests:
      cpu: 500m
      memory: 500Mi
    limits:
      cpu: 500m
      memory: 500Mi
  networking:
    ingress:
      hostname: api.convictions.ai
      path: /
    ports:
      - name: http
        port: 8080
  env:
    DB_HOST: mysql
    DB_PORT: 3306
    DB_USERNAME: changeme
    DB_PASSWORD: changeme

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Languages