Skip to content

Commit 720b272

Browse files
authored
Merge pull request #98 from vadimkim/rel-1.4.0
Rel 1.4.0
2 parents 29082b4 + 11fdfc1 commit 720b272

File tree

5 files changed

+52
-33
lines changed

5 files changed

+52
-33
lines changed

.github/workflows/superlinter.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
# Grant status permission for MULTI_STATUS #
1919
############################################
2020
permissions:
21-
contents: read
21+
contents: write
2222
packages: read
2323
statuses: write
2424

@@ -27,9 +27,10 @@ jobs:
2727
uses: actions/checkout@v4
2828
with:
2929
fetch-depth: 0
30+
persist-credentials: false
3031

3132
- name: Lint Code Base
32-
uses: docker://ghcr.io/super-linter/super-linter:slim-v7.2.1
33+
uses: docker://ghcr.io/super-linter/super-linter:slim-v8.1.0
3334
with:
3435
args: --timeout=30m
3536
env:

Dockerfile

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
FROM golang:1.23-alpine3.20 AS build_deps
1+
# ---- Build dependencies ----
2+
FROM golang:1.25-alpine3.22 AS build_deps
23
ARG TARGETARCH
34

4-
RUN apk add --no-cache git=2.45.3-r0
5+
RUN apk add --no-cache git=2.49.1-r0
56

67
WORKDIR /workspace
78
ENV GO111MODULE=on
@@ -11,18 +12,27 @@ COPY go.sum .
1112

1213
RUN go mod download
1314

15+
# ---- Build stage ----
1416
FROM build_deps AS build
1517

1618
COPY . .
1719

1820
RUN CGO_ENABLED=0 GOARCH=$TARGETARCH go build -o webhook -ldflags '-w -extldflags "-static"' .
1921

20-
FROM alpine:3.20
22+
# ---- Final runtime image ----
23+
FROM alpine:3.22
2124
LABEL maintainer="vadimkim <[email protected]>"
2225
LABEL org.opencontainers.image.source="https://github.com/vadimkim/cert-manager-webhook-hetzner"
2326

24-
RUN apk add --no-cache ca-certificates=20241121-r1
27+
# Install minimal runtime
28+
RUN apk add --no-cache ca-certificates=20250619-r0 \
29+
&& adduser -D -u 1000 appuser
30+
USER appuser
2531

2632
COPY --from=build /workspace/webhook /usr/local/bin/webhook
2733

2834
ENTRYPOINT ["webhook"]
35+
36+
# Add healthcheck (adjust endpoint/port if needed)
37+
HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \
38+
CMD wget --no-verbose --tries=1 --spider http://localhost:8080/healthz || exit 1

README.md

Lines changed: 29 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,52 @@
11
# ACME webhook for Hetzner DNS API
22

3-
This solver can be used when you want to use cert-manager with Hetzner DNS API. API documentation is [here](https://dns.hetzner.com/api-docs)
3+
This solver can be used when you want to use cert-manager with Hetzner DNS API. API documentation
4+
is [Hetzner DNS API docs](https://dns.hetzner.com/api-docs)
45

56
## Requirements
6-
- [go](https://golang.org/) >= 1.13.0
7-
- [helm](https://helm.sh/) >= v3.0.0
8-
- [kubernetes](https://kubernetes.io/) >= v1.14.0
9-
- [cert-manager](https://cert-manager.io/) >= 0.12.0
7+
8+
- [go](https://golang.org/) >= 1.25.0
9+
- [helm](https://helm.sh/) >= v3.0.0
10+
- [kubernetes](https://kubernetes.io/) >= v1.14.0
11+
- [cert-manager](https://cert-manager.io/) >= 0.12.0
1012

1113
## Installation
1214

1315
### cert-manager
1416

15-
Follow the [instructions](https://cert-manager.io/docs/installation/) using the cert-manager documentation to install it within your cluster.
17+
Follow the [instructions](https://cert-manager.io/docs/installation/) using the cert-manager documentation to install it
18+
within your cluster.
1619

1720
### Webhook
1821

1922
#### Using public helm chart
23+
2024
```bash
2125
helm repo add cert-manager-webhook-hetzner https://vadimkim.github.io/cert-manager-webhook-hetzner
22-
# Replace the groupName value with your desired domain
23-
helm install --namespace cert-manager cert-manager-webhook-hetzner cert-manager-webhook-hetzner/cert-manager-webhook-hetzner --set groupName=acme.yourdomain.tld
26+
helm install --namespace cert-manager cert-manager-webhook-hetzner cert-manager-webhook-hetzner/cert-manager-webhook-hetzner
2427
```
2528

2629
#### From local checkout
2730

2831
```bash
2932
helm install --namespace cert-manager cert-manager-webhook-hetzner deploy/cert-manager-webhook-hetzner
3033
```
31-
**Note**: The kubernetes resources used to install the Webhook should be deployed within the same namespace as the cert-manager.
34+
35+
**Note**: The kubernetes resources used to install the Webhook should be deployed within the same namespace as the
36+
cert-manager.
3237

3338
To uninstall the webhook run
39+
3440
```bash
3541
helm uninstall --namespace cert-manager cert-manager-webhook-hetzner
3642
```
3743

3844
## Issuer
3945

4046
Create a `ClusterIssuer` or `Issuer` resource as following:
41-
(Keep in Mind that the Example uses the Staging URL from Let's Encrypt. Look at [Getting Start](https://letsencrypt.org/getting-started/) for using the normal Let's Encrypt URL.)
47+
(Keep in Mind that the Example uses the Staging URL from Let's Encrypt. Look
48+
at [Getting Start](https://letsencrypt.org/getting-started/) for using the normal Let's Encrypt URL.)
49+
4250
```yaml
4351
apiVersion: cert-manager.io/v1
4452
kind: ClusterIssuer
@@ -59,8 +67,7 @@ spec:
5967
solvers:
6068
- dns01:
6169
webhook:
62-
# This group needs to be configured when installing the helm package, otherwise the webhook won't have permission to create an ACME challenge for this API group.
63-
groupName: acme.yourdomain.tld
70+
groupName: hetzner.cert-mananger-webhook.noshoes.xyz
6471
solverName: hetzner
6572
config:
6673
secretName: hetzner-secret
@@ -69,11 +76,15 @@ spec:
6976
```
7077
7178
### Credentials
79+
7280
In order to access the Hetzner API, the webhook needs an API token.
7381
74-
If you choose another name for the secret than `hetzner-secret`, you must install the chart with a modified `secretName` value. Policies ensure that no other secrets can be read by the webhook. Also modify the value of `secretName` in the `[Cluster]Issuer`.
82+
If you choose another name for the secret than `hetzner-secret`, you must install the chart with a modified `secretName`
83+
value. Policies ensure that no other secrets can be read by the webhook. Also modify the value of `secretName` in the
84+
`[Cluster]Issuer`.
7585

7686
The secret for the example above will look like this:
87+
7788
```yaml
7889
apiVersion: v1
7990
kind: Secret
@@ -115,9 +126,10 @@ else they will have undetermined behaviour when used with cert-manager.
115126
**It is essential that you configure and run the test suite when creating a
116127
DNS01 webhook.**
117128

118-
First, you need to have Hetzner account with access to DNS control panel. You need to create API token and have a registered and verified DNS zone there.
129+
First, you need to have Hetzner account with access to DNS control panel. You need to create API token and have a
130+
registered and verified DNS zone there.
119131
Then you need to replace `zoneName` parameter at `testdata/hetzner/config.json` file with actual one.
120-
You also must encode your api token into base64 and put the hash into `testdata/hetzner/hetzner-secret.yml` file.
132+
You also must encode your API token into base64 and put the hash into `testdata/hetzner/hetzner-secret.yml` file.
121133

122134
You can then run the test suite with:
123135

@@ -131,11 +143,13 @@ TEST_ZONE_NAME=example.com. make verify
131143
## Creating new package
132144

133145
To build new Docker image for multiple architectures and push it to hub:
146+
134147
```shell
135148
docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v7 -t zmejg/cert-manager-webhook-hetzner:1.2.0 . --push
136149
```
137150

138151
To compile and publish new Helm chart version:
152+
139153
```shell
140154
helm package deploy/cert-manager-webhook-hetzner
141155
git checkout gh-pages

deploy/cert-manager-webhook-hetzner/Chart.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
apiVersion: v2
22
name: cert-manager-webhook-hetzner
3-
version: 1.3.3
4-
appVersion: "1.3.3"
3+
version: 1.4.0
4+
appVersion: "1.4.0"
55
kubeVersion: ">= 1.22.0-0"
66
description: Allow cert-manager to solve DNS challenges using Hetzner DNS API
77
home: https://github.com/vadimkim/cert-manager-webhook-hetzner

deploy/cert-manager-webhook-hetzner/values.yaml

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
1-
# The GroupName here is used to identify your company or business unit that
2-
# created this webhook.
3-
# For example, this may be "acme.mycompany.com".
4-
# This name will need to be referenced in each Issuer's `webhook` stanza to
5-
# inform cert-manager of where to send ChallengePayload resources in order to
6-
# solve the DNS01 challenge.
7-
# This group name should be **unique**, hence using your own company's domain
8-
# here is recommended.FROM golang:1.14.0-alpine AS build_deps
9-
groupName: acme.yourdomain.tld
1+
# The kubernetes api group under which the webhook will be exposed. There is no need to
2+
# modify this value unless you are facing a collision in your api services.
3+
groupName: hetzner.cert-mananger-webhook.noshoes.xyz
104

115
certManager:
126
namespace: cert-manager
@@ -39,7 +33,7 @@ resources: {}
3933
# memory: 128Mi
4034
# requests:
4135
# cpu: 100m
42-
# memory: 128Mi
36+
# memory: 128Mi
4337

4438
nodeSelector: {}
4539

0 commit comments

Comments
 (0)