Skip to content

Commit

Permalink
Fix ingress for analytics demo
Browse files Browse the repository at this point in the history
  • Loading branch information
Pascal Holy committed Sep 23, 2021
1 parent 4559a8e commit 3a18ce6
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 34 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -247,21 +247,3 @@ spec:
securityContext:
runAsNonRoot: true
runAsUser: 2000
---
{{ if .Values.global.ingress.nodePort }}
kind: Service
apiVersion: v1
metadata:
name: traefik-node-port
namespace: kube-system
spec:
selector:
k8s-app: traefik-ingress-lb
ports:
- protocol: TCP
port: 80
nodePort: {{ .Values.global.ingress.nodePort }}
targetPort: 80
name: web
type: NodePort
{{ end }}
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ spec:
app.kubernetes.io/instance: ingress-nginx
app.kubernetes.io/component: controller
---
{{ if .Values.global.kubernetes.ngrokEnabled }}
{{ if or ( .Values.global.kubernetes.ngrokEnabled ) ( .Values.global.ingress.nodePort ) }}
kind: Service
apiVersion: v1
metadata:
Expand All @@ -70,7 +70,7 @@ spec:
ports:
- protocol: TCP
port: 80
nodePort: 80
nodePort: {{ default 80 .Values.global.ingress.nodePort }}
targetPort: 80
name: web
selector:
Expand Down
2 changes: 1 addition & 1 deletion infrastructure/terraform/demos/analytics/files/values.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
global:
kubernetes:
appImageTag: 0.30.0
appImageTag: ${app_image_tag}
containerRegistry: ghcr.io/airyhq
namespace: default
ngrokEnabled: false
Expand Down
27 changes: 14 additions & 13 deletions infrastructure/terraform/demos/analytics/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -19,22 +19,22 @@ provider "helm" {
module "vpc" {
source = "scholzj/vpc/aws"

aws_region = "${var.aws_region}"
aws_zones = "${var.aws_zones}"
vpc_name = "${var.vpc_name}"
vpc_cidr = "${var.vpc_cidr}"
private_subnets = "${var.private_subnets}"
aws_region = var.aws_region
aws_zones = var.aws_zones
vpc_name = var.vpc_name
vpc_cidr = var.vpc_cidr
private_subnets = var.private_subnets

## Tags
tags = "${var.tags}"
tags = var.tags
}

module "minikube" {
source = "scholzj/minikube/aws"
version = "1.14.1"

aws_subnet_id = module.vpc.subnet_ids[0]
aws_instance_type = "m4.large"
aws_instance_type = "m4.xlarge"
cluster_name = var.host
hosted_zone = var.hosted_zone
tags = {
Expand All @@ -52,8 +52,8 @@ module "minikube" {

resource "null_resource" "k8s_configuration" {
triggers = {
host = var.host
hosted_zone = var.hosted_zone
host = var.host
hosted_zone = var.hosted_zone
}
provisioner "local-exec" {
command = "sleep 240 && scp -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null centos@${self.triggers.host}.${var.hosted_zone}:/home/centos/kubeconfig ${var.kubeconfig_file}"
Expand All @@ -68,8 +68,9 @@ data "template_file" "values_yaml" {
template = file("${path.module}/files/values.yaml")

vars = {
host = var.host
hosted_zone = var.hosted_zone
host = var.host
hosted_zone = var.hosted_zone
app_image_tag = replace(file("${path.module}/../../../../VERSION"), "\n", "")
}
}

Expand All @@ -94,10 +95,10 @@ resource "helm_release" "airy_core" {
}

resource "helm_release" "jupyterhub" {
name = "jupyterhub"
name = "jupyterhub"
chart = "https://jupyterhub.github.io/helm-chart/jupyterhub-1.1.3.tgz"

values = [ file("${path.module}/files/jupyter-config.yaml") ]
values = [file("${path.module}/files/jupyter-config.yaml")]

depends_on = [
null_resource.k8s_configuration
Expand Down

0 comments on commit 3a18ce6

Please sign in to comment.