This repository will describe how to deploy No-IP DUC to Kubernetes.
Note
This repository using beta version of No-IP DUC. The configuration of this version is incompatible with Version 2.x.
- Building image
- Deploy to Kubernetes
- Update No-IP DUC client version
- Update configurations
- References
Note
If you want to test the image first, you can put .env
file in scripts
directory before you build the image, the startup script will read and set environment variables from the file.
Warning
It is recommanded to put these sensitive data in secret store such as Kubernetes secret if No-IP DUC runs in production environment.
Buliding image is easy while all necessary configurations are written in Dockerfile.
You can just issue docker build --tag <IMAGE_NAME> . --no-cache
command to build image.
Before deploying No-IP DUC to Kubernetes, you need to create namespace and secrets for No-IP DUC pod first.
You can simply edit and use
prepare.yaml
to create namespace and secret in.kubernetes
directory.
Namespace can be created by issuing kubectl create ns <NAMESPACE>
command or save the contents below as a yaml file and apply it with command kubectl apply -f <YAML_FILE_NAME>
.
# namespace.yaml
apiVersion: v1
kind: Namespace
metadata:
name: <NAMESPACE_NAME>
You can simply edit and use
prepare.yaml
to create namespace and secret in.kubernetes
directory.
To run No-IP DUC, you need to provide these required parameters lists below:
- username
- password
- domain name
You can create a secret to store these values.
Note
If you have multiple domain names, split domain names with comma.
# duc-secrets.yaml
apiVersion: v1
kind: Secret
metadata:
name: <SECRET_NAME>
namespace: <NAMESPACE_CREATED_ABOVE>
type: Opaque
data:
username: <UERNAME_ON_NOIP>
password: <PASSWWORD_ON_NOIP>
domains: <DOMAIN_TO_SYNC>
Deployment file is located in .kubernetes
directory. You need to change values, which with uppercase alphabets and underscores, to the correct values in the file.
After it, issue kubectl apply -f deployment.yaml
command to deploy No-IP DUC to Kubernetes.
Before using GitHub Actions, you need to modify production.yml
in .github/workflows
directory first.
Find out all vars and secrets in the yaml file, and set these values under GitHub repository vars and secrets.
Vars
are start withvars.
prefix, andsecrets
are start withsecret.
prefix.
And change all values with uppercase alphabets between <
and >
to correct value.
Don't forget to uncomment at least one block on
on
block.
When these steps are finished, you can commit and push the repository to GitHub to start deployment flow.
Note
No-IP DUC version 2.x, which is known as stable version, is incompatible with 3.x configurations.
To update No-IP DUC client, simply follow these three steps below:
- Change the download url in
Dockerfile
to a newer version. - Build the image.
- Deploy to Kubernetes, that's all.
To update the configurations, simply change the values in secrets and restart the pod, that's all.
- How to Install the Linux 3.x Dynamic Update Client (DUC)
- How to Install the No-IP Dynamic Update Client
- Can I run a command WITHIN another command?
- bash how to check if file exists
- Creating Environmental Variables
- Load environment variables from dotenv / .env file in Bash
- Set environment variables from file of key/value pairs
- How to Set Environment Variables in Linux
- How to Read a File Line By Line in Bash
- Change default shell
- Pass args for script when going thru pipe
- How To Set Environment Variable in Bash
- How do I delete an exported environment variable?