Skip to content

Commit

Permalink
postgres helm chart
Browse files Browse the repository at this point in the history
Signed-off-by: prashantrakh <[email protected]>
  • Loading branch information
sks authored and prashantrakh committed Jan 29, 2025
1 parent 2fdd65a commit 0ac3847
Show file tree
Hide file tree
Showing 8 changed files with 31 additions and 23 deletions.
5 changes: 5 additions & 0 deletions deployer-image/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,11 @@ verify: build
@echo "Verifying application with deployer: $(DEPLOYER_IMAGE_RELEASE)"
$(MPDEV) verify --deployer=$(DEPLOYER_IMAGE_RELEASE)

tofu: tofu/fmt

tofu/fmt:
tofu fmt --recursive .

validate:
@echo "Validating schema file: $(SCHEMA_FILE)"
$(MPDEV) validate --schema=$(SCHEMA_FILE)
Expand Down
12 changes: 6 additions & 6 deletions deployer-image/terraform/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ provider "kubernetes" {
token = file("/var/run/secrets/kubernetes.io/serviceaccount/token")
cluster_ca_certificate = file("/var/run/secrets/kubernetes.io/serviceaccount/ca.crt")
# If the cluster CA is signed by a recognized authority, you can set 'insecure = false'
insecure = false
insecure = false
}

module "stackgen" {
source = "./modules/stackgen-installation"
domain = var.domain
STACKGEN_PAT = var.STACKGEN_PAT
suffix = var.suffix
source = "./modules/stackgen-installation"
domain = var.domain
STACKGEN_PAT = var.STACKGEN_PAT
suffix = var.suffix
global_static_ip_name = var.global_static_ip_name
pre_shared_cert_name = var.pre_shared_cert_name
pre_shared_cert_name = var.pre_shared_cert_name
}
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,13 @@ locals {
##############################################################################

resource "helm_release" "postgresql" {
name = "my-postgresql"
namespace = "stackgen"
chart = "postgresql-16.4.3.tgz" # Path to your local chart file
name = "postgres"

repository = "oci://registry-1.docker.io/"
chart = "bitnamicharts/postgresql"
version = "16.4.5"

namespace = var.namespace
values = [
yamlencode(local.postgresql_values) # Convert the object to a YAML string
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ resource "kubernetes_service_account" "stackgen_identity" {


resource "kubernetes_config_map" "dex_configmap" {
depends_on = [ kubernetes_namespace.this ]
depends_on = [kubernetes_namespace.this]
metadata {
name = "dex-configmap"
namespace = var.namespace
Expand Down Expand Up @@ -221,7 +221,7 @@ locals {
enable_feature : var.enable_feature
appcd_admin_emails : var.admin_emails
enable_storage : length(var.storage.volume) > 0
appcd_service_account: local.appcd_service_account
appcd_service_account : local.appcd_service_account
})
}

Expand Down
14 changes: 7 additions & 7 deletions deployer-image/terraform/modules/stackgen-installation/proxy.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ resource "kubernetes_config_map" "proxy_config" {

data = {
"nginx.conf" = join("\n", compact([
templatefile("./values/proxy-base.conf.tpl", {
templatefile("./values/proxy-base.conf.tpl", {
domain = var.domain,
namespace = var.namespace
}),
Expand Down Expand Up @@ -60,7 +60,7 @@ resource "kubernetes_deployment" "nginx_server" {
port = 80
}
initial_delay_seconds = 5
period_seconds = 10
period_seconds = 10
}

liveness_probe {
Expand All @@ -69,7 +69,7 @@ resource "kubernetes_deployment" "nginx_server" {
port = 80
}
initial_delay_seconds = 10
period_seconds = 15
period_seconds = 15
}
}

Expand All @@ -88,9 +88,9 @@ resource "kubernetes_deployment" "nginx_server" {

# Kubernetes Service
resource "kubernetes_service" "nginx_service" {
depends_on = [ kubernetes_deployment.nginx_server ]
depends_on = [kubernetes_deployment.nginx_server]
metadata {
name = "proxy"
name = "proxy"
namespace = var.namespace
}

Expand All @@ -116,7 +116,7 @@ resource "kubernetes_ingress_v1" "nginx_server_ingress" {
namespace = var.namespace

annotations = {
"kubernetes.io/ingress.class" = "gce"
"kubernetes.io/ingress.class" = "gce"
"kubernetes.io/ingress.global-static-ip-name" = var.global_static_ip_name
"ingress.gcp.kubernetes.io/pre-shared-cert" = var.pre_shared_cert_name
}
Expand All @@ -128,7 +128,7 @@ resource "kubernetes_ingress_v1" "nginx_server_ingress" {

http {
path {
path = "/"
path = "/"
path_type = "Prefix"

backend {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,8 @@ variable "storage" {
}
}
variable "global_static_ip_name" {
type = string
type = string
}
variable "pre_shared_cert_name" {
type = string
type = string
}
Binary file removed deployer-image/terraform/postgresql-16.4.3.tgz
Binary file not shown.
6 changes: 3 additions & 3 deletions deployer-image/terraform/variables.tf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
variable "suffix" {
type = string
description = "Suffix to all names"
default = "marketplace"
default = "marketplace"
}

variable "domain" {
Expand All @@ -22,8 +22,8 @@ variable "labels" {
}

variable "global_static_ip_name" {
type = string
type = string
}
variable "pre_shared_cert_name" {
type = string
type = string
}

0 comments on commit 0ac3847

Please sign in to comment.