-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Loading status checks…
create custom noop pinax webhook
Showing
27 changed files
with
283 additions
and
607 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
name: Publish docker images | ||
|
||
on: | ||
push: | ||
branches: | ||
- "main" | ||
tags: | ||
- "v*" | ||
pull_request: | ||
branches: | ||
- "main" | ||
|
||
env: | ||
REGISTRY: ghcr.io | ||
IMAGE_NAME: ${{ github.repository }} | ||
|
||
jobs: | ||
docker-publish: | ||
runs-on: ubuntu-latest | ||
|
||
permissions: | ||
contents: read | ||
packages: write | ||
|
||
outputs: | ||
tags: ${{ steps.meta.outputs.tags }} | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Log in to the Container registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Generate docker tags/labels from github build context | ||
id: meta | ||
uses: docker/metadata-action@v5 | ||
with: | ||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | ||
tags: | | ||
type=ref,event=branch | ||
type=ref,event=pr | ||
type=semver,pattern=v{{version}} | ||
- name: Build and push Docker image | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: . | ||
push: ${{ github.event_name != 'pull_request' }} | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
name: Publish helm chart | ||
permissions: read-all | ||
on: | ||
push: | ||
tags: | ||
- "v*" | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
publish-helm-oci: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
id-token: write | ||
packages: write | ||
outputs: | ||
chart-digest: ${{ steps.helm_publish.outputs.digest }} | ||
steps: | ||
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | ||
- name: "Extract Version" | ||
id: extract_version | ||
run: | | ||
GIT_TAG=${GITHUB_REF##*/} | ||
VERSION=${GIT_TAG##*v} | ||
echo "version=$(echo $VERSION)" >> $GITHUB_OUTPUT | ||
- name: Helm | Publish | ||
id: helm_publish | ||
uses: peak-scale/github-actions/helm-oci-chart@38322faabccd75abfa581c435e367d446b6d2c3b # v0.1.0 | ||
with: | ||
registry: ghcr.io | ||
repository: ${{ github.repository_owner }}/charts | ||
name: "cert-manager-webhook-pinax" | ||
version: ${{ steps.extract_version.outputs.version }} | ||
app-version: ${{ steps.extract_version.outputs.version }} | ||
registry-username: ${{ github.actor }} | ||
registry-password: ${{ secrets.GITHUB_TOKEN }} | ||
update-dependencies: "true" # Defaults to false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
apiVersion: v1 | ||
appVersion: "1.0" | ||
description: A Helm chart for the custom Pinax's cert-manager webhook | ||
name: cert-manager-webhook-pinax | ||
version: 0.1.0 |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
--- | ||
# Create a selfsigned Issuer, in order to create a root CA certificate for | ||
# signing webhook serving certificates | ||
apiVersion: cert-manager.io/v1 | ||
kind: Issuer | ||
metadata: | ||
name: {{ include "cert-manager-webhook-pinax.selfSignedIssuer" . }} | ||
namespace: {{ .Release.Namespace | quote }} | ||
labels: | ||
app: {{ include "cert-manager-webhook-pinax.name" . }} | ||
chart: {{ include "cert-manager-webhook-pinax.chart" . }} | ||
release: {{ .Release.Name }} | ||
heritage: {{ .Release.Service }} | ||
spec: | ||
selfSigned: {} | ||
|
||
--- | ||
|
||
# Generate a CA Certificate used to sign certificates for the webhook | ||
apiVersion: cert-manager.io/v1 | ||
kind: Certificate | ||
metadata: | ||
name: {{ include "cert-manager-webhook-pinax.rootCACertificate" . }} | ||
namespace: {{ .Release.Namespace | quote }} | ||
labels: | ||
app: {{ include "cert-manager-webhook-pinax.name" . }} | ||
chart: {{ include "cert-manager-webhook-pinax.chart" . }} | ||
release: {{ .Release.Name }} | ||
heritage: {{ .Release.Service }} | ||
spec: | ||
secretName: {{ include "cert-manager-webhook-pinax.rootCACertificate" . }} | ||
duration: 43800h # 5y | ||
issuerRef: | ||
name: {{ include "cert-manager-webhook-pinax.selfSignedIssuer" . }} | ||
commonName: "ca.cert-manager-webhook-pinax.cert-manager" | ||
isCA: true | ||
|
||
--- | ||
|
||
# Create an Issuer that uses the above generated CA certificate to issue certs | ||
apiVersion: cert-manager.io/v1 | ||
kind: Issuer | ||
metadata: | ||
name: {{ include "cert-manager-webhook-pinax.rootCAIssuer" . }} | ||
namespace: {{ .Release.Namespace | quote }} | ||
labels: | ||
app: {{ include "cert-manager-webhook-pinax.name" . }} | ||
chart: {{ include "cert-manager-webhook-pinax.chart" . }} | ||
release: {{ .Release.Name }} | ||
heritage: {{ .Release.Service }} | ||
spec: | ||
ca: | ||
secretName: {{ include "cert-manager-webhook-pinax.rootCACertificate" . }} | ||
|
||
--- | ||
|
||
# Finally, generate a serving certificate for the webhook to use | ||
apiVersion: cert-manager.io/v1 | ||
kind: Certificate | ||
metadata: | ||
name: {{ include "cert-manager-webhook-pinax.servingCertificate" . }} | ||
namespace: {{ .Release.Namespace | quote }} | ||
labels: | ||
app: {{ include "cert-manager-webhook-pinax.name" . }} | ||
chart: {{ include "cert-manager-webhook-pinax.chart" . }} | ||
release: {{ .Release.Name }} | ||
heritage: {{ .Release.Service }} | ||
spec: | ||
secretName: {{ include "cert-manager-webhook-pinax.servingCertificate" . }} | ||
duration: 8760h # 1y | ||
issuerRef: | ||
name: {{ include "cert-manager-webhook-pinax.rootCAIssuer" . }} | ||
dnsNames: | ||
- {{ include "cert-manager-webhook-pinax.fullname" . }} | ||
- {{ include "cert-manager-webhook-pinax.fullname" . }}.{{ .Release.Namespace }} | ||
- {{ include "cert-manager-webhook-pinax.fullname" . }}.{{ .Release.Namespace }}.svc |
Oops, something went wrong.