Compare commits
3 Commits
48b06e7c44
...
575340257e
| Author | SHA1 | Date | |
|---|---|---|---|
| 575340257e | |||
| 3ef6bc6ad0 | |||
| 61d566cbe0 |
2
.gitignore
vendored
2
.gitignore
vendored
@ -4,3 +4,5 @@
|
|||||||
|
|
||||||
/.vs
|
/.vs
|
||||||
apiserver.local.config
|
apiserver.local.config
|
||||||
|
charts
|
||||||
|
_test
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
appVersion: "1.0"
|
appVersion: "v0.0.1"
|
||||||
description: A Helm chart for Kubernetes
|
description: Cert-Manager webhook for sthome
|
||||||
name: sthome-webhook
|
name: sthome-webhook
|
||||||
version: 0.1.0
|
version: 0.0.1
|
||||||
|
|||||||
@ -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,6 +21,8 @@ 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 }}"
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
# The GroupName here is used to identify your company or business unit that
|
# The GroupName here is used to identify your company or business unit that
|
||||||
# created this webhook.
|
# created this webhook.
|
||||||
# For sthome, this may be "acme.sthome.net".
|
# For sthome, this may be "webhook.acme.cert-manager.io".
|
||||||
# This name will need to be referenced in each Issuer's `webhook` stanza to
|
# This name will need to be referenced in each Issuer's `webhook` stanza to
|
||||||
# inform cert-manager of where to send ChallengePayload resources in order to
|
# inform cert-manager of where to send ChallengePayload resources in order to
|
||||||
# solve the DNS01 challenge.
|
# solve the DNS01 challenge.
|
||||||
@ -9,17 +9,32 @@
|
|||||||
groupName: acme.sthome.net
|
groupName: acme.sthome.net
|
||||||
|
|
||||||
certManager:
|
certManager:
|
||||||
namespace: cert-manager
|
namespace: ix-cert-manager
|
||||||
serviceAccountName: cert-manager
|
serviceAccountName: cert-manager
|
||||||
|
|
||||||
image:
|
image:
|
||||||
repository: sthome/webhook-image
|
repository: stuurmcp/cert-manager-webhook-sthome
|
||||||
tag: latest
|
tag: 0.0.1
|
||||||
pullPolicy: IfNotPresent
|
#pullPolicy should be IfNotPresent. Set to Always for testing purposes
|
||||||
|
pullPolicy: Always
|
||||||
|
|
||||||
|
imageCredentials:
|
||||||
|
name: docker-registry-credentials
|
||||||
|
|
||||||
nameOverride: ""
|
nameOverride: ""
|
||||||
fullnameOverride: ""
|
fullnameOverride: ""
|
||||||
|
|
||||||
|
replicaCount: 1
|
||||||
|
|
||||||
|
pki:
|
||||||
|
caDuration: 43800h # 5y
|
||||||
|
servingCertificateDuration: 8760h # 1y
|
||||||
|
|
||||||
|
secret:
|
||||||
|
accessKey: ""
|
||||||
|
secretKey: ""
|
||||||
|
name: sthome-webhook-secret
|
||||||
|
|
||||||
service:
|
service:
|
||||||
type: ClusterIP
|
type: ClusterIP
|
||||||
port: 443
|
port: 443
|
||||||
@ -41,3 +56,4 @@ nodeSelector: {}
|
|||||||
tolerations: []
|
tolerations: []
|
||||||
|
|
||||||
affinity: {}
|
affinity: {}
|
||||||
|
|
||||||
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