Updated chart templates and added apikey in main.go
This commit is contained in:
parent
3ef6bc6ad0
commit
575340257e
@ -46,3 +46,10 @@ Create chart name and version as used by the chart label.
|
|||||||
{{- define "sthome-webhook.servingCertificate" -}}
|
{{- define "sthome-webhook.servingCertificate" -}}
|
||||||
{{ printf "%s-webhook-tls" (include "sthome-webhook.fullname" .) }}
|
{{ printf "%s-webhook-tls" (include "sthome-webhook.fullname" .) }}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Create base64 imagePullSecret using username and password.
|
||||||
|
*/}}
|
||||||
|
{{- define "imagePullSecret" }}
|
||||||
|
{{- printf "{\"auths\": {\"%s\": {\"auth\": \"%s\"}}}" .Values.imageCredentials.registry (printf "%s:%s" .Values.imageCredentials.username .Values.imageCredentials.password | b64enc) | b64enc }}
|
||||||
|
{{- end }}
|
||||||
@ -21,12 +21,12 @@ spec:
|
|||||||
release: {{ .Release.Name }}
|
release: {{ .Release.Name }}
|
||||||
spec:
|
spec:
|
||||||
serviceAccountName: {{ include "sthome-webhook.fullname" . }}
|
serviceAccountName: {{ include "sthome-webhook.fullname" . }}
|
||||||
|
imagePullSecrets:
|
||||||
|
- name: {{ .Values.imageCredentials.name }}
|
||||||
containers:
|
containers:
|
||||||
- name: {{ .Chart.Name }}
|
- name: {{ .Chart.Name }}
|
||||||
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
|
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
|
||||||
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
||||||
imagePullSecrets:
|
|
||||||
- name: {{ .Values.image.imagePullSecrets.name }}
|
|
||||||
args:
|
args:
|
||||||
- --tls-cert-file=/tls/tls.crt
|
- --tls-cert-file=/tls/tls.crt
|
||||||
- --tls-private-key-file=/tls/tls.key
|
- --tls-private-key-file=/tls/tls.key
|
||||||
|
|||||||
@ -15,9 +15,11 @@ certManager:
|
|||||||
image:
|
image:
|
||||||
repository: stuurmcp/cert-manager-webhook-sthome
|
repository: stuurmcp/cert-manager-webhook-sthome
|
||||||
tag: 0.0.1
|
tag: 0.0.1
|
||||||
pullPolicy: IfNotPresent
|
#pullPolicy should be IfNotPresent. Set to Always for testing purposes
|
||||||
imagePullSecrets:
|
pullPolicy: Always
|
||||||
name: regcred-secret
|
|
||||||
|
imageCredentials:
|
||||||
|
name: docker-registry-credentials
|
||||||
|
|
||||||
nameOverride: ""
|
nameOverride: ""
|
||||||
fullnameOverride: ""
|
fullnameOverride: ""
|
||||||
|
|||||||
9
main.go
9
main.go
@ -9,6 +9,7 @@ import (
|
|||||||
"k8s.io/client-go/kubernetes"
|
"k8s.io/client-go/kubernetes"
|
||||||
"k8s.io/client-go/rest"
|
"k8s.io/client-go/rest"
|
||||||
|
|
||||||
|
cmmetav1 "github.com/cert-manager/cert-manager/pkg/apis/meta/v1"
|
||||||
"github.com/cert-manager/cert-manager/pkg/acme/webhook/apis/acme/v1alpha1"
|
"github.com/cert-manager/cert-manager/pkg/acme/webhook/apis/acme/v1alpha1"
|
||||||
"github.com/cert-manager/cert-manager/pkg/acme/webhook/cmd"
|
"github.com/cert-manager/cert-manager/pkg/acme/webhook/cmd"
|
||||||
"github.com/cert-manager/cert-manager/pkg/issuer/acme/dns/util"
|
"github.com/cert-manager/cert-manager/pkg/issuer/acme/dns/util"
|
||||||
@ -24,12 +25,6 @@ func main() {
|
|||||||
if GroupName == "" {
|
if GroupName == "" {
|
||||||
panic("GROUP_NAME must be specified")
|
panic("GROUP_NAME must be specified")
|
||||||
}
|
}
|
||||||
|
|
||||||
// This will register our sthome DNS provider with the webhook serving
|
|
||||||
// library, making it available as an API under the provided GroupName.
|
|
||||||
// You can register multiple DNS provider implementations with a single
|
|
||||||
// webhook, where the Name() method will be used to disambiguate between
|
|
||||||
// the different implementations.
|
|
||||||
cmd.RunWebhookServer(GroupName,
|
cmd.RunWebhookServer(GroupName,
|
||||||
&sthomeDNSProviderSolver{},
|
&sthomeDNSProviderSolver{},
|
||||||
)
|
)
|
||||||
@ -70,7 +65,7 @@ type sthomeDNSProviderConfig struct {
|
|||||||
// `issuer.spec.acme.dns01.providers.webhook.config` field.
|
// `issuer.spec.acme.dns01.providers.webhook.config` field.
|
||||||
|
|
||||||
Email string `json:"email"`
|
Email string `json:"email"`
|
||||||
//APIKeySecretRef v1alpha1.SecretKeySelector `json:"apiKeySecretRef"`
|
APIKeySecretRef cmmetav1.SecretKeySelector `json:"apiKeySecretRef"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Name is used as the name for this DNS solver when referencing it on the ACME
|
// Name is used as the name for this DNS solver when referencing it on the ACME
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user