https://pulumi.com logo
#kubernetes
Title
# kubernetes
b

better-rainbow-14549

03/03/2020, 10:51 AM
Copy code
export class Certificate extends kubernetes.apiextensions.CustomResource {
    constructor(
        name: string,
        namespace: pulumi.Input<string>,
        domains: pulumi.Input<string>[],
        issuer: CertificateIssuer,
        secretName: pulumi.Input<string> = name
    ) {
        super(
            name,
            {
                apiVersion: "<http://certmanager.k8s.io/v1alpha1|certmanager.k8s.io/v1alpha1>",
                kind: "Certificate",
                metadata: {
                    name: name,
                    namespace: namespace
                },
                spec: {
                    secretName: secretName,
                    dnsNames: domains,
                    acme: {
                        config: issuer.configuration.map(x => ({
                            ...x,
                            domains: domains
                        }))
                    },
                    issuerRef: {
                        name: issuer.name,
                        kind: issuer.kind
                    }
                }
            },
            {
                provider: issuer.provider
            }
        );
    }
}
👍 1
i've done that and it works
h

handsome-cat-98152

03/03/2020, 12:26 PM
thank you very much, that was really insightful!
👍 1
6 Views