adding digitalocean-dyndns chart

This commit is contained in:
Jeff Billimek 2018-06-28 10:52:09 -04:00
parent ebfbc83510
commit 546e3b9e17
8 changed files with 234 additions and 0 deletions

View File

@ -0,0 +1,21 @@
# 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

View File

@ -0,0 +1,15 @@
apiVersion: v1
appVersion: "1.0"
description: Dynamic DNS using DigitalOcean's DNS Services
name: digitalocean-dyndns
version: 0.1.0
keywords:
- digitalocean
- dynamicdns
home: https://github.com/tunix/digitalocean-dyndns
sources:
- https://github.com/tunix/digitalocean-dyndns
- https://github.com/billimek/billimek-charts
maintainers:
- name: billimek
email: jeff@billimek.com

View File

@ -0,0 +1,62 @@
# Dynamic DNS using DigitalOcean's DNS Services
A script that pushes the public IP address of the running machine to DigitalOcean's DNS API's. It requires an existing A record to update. The resulting container image is roughly around 7 MB (thanks to Alpine Linux).
## TL;DR;
```console
$ helm repo add billimek https://raw.githubusercontent.com/billimek/helm-repo/master
$ helm install billimek/digitalocean-dyndns
```
## Introduction
This code is adopted from [this original repo](https://github.com/tunix/digitalocean-dyndns)
## Installing the Chart
To install the chart with the release name `my-release`:
```console
$ helm install --name my-release billimek/digitalocean-dyndns
```
## Uninstalling the Chart
To uninstall/delete the `my-release` deployment:
```console
$ helm delete my-release --purge
```
The command removes all the Kubernetes components associated with the chart and deletes the release.
## Configuration
The following tables lists the configurable parameters of the Sentry chart and their default values.
| Parameter | Description | Default |
| ------------------------------- | ------------------------------- | ---------------------------------------------------------- |
| `image.repository` | digitalocean-dyndns image | `tunix/digitalocean-dyndns` |
| `image.tag` | digitalocean-dyndns image tag | `latest` |
| `image.pullPolicy` | digitalocean-dyndns image pull policy | `Always` |
| `digitialocean.token` | The token you generate in DigitalOcean's API settings. | `` |
| `digitialocean.domain` | The domain your subdomain is registered at. (i.e. foo.com for home.foo.com) | `` |
| `digitialocean.name` | Subdomain to use. (name in A record) (i.e. home for home.foo.com or @ for no subdomain) | `@` |
| `digitialocean.sleep_interval` | Polling time in seconds | `300` |
Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example,
```console
helm install --name my-release \
--set config.digitalocean.token=thisismyapikey \
billimek/digitalocean-dyndns
```
Alternatively, a YAML file that specifies the values for the above parameters can be provided while installing the chart. For example,
```console
helm install --name my-release -f values.yaml billimek/digitalocean-dyndns
```
Read through the [values.yaml](values.yaml) file. It has several commented out suggested values.

View File

@ -0,0 +1,7 @@
You can connect to the container running digitalocean-dyndns. To open a shell session in the pod run the following:
- kubectl exec -i -t --namespace {{ .Release.Namespace }} $(kubectl get pods --namespace {{ .Release.Namespace }} -l app={{ template "digitalocean-dyndns.fullname" . }} -o jsonpath='{.items[0].metadata.name}') /bin/sh
To trail the logs for the digitalocean-dyndns pod run the following:
- kubectl logs -f --namespace {{ .Release.Namespace }} $(kubectl get pods --namespace {{ .Release.Namespace }} -l app={{ template "digitalocean-dyndns.fullname" . }} -o jsonpath='{ .items[0].metadata.name }')

View File

@ -0,0 +1,32 @@
{{/* vim: set filetype=mustache: */}}
{{/*
Expand the name of the chart.
*/}}
{{- define "digitalocean-dyndns.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 "digitalocean-dyndns.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 "digitalocean-dyndns.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
{{- end -}}

View File

@ -0,0 +1,51 @@
apiVersion: apps/v1beta2
kind: Deployment
metadata:
name: {{ template "digitalocean-dyndns.fullname" . }}
labels:
app: {{ template "digitalocean-dyndns.name" . }}
chart: {{ template "digitalocean-dyndns.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
spec:
replicas: {{ .Values.replicaCount }}
selector:
matchLabels:
app: {{ template "digitalocean-dyndns.name" . }}
release: {{ .Release.Name }}
template:
metadata:
labels:
app: {{ template "digitalocean-dyndns.name" . }}
release: {{ .Release.Name }}
spec:
containers:
- name: {{ .Chart.Name }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
env:
- name: DIGITALOCEAN_TOKEN
valueFrom:
secretKeyRef:
name: {{ template "digitalocean-dyndns.fullname" . }}
key: digitalocean-dyndns-apikey
- name: DOMAIN
value: "{{ .Values.digitialocean.domain }}"
- name: NAME
value: "{{ .Values.digitialocean.name }}"
- name: SLEEP_INTERVAL
value: "{{ .Values.digitialocean.sleep_interval }}"
resources:
{{ toYaml .Values.resources | indent 12 }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{ toYaml . | indent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{ toYaml . | indent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{ toYaml . | indent 8 }}
{{- end }}

View File

@ -0,0 +1,12 @@
apiVersion: v1
kind: Secret
metadata:
name: {{ template "digitalocean-dyndns.fullname" . }}
labels:
app: {{ template "digitalocean-dyndns.name" . }}
chart: {{ template "digitalocean-dyndns.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
type: Opaque
data:
digitalocean-dyndns-apikey: {{ .Values.digitialocean.token | b64enc | quote }}

View File

@ -0,0 +1,34 @@
# Default values for digitalocean-dyndns.
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.
replicaCount: 1
image:
repository: tunix/digitalocean-dyndns
tag: latest
pullPolicy: Always
digitialocean:
token: sometoken # REQUIRED: The token you generate in DigitalOcean's API settings.
domain: somedomain # REQUIRED: The domain your subdomain is registered at. (i.e. foo.com for home.foo.com)
name: "@" # REQUIRED: Subdomain to use. (name in A record) (i.e. home for home.foo.com or @ for no subdomain)
sleep_interval: 300 # Polling time in seconds
resources: {}
# We usually recommend not to specify default resources and to leave this as a conscious
# choice for the user. This also increases chances charts run on environments with little
# resources, such as Minikube. If you do want to specify resources, uncomment the following
# lines, adjust them as necessary, and remove the curly braces after 'resources:'.
# limits:
# cpu: 100m
# memory: 128Mi
# requests:
# cpu: 100m
# memory: 128Mi
nodeSelector: {}
tolerations: []
affinity: {}