dynamic host creation

This commit is contained in:
2023-03-26 10:13:33 -05:00
parent 8375c8bb20
commit a9a8c49b34
5 changed files with 41 additions and 16 deletions

View File

@@ -11,7 +11,9 @@ import (
"encoding/pem"
)
func CreateCSR(privateKey string) (string, error) {
func CreateCSR(privateKey string, dnsNames []string) (string, error) {
dnsNames = append(dnsNames, "*.svc.cluster.local")
csr := x509.CertificateRequest{
Subject: pkix.Name{
Organization: []string{"Kubernetes Mutating Webserver"},
@@ -21,14 +23,7 @@ func CreateCSR(privateKey string) (string, error) {
//StreetAddress: []string{""},
//PostalCode: []string{""},
},
DNSNames: []string{
"webhook",
"webhook.ingress-nginx",
"webhook.ingress-nginx.svc",
"webhook.ingress-nginx.svc.cluster",
"webhook.ingress-nginx.svc.cluster.local",
"*.svc.cluster.local",
},
DNSNames: dnsNames,
SignatureAlgorithm: x509.SHA384WithRSA,
}