Skip to content

Commit

Permalink
Merge pull request #4 from ninech/add-dns-config-to-helm-chart
Browse files Browse the repository at this point in the history
allow to deploy a dnsConfig resource
  • Loading branch information
thirdeyenick authored Dec 4, 2024
2 parents 36903c2 + 3df0680 commit 92d0643
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 0 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: package-helm-chart

on:
push:
tags:
- 'v*.*.*'
- 'v*.*.*-*'
workflow_dispatch:

jobs:
package-and-push-helm-chart:
permissions:
contents: read
packages: write

runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/[email protected]

- name: Set environment variables
id: set-variables
run: |
echo "REPOSITORY=ghcr.io/$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]')" >> "$GITHUB_OUTPUT"
- name: Login to GitHub Container Registry
uses: docker/[email protected]
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ github.token }}

- name: Build, package and push helm chart
run: |
./tool/go run cmd/k8s-operator/generate/main.go helmcrd
./tool/helm package --app-version="${GITHUB_REF}" --version=${GITHUB_REF} './cmd/k8s-operator/deploy/chart'
./tool/helm push ./tailscale-operator-${{ $GITHUB_REF }}.tgz oci://${{ steps.set-variables.outputs.REPOSITORY }}/charts
13 changes: 13 additions & 0 deletions cmd/k8s-operator/deploy/chart/templates/dns-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{{ if .Values.dnsConfig.enabled }}
apiVersion: tailscale.com/v1alpha1
kind: DNSConfig
metadata:
name: dnsconfig
namespace: {{ .Release.Namespace }}
spec:
domain: {{ .Values.dnsConfig.domain | quote }}
nameserver:
image:
repo: {{ .Values.dnsConfig.image.repo | quote }}
tag: {{ .Values.dnsConfig.image.tag | default .Chart.AppVersion }}
{{ end }}
12 changes: 12 additions & 0 deletions cmd/k8s-operator/deploy/chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -90,3 +90,15 @@ apiServerProxyConfig:
mode: "false" # "true", "false", "noauth"

imagePullSecrets: []

# dnsConfig allows to deploy the k8s-nameserver which allows to use magicDNS
# names.
dnsConfig:
enabled: false
image:
repo: "tailscale/k8s-nameserver"
## tag can be used to overwrite the tag of the container image to be used.
## By default the appVersion will be used.
tag: ""
## domain allows to customize the magicDNS domain.
domain: "ts.net"

0 comments on commit 92d0643

Please sign in to comment.