https://pulumi.com logo
#aws
Title
# aws
s

salmon-jelly-80475

09/24/2021, 7:00 PM
Anyone created ingress controllers in EKS through pulumi? If you have any useful documentation that can help along the way, do drop them in the comments!
s

steep-sunset-89396

09/25/2021, 11:32 AM
Ingress as in
new k8s.networking.v1.Ingress
?
This is an ingress using the ingress-nginx chart.
Copy code
let ingress = new k8s.networking.v1.Ingress(ingressName, {
            apiVersion: "<http://networking.k8s.io/v1|networking.k8s.io/v1>",
            kind: "Ingress",
            metadata: {
                name: ingressName,
                namespace: this.namespaceName,
                annotations: {
                    '<http://kubernetes.io/ingress.class|kubernetes.io/ingress.class>': 'nginx',
                    '<http://nginx.ingress.kubernetes.io/rewrite-target|nginx.ingress.kubernetes.io/rewrite-target>': '/$2',
                    // '<http://cert-manager.io/cluster-issuer|cert-manager.io/cluster-issuer>': this.clusterIssuerName,
                },
            },
            spec: {
                tls: [{
                    hosts: [
                        `${this.args.dnsHostname}.${this.args.dnsDomain}`,
                    ],
                    secretName: this.tlsSecretName,
                }],
                rules: [{
                    host: `${this.args.dnsHostname}.${this.args.dnsDomain}`,
                    http: {
                        paths: [{
                            path: `${urlPath}(/|$)(.*)`,
                            pathType: 'Prefix',
                            backend: {
                                service: {
                                    name: serviceName,
                                    port: {
                                        number: 8080,
                                    }
                                }
                            },
                        }],
                    },
                }],
            },
        }, { parent: this.namespace, provider: this.cluster.provider, dependsOn: [this.chartIngressNginx, this.tlsSecret, service], deleteBeforeReplace: true });
        return ingress;