Skip to content

Commit

Permalink
update (#3)
Browse files Browse the repository at this point in the history
Co-authored-by: georgedriver <[email protected]>
  • Loading branch information
georgedriver and georgedriver authored Jun 16, 2020
1 parent d7e48b2 commit ebff532
Show file tree
Hide file tree
Showing 12 changed files with 559 additions and 0 deletions.
22 changes: 22 additions & 0 deletions charts/alidns-webhook/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/
14 changes: 14 additions & 0 deletions charts/alidns-webhook/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
apiVersion: v1
appVersion: "1.0"
description: Cert-manager ACME DNS webhook provider for alidns
name: alidns-webhook
version: 0.1.0
home: https://github.com/georgedriver/helm-charts
keywords:
- alidns
- dns01
- certmanager
sources:
- https://github.com/georgedriver/helm-charts
maintainers:
- name: George
76 changes: 76 additions & 0 deletions charts/alidns-webhook/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
alidns-webhook
==============
Cert-manager ACME DNS webhook provider for alidns

Current chart version is `0.1.0`

Source code can be found [here](https://github.com/georgedriver/helm-charts)

## Installation

### Add Helm repository

```shell
helm repo add georgedriver https://georgedriver.github.io/helm-charts
helm repo update
```

```shell
helm install georgedriver/alidns-webhook \
--set alicloud_access_key=<alicloud_access_key> \
--set alicloud_secret_key=<alicloud_secret_key> \
--set email="[email protected]" \
--set domain="test.com"
```

## Configuration

The following table lists the configurable parameters of the chart and the default values.

## Chart Values

| Key | Type | Default | Description |
|-----|------|---------|-------------|
| alicloud_access_key | string | `""` | ALICLOUD_ACCESS_KEY to handle the Alicloud DNS records |
| alicloud_secret_key | string | `""` | ALICLOUD_SECRET_KEY to handle the Alicloud DNS records |
| domain | string | `"test.com"` | The domain we're using for alidns-webhook |
| email | string | `"[email protected]"` | A validated email address for cert-manager |

## Changes

- Change `acme.yourcompany.com` to `cert-manager.io`, cause the `Certificate` generated by `Ingress` will always use the group `cert-manager.io` as its `issuerRef`

- Hook all the steps in [alidns-webhook](https://github.com/pragkent/alidns-webhook) this helm chart, include the test `Certificate`

## Usage

Example ingress

```yaml
cat << EOF | kubectl apply -f -
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: basic-ingress
annotations:
kubernetes.io/ingress.class: "nginx"
cert-manager.io/cluster-issuer: "letsencrypt-prod"
spec:
tls:
- hosts:
- vault11.mirana.test.com
secretName: quickstart-example-tls
rules:
- host: vault11.mirana.test.com
http:
paths:
- backend:
serviceName: nginx
servicePort: 80
EOF
```

## Ref

- [cert-manager](https://cert-manager.io/docs/configuration/acme/dns01/#webhook)
- [alidns-webhook](https://github.com/pragkent/alidns-webhook)
68 changes: 68 additions & 0 deletions charts/alidns-webhook/README.md.gotmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
{{ template "chart.header" . }}
{{ template "chart.description" . }}

{{ template "chart.versionLine" . }}

{{ template "chart.sourceLinkLine" . }}

## Installation

### Add Helm repository

```shell
helm repo add georgedriver https://georgedriver.github.io/helm-charts
helm repo update
```

```shell
helm install georgedriver/alidns-webhook \
--set alicloud_access_key=<alicloud_access_key> \
--set alicloud_secret_key=<alicloud_secret_key> \
--set email="[email protected]" \
--set domain="test.com"
```

## Configuration

The following table lists the configurable parameters of the chart and the default values.

{{ template "chart.valuesSection" . }}

## Changes

- Change `acme.yourcompany.com` to `cert-manager.io`, cause the `Certificate` generated by `Ingress` will always use the group `cert-manager.io` as its `issuerRef`

- Hook all the steps in [alidns-webhook](https://github.com/pragkent/alidns-webhook) this helm chart, include the test `Certificate`

## Usage

Example ingress

```yaml
cat << EOF | kubectl apply -f -
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: basic-ingress
annotations:
kubernetes.io/ingress.class: "nginx"
cert-manager.io/cluster-issuer: "letsencrypt-prod"
spec:
tls:
- hosts:
- vault11.mirana.test.com
secretName: quickstart-example-tls
rules:
- host: vault11.mirana.test.com
http:
paths:
- backend:
serviceName: nginx
servicePort: 80
EOF
```

## Ref

- [cert-manager](https://cert-manager.io/docs/configuration/acme/dns01/#webhook)
- [alidns-webhook](https://github.com/pragkent/alidns-webhook)
Empty file.
9 changes: 9 additions & 0 deletions charts/alidns-webhook/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
=========================================================
# Debug commands
kubectl get/describe ClusterIssuers
kubectl get/describe Certificates
kubectl get/describe CertificateRequest

# Verify
kubectl describe Certificates test-cert-tls-secret
=========================================================
32 changes: 32 additions & 0 deletions charts/alidns-webhook/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{{/* vim: set filetype=mustache: */}}
{{/*
Expand the name of the chart.
*/}}
{{- define "alidns-webhook.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
{{- end -}}

{{/*
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "alidns-webhook.fullname" -}}
{{- if .Values.fullnameOverride -}}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- $name := default .Chart.Name .Values.nameOverride -}}
{{- if contains $name .Release.Name -}}
{{- .Release.Name | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{- end -}}
{{- end -}}

{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "alidns-webhook.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
{{- end -}}
Loading

0 comments on commit ebff532

Please sign in to comment.