From 5b4c49e12ae228a253c686e85d44ccd72ca17ea8 Mon Sep 17 00:00:00 2001 From: Engin Diri Date: Fri, 13 Dec 2024 11:03:45 +0100 Subject: [PATCH] chore: change helm chart and NS --- helm-kubernetes-csharp/Program.cs | 27 +++++++++------------- helm-kubernetes-csharp/Pulumi.yaml | 2 +- helm-kubernetes-go/Pulumi.yaml | 2 +- helm-kubernetes-go/main.go | 22 ++++++++---------- helm-kubernetes-python/Pulumi.yaml | 2 +- helm-kubernetes-python/__main__.py | 22 ++++++++---------- helm-kubernetes-typescript/Pulumi.yaml | 2 +- helm-kubernetes-typescript/index.ts | 32 ++++++++++++-------------- helm-kubernetes-yaml/Pulumi.yaml | 23 ++++++++---------- metadata/dist/metadata.json | 12 +++++----- 10 files changed, 65 insertions(+), 81 deletions(-) diff --git a/helm-kubernetes-csharp/Program.cs b/helm-kubernetes-csharp/Program.cs index e4a54fd13..75320da8c 100644 --- a/helm-kubernetes-csharp/Program.cs +++ b/helm-kubernetes-csharp/Program.cs @@ -5,10 +5,10 @@ return await Deployment.RunAsync(() => { var config = new Config(); - var k8sNamespace = config.Get("k8sNamespace") ?? "default"; + var k8sNamespace = config.Get("k8sNamespace") ?? "ingress-nginx"; var appLabels = new InputMap { - { "app", "nginx-ingress" }, + { "app", "ingress-nginx" }, }; var ingressns = new Kubernetes.Core.V1.Namespace("ingressns", new() @@ -22,33 +22,28 @@ var ingresscontroller = new Kubernetes.Helm.V3.Release("ingresscontroller", new() { - Chart = "nginx-ingress", + Chart = "ingress-nginx", Namespace = ingressns.Metadata.Apply(m => m.Name), RepositoryOpts = new Kubernetes.Types.Inputs.Helm.V3.RepositoryOptsArgs { - Repo = "https://helm.nginx.com/stable", + Repo = "https://kubernetes.github.io/ingress-nginx", }, SkipCrds = true, Values = new Dictionary { + ["serviceAccount"] = new Dictionary + { + ["automountServiceAccountToken"] = "true" + }, ["controller"] = new Dictionary { - ["enableCustomResources"] = "false", - ["appprotect"] = new Dictionary - { - ["enable"] = "false" - }, - ["appprotectdos"] = new Dictionary - { - ["enable"] = "false" - }, - ["service"] = new Dictionary + ["publishService"] = new Dictionary { - ["extraLabels"] = appLabels + ["enabled"] = "true" }, }, }, - Version = "0.14.1", + Version = "4.11.3", }); return new Dictionary diff --git a/helm-kubernetes-csharp/Pulumi.yaml b/helm-kubernetes-csharp/Pulumi.yaml index 805e4cdde..5ac1adcd0 100644 --- a/helm-kubernetes-csharp/Pulumi.yaml +++ b/helm-kubernetes-csharp/Pulumi.yaml @@ -5,5 +5,5 @@ template: description: A C# program to deploy a Helm chart onto a Kubernetes cluster config: k8sNamespace: - default: nginx-ingress + default: ingress-nginx description: The Kubernetes namespace to deploy into diff --git a/helm-kubernetes-go/Pulumi.yaml b/helm-kubernetes-go/Pulumi.yaml index edde312d4..1f9fc992d 100644 --- a/helm-kubernetes-go/Pulumi.yaml +++ b/helm-kubernetes-go/Pulumi.yaml @@ -5,5 +5,5 @@ template: description: A Go program to deploy a Helm chart onto a Kubernetes cluster config: k8sNamespace: - default: nginx-ingress + default: ingress-nginx description: The Kubernetes namespace to deploy into diff --git a/helm-kubernetes-go/main.go b/helm-kubernetes-go/main.go index d4f6215ec..88a51c57b 100644 --- a/helm-kubernetes-go/main.go +++ b/helm-kubernetes-go/main.go @@ -16,7 +16,7 @@ func main() { k8sNamespace = "default" } appLabels := pulumi.StringMap{ - "app": pulumi.String("nginx-ingress"), + "app": pulumi.String("ingress-nginx"), } // Create a new namespace (user supplies the name of the namespace) @@ -32,27 +32,25 @@ func main() { // Use Helm to install the Nginx ingress controller ingresscontroller, err := helmv3.NewRelease(ctx, "ingresscontroller", &helmv3.ReleaseArgs{ - Chart: pulumi.String("nginx-ingress"), + Chart: pulumi.String("ingress-nginx"), Namespace: ingressNs.Metadata.Name(), RepositoryOpts: &helmv3.RepositoryOptsArgs{ - Repo: pulumi.String("https://helm.nginx.com/stable"), + Repo: pulumi.String("https://kubernetes.github.io/ingress-nginx"), }, SkipCrds: pulumi.Bool(true), Values: pulumi.Map{ + "servicAccount": pulumi.Map{ + "automountServiceAccountToken": pulumi.Bool(true), + }, "controller": pulumi.Map{ - "enableCustomResources": pulumi.Bool(false), - "appprotect": pulumi.Map{ - "enable": pulumi.Bool(false), - }, - "appprotectdos": pulumi.Map{ - "enable": pulumi.Bool(false), - }, "service": pulumi.Map{ - "extraLabels": appLabels, + "publishService": pulumi.Map{ + "enabled": pulumi.Bool(true), + }, }, }, }, - Version: pulumi.String("0.14.1"), + Version: pulumi.String("4.11.3"), }) if err != nil { return err diff --git a/helm-kubernetes-python/Pulumi.yaml b/helm-kubernetes-python/Pulumi.yaml index 742627868..6fb02adcc 100644 --- a/helm-kubernetes-python/Pulumi.yaml +++ b/helm-kubernetes-python/Pulumi.yaml @@ -5,5 +5,5 @@ template: description: A Python program to deploy a Helm chart onto a Kubernetes cluster config: k8sNamespace: - default: nginx-ingress + default: ingress-nginx description: The Kubernetes namespace to deploy into diff --git a/helm-kubernetes-python/__main__.py b/helm-kubernetes-python/__main__.py index e9b86baf4..4aedc67cf 100644 --- a/helm-kubernetes-python/__main__.py +++ b/helm-kubernetes-python/__main__.py @@ -4,7 +4,7 @@ config = pulumi.Config() k8s_namespace = config.get("k8sNamespace", "default") app_labels = { - "app": "nginx-ingress", + "app": "ingress-nginx", } # Create a namespace (user supplies the name of the namespace) @@ -19,27 +19,23 @@ # Use Helm to install the Nginx ingress controller ingresscontroller = kubernetes.helm.v3.Release( "ingresscontroller", - chart="nginx-ingress", + chart="ingress-nginx", namespace=ingress_ns.metadata.name, repository_opts={ - "repo": "https://helm.nginx.com/stable", + "repo": "https://kubernetes.github.io/ingress-nginx", }, skip_crds=True, values={ + "serviceAccount": { + "automountServiceAccountToken": True, + }, "controller": { - "enableCustomResources": False, - "appprotect": { - "enable": False, - }, - "appprotectdos": { - "enable": False, - }, - "service": { - "extraLabels": app_labels, + "publishService": { + "enabled": True, }, }, }, - version="0.14.1" + version="4.11.3" ) # Export some values for use elsewhere diff --git a/helm-kubernetes-typescript/Pulumi.yaml b/helm-kubernetes-typescript/Pulumi.yaml index 31525ebdc..100dd9593 100644 --- a/helm-kubernetes-typescript/Pulumi.yaml +++ b/helm-kubernetes-typescript/Pulumi.yaml @@ -5,5 +5,5 @@ template: description: A TypeScript program to deploy a Helm chart onto a Kubernetes cluster config: k8sNamespace: - default: nginx-ingress + default: ingress-nginx description: The Kubernetes namespace to deploy into diff --git a/helm-kubernetes-typescript/index.ts b/helm-kubernetes-typescript/index.ts index 0855bb7d1..7a704f1d0 100644 --- a/helm-kubernetes-typescript/index.ts +++ b/helm-kubernetes-typescript/index.ts @@ -4,38 +4,36 @@ import * as kubernetes from "@pulumi/kubernetes"; const config = new pulumi.Config(); const k8sNamespace = config.get("k8sNamespace") || "default"; const appLabels = { - app: "nginx-ingress", + app: "ingress-nginx", }; // Create a namespace (user supplies the name of the namespace) -const ingressNs = new kubernetes.core.v1.Namespace("ingressns", {metadata: { - labels: appLabels, - name: k8sNamespace, -}}); +const ingressNs = new kubernetes.core.v1.Namespace("ingressns", { + metadata: { + labels: appLabels, + name: k8sNamespace, + } +}); // Use Helm to install the Nginx ingress controller const ingressController = new kubernetes.helm.v3.Release("ingresscontroller", { - chart: "nginx-ingress", + chart: "ingress-nginx", namespace: ingressNs.metadata.name, repositoryOpts: { - repo: "https://helm.nginx.com/stable", + repo: "https://kubernetes.github.io/ingress-nginx", }, skipCrds: true, values: { + serviceAccount: { + automountServiceAccountToken: true, + }, controller: { - enableCustomResources: false, - appprotect: { - enable: false, - }, - appprotectdos: { - enable: false, - }, - service: { - extraLabels: appLabels, + publishService: { + enabled: true, }, }, }, - version: "0.14.1", + version: "4.11.3", }); // Export some values for use elsewhere diff --git a/helm-kubernetes-yaml/Pulumi.yaml b/helm-kubernetes-yaml/Pulumi.yaml index 67130ebcc..8b4434ccb 100644 --- a/helm-kubernetes-yaml/Pulumi.yaml +++ b/helm-kubernetes-yaml/Pulumi.yaml @@ -5,19 +5,19 @@ template: description: A Pulumi YAML program to deploy a Helm chart onto a Kubernetes cluster config: k8sNamespace: - default: nginx-ingress + default: ingress-nginx description: The Kubernetes namespace to deploy into config: # Use this user-supplied value to create a Kubernetes namespace later k8sNamespace: - default: nginx-ingress + default: ingress-nginx type: string variables: # Define some labels that will be applied to resources appLabels: - app: nginx-ingress + app: ingress-nginx resources: # Create a namespace (name of the namespace supplied by the user) @@ -31,21 +31,18 @@ resources: ingresscontroller: type: kubernetes:helm.sh/v3:Release properties: - chart: nginx-ingress + chart: ingress-nginx namespace: ${ingressns.metadata.name} repositoryOpts: - repo: https://helm.nginx.com/stable + repo: https://kubernetes.github.io/ingress-nginx skipCrds: true values: + serviceAccount: + automountServiceAccountToken: true controller: - enableCustomResources: false - appprotect: - enable: false - appprotectdos: - enable: false - service: - extraLabels: ${appLabels} - version: "0.14.1" + publishService: + enabled: true + version: 4.11.3 # Export some values for use elsewhere outputs: diff --git a/metadata/dist/metadata.json b/metadata/dist/metadata.json index 5b64e420b..6697efbb9 100644 --- a/metadata/dist/metadata.json +++ b/metadata/dist/metadata.json @@ -1877,7 +1877,7 @@ "description": "A C# program to deploy a Helm chart onto a Kubernetes cluster", "config": { "k8sNamespace": { - "default": "nginx-ingress", + "default": "ingress-nginx", "description": "The Kubernetes namespace to deploy into" } } @@ -1890,7 +1890,7 @@ "description": "A Go program to deploy a Helm chart onto a Kubernetes cluster", "config": { "k8sNamespace": { - "default": "nginx-ingress", + "default": "ingress-nginx", "description": "The Kubernetes namespace to deploy into" } } @@ -1903,7 +1903,7 @@ "description": "A Python program to deploy a Helm chart onto a Kubernetes cluster", "config": { "k8sNamespace": { - "default": "nginx-ingress", + "default": "ingress-nginx", "description": "The Kubernetes namespace to deploy into" } } @@ -1916,7 +1916,7 @@ "description": "A TypeScript program to deploy a Helm chart onto a Kubernetes cluster", "config": { "k8sNamespace": { - "default": "nginx-ingress", + "default": "ingress-nginx", "description": "The Kubernetes namespace to deploy into" } } @@ -1929,7 +1929,7 @@ "description": "A Pulumi YAML program to deploy a Helm chart onto a Kubernetes cluster", "config": { "k8sNamespace": { - "default": "nginx-ingress", + "default": "ingress-nginx", "description": "The Kubernetes namespace to deploy into" } } @@ -4585,4 +4585,4 @@ } } } -} \ No newline at end of file +}