No description
  • Go 90.2%
  • Makefile 5.4%
  • Dockerfile 4.4%
Find a file
2020-06-05 00:22:04 +02:00
cmd/pve-cloud-controller-manager initial commit 2020-06-02 00:38:26 +02:00
config new pve api 2020-06-05 00:22:04 +02:00
deploy initial commit 2020-06-02 00:38:26 +02:00
pvecloud new pve api 2020-06-05 00:22:04 +02:00
scripts initial commit 2020-06-02 00:38:26 +02:00
.gitignore initial commit 2020-06-02 00:38:26 +02:00
Dockerfile initial commit 2020-06-02 00:38:26 +02:00
go.mod new pve api 2020-06-05 00:22:04 +02:00
go.sum new pve api 2020-06-05 00:22:04 +02:00
LICENSE initial commit 2020-06-02 00:38:26 +02:00
Makefile initial commit 2020-06-02 00:38:26 +02:00
README.md initial commit 2020-06-02 00:38:26 +02:00

cloud-provider-pve

template-solver

The template-solver is a Cert-Manager Webhook solver implementation, that itself constructs and sends webhooks or API requests.

Requirements

  • Kubernetes Cluster
  • Cert-Manager v0.12.0
  • go
  • ko

Usage

Config

Note: headers, urlData and bodyData values need to start with an upper-case letter.

If bodyTemplate is defined a POST request will be sent.

Cleanup requests contain an empty DNSKey.

webhook:
  groupName: template-solver
  solverName: template-solver
  config:
    apiKeySecretRef:
      name: api-key
      key: example.com
    headers:
      Content-Type: "application/json"
    urlTemplate: "{{.URLData.Url}}{{.APIKey}}={{.DNSKey}}"
    urlData:
      Url: "https://ns.example.com/update.html?"
    bodyTemplate: ""
    bodyData:

Example

Secret to store webhook API key:

Note: the api-key secret must be created in the same namespace as the Certificate.

apiVersion: v1
kind: Secret
metadata:
  name: api-key
  namespace: default
type: Opaque
stringData:
  example.com: 92f6766fc1a43d9a96ccd93d33294cc6

Issuer:

apiVersion: cert-manager.io/v1alpha2
kind: Issuer
metadata:
  name: template-solver-issuer
  namespace: default
spec:
  acme:
    email: user@example.com
    server: https://acme-staging-v02.api.letsencrypt.org/directory
    privateKeySecretRef:
      name: template-solver-issuer-account-key
    solvers:
    - dns01:
        webhook:
          groupName: template-solver
          solverName: template-solver
          config:
            apiKeySecretRef:
              name: api-key
              key: example.com
            urlTemplate: "{{.URLData.Url}}{{.APIKey}}={{.DNSKey}}"
            urlData:
              Url: "https://ns.example.com/update.html?"

Certificate:

apiVersion: cert-manager.io/v1alpha2
kind: Certificate
metadata:
  name: example-com
  namespace: default
spec:
  secretName: example-com-tls
  duration: 2160h
  renewBefore: 360h
  isCA: false
  keySize: 2048
  keyAlgorithm: rsa
  keyEncoding: pkcs1
  usages:
    - server auth
    - client auth
  dnsNames:
  - '*.example.com'
  issuerRef:
    name: template-solver-issuer

Build and run

echo KO_DOCKER_REPO='gcr.io/my-gcloud-project-name' >env.txt

./build.sh