Skip to content

Commit

Permalink
Merge branch 'master' into gh-pages
Browse files Browse the repository at this point in the history
  • Loading branch information
irfanhakim-as committed Nov 30, 2023
2 parents 7b444e5 + 53428cf commit 8d8f8ab
Show file tree
Hide file tree
Showing 54 changed files with 3,835 additions and 2,187 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ Applications, developed or curated by [mika](https://github.com/irfanhakim-as),
| ---------- | ----------- | ------- | ------ |
| [clog](https://github.com/irfanhakim-as/charts/tree/master/mika/clog) | Creative blog, Career blog, Coin blog, you name it. || 🔒 |
| [cloudflared](https://github.com/irfanhakim-as/charts/tree/master/mika/cloudflared) | Cloudflare Tunnel is a tunneling software that lets you quickly secure and encrypt application traffic to any type of infrastructure. |||
| [cloudflareddns](https://github.com/irfanhakim-as/charts/tree/master/mika/cloudflareddns) | Access your home network remotely via a custom domain name without a static IP! |||
| [grocy](https://github.com/irfanhakim-as/charts/tree/master/mika/grocy) | Grocy is a web-based self-hosted groceries & household management solution for your home. |||
| [mango](https://github.com/irfanhakim-as/charts/tree/master/mika/mango) | Mango is an easy to use Mastodon bot framework built on top of Django. || 🔒 |
| [postgres](https://github.com/irfanhakim-as/charts/tree/master/mika/postgres) | Easy tool to deploy a PostgreSQL instance on Kubernetes. |||
Expand Down
2 changes: 1 addition & 1 deletion mika/clog/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: clog
description: Creative blog, Career blog, Coin blog, you name it.
type: application
version: 0.2.1
version: 0.2.2
appVersion: "0.0.1-stable"
keywords:
- "clog"
Expand Down
5 changes: 4 additions & 1 deletion mika/clog/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,12 @@ Deploy [`mika/postgres-agent`](../postgres-agent/) with `postgres.mode.drop` set

| Key | Type | Default | Description |
|-----|------|---------|-------------|
| clog.cloudflared.domain | string | `""` | Registered domain name on Cloudflare used for Clog. |
| clog.cloudflared.domain | string | `""` | Registered domain name on Cloudflare used for Clog. Default: `"localhost"`. |
| clog.cloudflared.enabled | bool | `false` | Specifies whether Clog should run using a Cloudflare tunnel. |
| clog.debug | string | `""` | Specifies whether Clog should run in debug mode. Default: `false`. |
| clog.ingress.clusterIssuer | string | `""` | The name of the cluster issuer for Ingress. Default: `"letsencrypt-dns-prod"`. |
| clog.ingress.domain | string | `""` | Registered domain name for Clog. Default: `"localhost"`. |
| clog.ingress.enabled | bool | `false` | Specifies whether Clog should be hosted using an Ingress. |
| clog.name | string | `""` | The name of the Clog service. Default: `"Clog"`. |
| clog.ngrok.enabled | bool | `false` | Specifies whether Clog should run using an Ngrok tunnel. |
| clog.ngrok.token | string | `""` | Ngrok authentication token. |
Expand Down
12 changes: 10 additions & 2 deletions mika/clog/templates/configmap.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
{{- $name := .Values.clog.name | default "Clog" | toString | quote }}
{{- $debug := .Values.clog.debug | default "false" | toString | quote }}
{{- $domain := .Values.clog.cloudflared.domain | default "localhost" | toString }}
{{- $cloudflared := .Values.clog.cloudflared.enabled }}
{{- $ingress := .Values.clog.ingress.enabled }}
{{- $ngrok := .Values.clog.ngrok.enabled }}
{{- $domain := "" -}}
{{- if $cloudflared }}
{{- $domain = .Values.clog.cloudflared.domain | default "localhost" | toString }}
{{- else if $ingress }}
{{- $domain = .Values.clog.ingress.domain | default "localhost" | toString }}
{{- else }}
{{- $domain = "localhost" }}
{{- end }}
apiVersion: v1
kind: ConfigMap
metadata:
Expand All @@ -13,7 +21,7 @@ data:
SITE_NAME: {{ $name }}
DEBUG: {{ $debug }}
NGROK: {{ $ngrok | toString | quote }}
{{- if $cloudflared }}
{{- if or $cloudflared $ingress }}
DOMAIN: {{ $domain | quote }}
{{- end }}
---
Expand Down
3 changes: 2 additions & 1 deletion mika/clog/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
{{- $ngrok_tag := .Values.image.ngrok.tag | default "latest" | toString }}
{{- $ngrok_pullPolicy := .Values.image.ngrok.pullPolicy | default "IfNotPresent" | toString | quote }}
{{- $cloudflared := .Values.clog.cloudflared.enabled }}
{{- $ingress := .Values.clog.ingress.enabled }}
{{- $ngrok := .Values.clog.ngrok.enabled }}
{{- $persistence := .Values.clog.persistence.enabled }}
apiVersion: apps/v1
Expand Down Expand Up @@ -45,7 +46,7 @@ spec:
resources:
{{- toYaml .Values.resources.clog | nindent 12 }}
env:
{{- if $cloudflared }}
{{- if or $cloudflared $ingress }}
- name: ALLOWED_HOSTS
valueFrom:
configMapKeyRef:
Expand Down
38 changes: 38 additions & 0 deletions mika/clog/templates/ingress.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{{- $ingress := .Values.clog.ingress.enabled }}
{{- if $ingress }}
{{- $cluster_issuer := .Values.clog.ingress.clusterIssuer | default "letsencrypt-dns-prod" | toString | quote }}
{{- $domain = .Values.clog.ingress.domain | default "localhost" | toString }}
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ .Release.Name }}-clog-ingress
labels:
{{- include "clog.labels" . | nindent 4 }}
annotations:
cert-manager.io/cluster-issuer: {{ $cluster_issuer }}
cert-manager.io/private-key-algorithm: "ECDSA"
nginx.ingress.kubernetes.io/affinity: "cookie"
nginx.ingress.kubernetes.io/affinity-mode: "persistent"
nginx.ingress.kubernetes.io/proxy-body-size: "100m"
nginx.ingress.kubernetes.io/session-cookie-expires: "172800"
nginx.ingress.kubernetes.io/session-cookie-max-age: "172800"
nginx.ingress.kubernetes.io/session-cookie-name: "route"
nginx.org/client-max-body-size: "100m"
spec:
ingressClassName: "nginx"
rules:
- host: {{ $domain | quote }}
http:
paths:
- backend:
service:
name: {{ .Release.Name }}-clog-svc
port:
number: 80
path: /
pathType: Prefix
tls:
- hosts:
- {{ $domain | quote }}
secretName: {{ .Release.Name }}-clog-tls-cert
{{- end }}
15 changes: 15 additions & 0 deletions mika/clog/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,21 @@ clog:
# enabled: true
enabled: false
# Registered domain name on Cloudflare used for Clog.
# Default: "localhost"
# Example:
# domain: "clog.example.com"
domain: ""
# Clog Ingress configurations.
ingress:
# Specifies whether Clog should be hosted using an Ingress.
# Example:
# enabled: true
enabled: false
# The name of the cluster issuer for Ingress.
# Default: "letsencrypt-dns-prod"
clusterIssuer: ""
# Registered domain name for Clog.
# Default: "localhost"
# Example:
# domain: "clog.example.com"
domain: ""
Expand Down
23 changes: 23 additions & 0 deletions mika/cloudflareddns/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# 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
*.orig
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/
19 changes: 19 additions & 0 deletions mika/cloudflareddns/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
apiVersion: v2
name: cloudflareddns
description: Access your home network remotely via a custom domain name without a static IP!
type: application
version: 0.1.0
appVersion: "latest"
keywords:
- "cloudflareddns"
- "cloudflare"
- "ddns"
- "cloudflare-ddns"
home: "https://github.com/irfanhakim-as/charts"
icon: "https://irfanhakim-as.github.io/charts/logos/cloudflare.png"
sources:
- "https://github.com/timothymiller/cloudflare-ddns"
maintainers:
- name: "Irfan Hakim"
email: "[email protected]"
url: "https://github.com/irfanhakim-as"
87 changes: 87 additions & 0 deletions mika/cloudflareddns/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
# [`cloudflareddns`](https://github.com/timothymiller/cloudflare-ddns)

## Prerequisites

- Kubernetes 1.19+
- Helm 3.2.0+

## How to add repo

Add the repo to your local helm client.

```sh
helm repo add mika https://irfanhakim-as.github.io/charts
```

Update the repo to retrieve the latest versions of the packages.

```sh
helm repo update
```

## How to install

### Prepare chart values

Copy `values.yaml` from the chart you would like to install.

```sh
cp mika/cloudflareddns/values.yaml .
```

Edit `values.yaml` with the appropriate values. Please refer to the [Configurations](#configurations) section below, or the `values.yaml` file itself for details and sample values.

```sh
nano values.yaml
```

### Perform installation

Install the desired chart. Replace `$release_name` and `$namespace` accordingly.

```sh
helm install $release_name mika/cloudflareddns --namespace $namespace --create-namespace --values values.yaml --wait
```

Verify that your chart has been installed. Replace `$namespace` and `$release_name` accordingly.

```sh
helm ls --namespace $namespace | grep "$release_name"
```

## How to upgrade

After making any necessary changes to the `values.yaml` file, upgrade the desired chart. Replace `$release_name` and `$namespace` accordingly.

```sh
helm upgrade $release_name mika/cloudflareddns --namespace $namespace --values values.yaml --wait
```

## How to uninstall

Uninstall the desired chart. Replace `$release_name` and `$namespace` accordingly.

```sh
helm uninstall $release_name --namespace $namespace --wait
```

## Configurations

| Key | Type | Default | Description |
|-----|------|---------|-------------|
| cloudflareddns.configPath | string | `""` | The path to the cloudflareddns configuration directory. Default: `"/etc/cloudflare-ddns"`. |
| cloudflareddns.ipv4 | string | `""` | Specify whether to add an A record for each subdomain. Default: `"true"`. |
| cloudflareddns.ipv6 | string | `""` | Specify whether to add an AAAA record for each subdomain. Default: `"false"`. |
| cloudflareddns.subdomains | list | `[]` | The list of subdomains to be updated, each with their own hostname and proxied setting. |
| cloudflareddns.token | string | `""` | The Cloudflare API token used to authenticate with the Cloudflare API. |
| cloudflareddns.zoneID | string | `""` | The ID of the zone that will get the records. |
| image.cloudflareddns.pullPolicy | string | `""` | The policy that determines when Kubernetes should pull the cloudflareddns container image. Default: `"IfNotPresent"`. |
| image.cloudflareddns.registry | string | `""` | The registry where the cloudflareddns container image is hosted. Default: `"docker.io"`. |
| image.cloudflareddns.repository | string | `""` | The name of the repository that contains the cloudflareddns container image used. Default: `"timothyjmiller/cloudflare-ddns"`. |
| image.cloudflareddns.tag | string | `""` | The tag that specifies the version of the cloudflareddns container image used. Default: `Chart appVersion`. |
| imagePullSecrets | list | `[]` | Credentials used to securely authenticate and authorise the pulling of container images from private registries. |
| replicaCount | string | `""` | The desired number of running replicas for cloudflareddns. Default: `"1"`. |
| resources.limits.cpu | string | `"50m"` | The maximum amount of CPU resources allowed for cloudflareddns. |
| resources.limits.memory | string | `"32Mi"` | The maximum amount of memory allowed for cloudflareddns. |
| resources.requests.cpu | string | `"10m"` | The minimum amount of CPU resources required by cloudflareddns. |
| resources.requests.memory | string | `"10Mi"` | The minimum amount of memory required by cloudflareddns. |
5 changes: 5 additions & 0 deletions mika/cloudflareddns/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
cloudflareddns is now installed and configured for {{ .Release.Name | toString }}.

See the values.yaml file of this chart for more configuration options.

Please refer to the official documentation for more information on how to use cloudflareddns.
62 changes: 62 additions & 0 deletions mika/cloudflareddns/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "cloudflareddns.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 "cloudflareddns.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 "cloudflareddns.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Common labels
*/}}
{{- define "cloudflareddns.labels" -}}
helm.sh/chart: {{ include "cloudflareddns.chart" . }}
{{ include "cloudflareddns.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}

{{/*
Selector labels
*/}}
{{- define "cloudflareddns.selectorLabels" -}}
app.kubernetes.io/name: {{ include "cloudflareddns.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}

{{/*
Create the name of the service account to use
*/}}
{{- define "cloudflareddns.serviceAccountName" -}}
{{- if .Values.serviceAccount.create }}
{{- default (include "cloudflareddns.fullname" .) .Values.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}
28 changes: 28 additions & 0 deletions mika/cloudflareddns/templates/config.json.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{{/*
Cloudflare-DDNS config.json template
*/}}
{{- define "cloudflareddns.config-json" -}}
{
"cloudflare": [
{
"authentication": {
"api_token": "API_TOKEN"
},
"zone_id": "ZONE_ID",
"subdomains": [
{{- $subdomains := .Values.cloudflareddns.subdomains }}
{{- range $index, $subdomain := $subdomains }}
{
"name": "{{ $subdomain.hostname }}",
"proxied": {{ $subdomain.proxied }}
}{{ if ne $index (sub (len $subdomains) 1) }},{{ end }}
{{- end }}
]
}
],
"a": ENABLE_IPV4,
"aaaa": ENABLE_IPV6,
"purgeUnknownRecords": false,
"ttl": 300
}
{{- end }}
9 changes: 9 additions & 0 deletions mika/cloudflareddns/templates/configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{{- $config_path := .Values.cloudflareddns.configPath | default "/etc/cloudflare-ddns" | toString | quote }}
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ .Release.Name }}-cloudflareddns-cm
labels:
{{- include "cloudflareddns.labels" . | nindent 4 }}
data:
CONFIG_PATH: {{ $config_path }}
Loading

0 comments on commit 8d8f8ab

Please sign in to comment.