Deploy on a Kubernetes cluster¶
ddflare can be run as a Deployment
on a Kubernetes cluster.
In this case it is reccomended to store the service credentials in a Kubernetes Secret
:
DDNS service Deployment¶
Prerequisite is to register for a No-IP account and get a FQDN and the authentication credentials as explained in the Update section.
Required data | Sample value |
---|---|
DDNS provider | No-IP |
FQDN to update | myhost.ddns.net |
user | 68816xj |
password | v4UMHzugodpE |
Create the secret with:
kubectl -n ddflare create secret generic myhost.ddns.net \
--from-literal=token=68816xj:v4UMHzugodpE
Apply the ddflare deployment yaml:
myhost-ddns-net.yaml
with:
apiVersion: apps/v1
kind: Deployment
metadata:
name: myhost.ddns.net
namespace: ddflare
spec:
selector:
matchLabels:
ddomain: myhost.ddns.net
replicas: 1
template:
metadata:
labels:
ddomain: myhost.ddns.net
spec:
containers:
- name: ddflare
image: ghcr.io/ddflare/ddflare:0.7.0
args: ["set", "-s", "noip", "-l", "myhost.ddns.net"]
env:
- name: DDFLARE_API_TOKEN
valueFrom:
secretKeyRef:
name: myhost.ddns.net
key: token
Cloudflare Deployment¶
Prerequisite is to have registered a domain with Couldflare and have created a type A record and a Cloudflare API token as explained in the Update section.
Required data | Sample value |
---|---|
FQDN to update | myhost.example.com |
API token | gB1fOLbl2d5XynhfIOJvzX8Y4rZnU5RLPW1hg7cM |
Create the secret with:
kubectl -n ddflare create secret generic myhost.example.com \
--from-literal=token=gB1fOLbl2d5XynhfIOJvzX8Y4rZnU5RLPW1hg7cM
Apply the ddflare deployment yaml:
myhost-example-com.yaml
with:
apiVersion: apps/v1
kind: Deployment
metadata:
name: myhost.example.com
namespace: ddflare
spec:
selector:
matchLabels:
ddomain: myhost.example.com
replicas: 1
template:
metadata:
labels:
ddomain: myhost.example.com
spec:
containers:
- name: ddflare
image: ghcr.io/ddflare/ddflare:0.7.0
args: ["set", "-l", "myhost.example.com"]
env:
- name: DDFLARE_API_TOKEN
valueFrom:
secretKeyRef:
name: myhost.example.com
key: token