forked from JeDaYoshi/docker-nextdns
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from tecandrew/1.41.0
multi arch images and k8s examples
- Loading branch information
Showing
7 changed files
with
180 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
# NextDNS CLI for Kubernetes | ||
|
||
NOTE: This is a WIP. The docker-compose example was converted to Kubernetes using [kompose](https://kompose.io/). | ||
|
||
0. Obtain your NextDNS Profile ID(s) from the [NextDNS web interface](https://my.nextdns.io) | ||
|
||
1. Create a k8s secret with your NextDNS Profile configuration | ||
|
||
```bash | ||
kubectl create secret generic nextdns-profile --from-literal=profile1=1a2s3d4f --from-literal=profile2=a1s2d3f4 | ||
``` | ||
|
||
2. Deploy the NextDNS docker image from Github Container Registry | ||
|
||
```bash | ||
kubectl apply -f nextdns-deployment.yaml | ||
# view and inspect the deployment | ||
kubectl describe deployments nextdns | ||
# view and inspect the pods in deployment | ||
kubectl get pods | grep nextdns | ||
kubectl describe pods nextdns-<pod-id> | ||
kubectl logs -f nextdns-<pod-id> | ||
``` | ||
|
||
3. Expose the NextDNS service ports using your k8s LoadBalancer or Ingress controller | ||
|
||
```bash | ||
kubectl apply -f nextdns-service.yaml | ||
# view and inspect the service | ||
k get services | grep nextdns | ||
kubectl describe services nextdns | ||
``` | ||
|
||
4. Verify the service is working by querying the service using `nslookup` | ||
|
||
```bash | ||
# using the `EXTERNAL-IP` from the service inspection from step 3 | ||
nslookup twitch.tv <EXTERNAL-IP> | ||
``` | ||
|
||
![](./nslookup-nextdns-logs.png) | ||
|
||
|
||
# Restarting | ||
|
||
Delete the services first, then the reapply deployment | ||
|
||
```bash | ||
kubectl delete -f nextdns-service.yaml | ||
kubectl apply -f nextdns-deployment.yaml | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
version: "3" | ||
|
||
services: | ||
nextdns: | ||
container_name: "nextdns" | ||
image: "ghcr.io/tecandrew/docker-nextdns:1.41.0" | ||
build: | ||
context: ../ | ||
dockerfile: Dockerfile | ||
restart: "always" | ||
ports: | ||
- "53:53/tcp" | ||
- "53:53/udp" | ||
environment: | ||
NEXTDNS_PROFILE: ${NEXTDNS_PROFILE:?NEXTDNS_PROFILE must be set} | ||
NEXTDNS_CACHE_SIZE: "10m" | ||
NEXTDNS_REPORT_CLIENT_INFO: "true" | ||
healthcheck: | ||
test: [ | ||
"CMD", "sh", "-c", | ||
"dig +time=10 @127.0.0.1 -p $$(echo $${NEXTDNS_LISTEN:-:53} | rev | cut -d: -f1 | rev) probe-test.dns.nextdns.io" | ||
] | ||
interval: "1m" | ||
timeout: "10s" | ||
retries: 1 | ||
start_period: "5s" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
annotations: | ||
kompose.cmd: kompose convert | ||
kompose.version: 1.31.2 (HEAD) | ||
creationTimestamp: null | ||
labels: | ||
io.kompose.service: nextdns | ||
name: nextdns | ||
spec: | ||
replicas: 2 | ||
selector: | ||
matchLabels: | ||
io.kompose.service: nextdns | ||
strategy: {} | ||
template: | ||
metadata: | ||
annotations: | ||
kompose.cmd: kompose convert | ||
kompose.version: 1.31.2 (HEAD) | ||
creationTimestamp: null | ||
labels: | ||
io.kompose.network/docker-nextdns-default: "true" | ||
io.kompose.service: nextdns | ||
spec: | ||
containers: | ||
- name: nextdns | ||
image: ghcr.io/tecandrew/docker-nextdns:1.41.0 | ||
imagePullPolicy: Always | ||
env: | ||
- name: NEXTDNS_CACHE_SIZE | ||
value: 128M | ||
- name: NEXTDNS_PROFILE | ||
valueFrom: | ||
secretKeyRef: | ||
name: nextdns-profile | ||
key: profile1 | ||
- name: NEXTDNS_REPORT_CLIENT_INFO | ||
value: "true" | ||
- name: NEXTDNS_MAX_INFLIGHT_REQUESTS | ||
value: "2048" | ||
- name: NEXTDNS_LOG_QUERIES | ||
value: "true" | ||
livenessProbe: | ||
exec: | ||
command: | ||
- sh | ||
- -c | ||
- 'dig +time=10 @127.0.0.1 -p $(echo ${NEXTDNS_LISTEN:-:53} | rev | cut -d: -f1 | rev) probe-test.dns.nextdns.io' | ||
failureThreshold: 1 | ||
initialDelaySeconds: 5 | ||
periodSeconds: 60 | ||
timeoutSeconds: 10 | ||
ports: | ||
- containerPort: 53 | ||
hostPort: 53 | ||
protocol: TCP | ||
- containerPort: 53 | ||
hostPort: 53 | ||
protocol: UDP | ||
resources: {} | ||
restartPolicy: Always | ||
status: {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
annotations: | ||
kompose.cmd: kompose convert | ||
kompose.version: 1.31.2 (HEAD) | ||
creationTimestamp: null | ||
labels: | ||
io.kompose.service: nextdns | ||
name: nextdns | ||
spec: | ||
type: LoadBalancer | ||
ports: | ||
- name: "53" | ||
port: 53 | ||
targetPort: 53 | ||
- name: 53-udp | ||
port: 53 | ||
protocol: UDP | ||
targetPort: 53 | ||
selector: | ||
io.kompose.service: nextdns | ||
status: | ||
loadBalancer: {} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.