From c43133af81f5a15ce85a8722a881debab9a32316 Mon Sep 17 00:00:00 2001
From: terminaldweller <thabogre@gmail.com>
Date: Thu, 18 Nov 2021 18:10:41 +0330
Subject: kubernetes updates

---
 kubernetes/pihole/deploy.sh              |  5 +++
 kubernetes/pihole/pihole-configmap.yaml  |  6 +++
 kubernetes/pihole/pihole-deployment.yaml | 70 ++++++++++++++++++++++++++++++++
 kubernetes/pihole/pihole-secret.yaml     |  7 ++++
 4 files changed, 88 insertions(+)
 create mode 100755 kubernetes/pihole/deploy.sh
 create mode 100644 kubernetes/pihole/pihole-configmap.yaml
 create mode 100644 kubernetes/pihole/pihole-deployment.yaml
 create mode 100644 kubernetes/pihole/pihole-secret.yaml

(limited to 'kubernetes/pihole')

diff --git a/kubernetes/pihole/deploy.sh b/kubernetes/pihole/deploy.sh
new file mode 100755
index 0000000..7b2dc5b
--- /dev/null
+++ b/kubernetes/pihole/deploy.sh
@@ -0,0 +1,5 @@
+#!/usr/bin/env sh
+
+kubectl apply -f ./pihole-secret.yaml
+kubectl apply -f ./pihole-configmap.yaml
+kubectl apply -f ./pihole-deployment.yaml
diff --git a/kubernetes/pihole/pihole-configmap.yaml b/kubernetes/pihole/pihole-configmap.yaml
new file mode 100644
index 0000000..d0c34bf
--- /dev/null
+++ b/kubernetes/pihole/pihole-configmap.yaml
@@ -0,0 +1,6 @@
+apiVersion: v1
+kind: ConfigMap
+metadata:
+  name: pihole-configmap
+data:
+  pihole_tz: iran/tehran
diff --git a/kubernetes/pihole/pihole-deployment.yaml b/kubernetes/pihole/pihole-deployment.yaml
new file mode 100644
index 0000000..8f48319
--- /dev/null
+++ b/kubernetes/pihole/pihole-deployment.yaml
@@ -0,0 +1,70 @@
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+  name: pihole
+  labels:
+    app: pihole
+spec:
+  replicas: 1
+  selector:
+    matchLabels:
+      app: pihole
+  template:
+    metadata:
+      labels:
+        app: pihole
+    spec:
+      containers:
+      - name: pihole
+        image: pihole/pihole
+        ports:
+        - containerPort: 53
+        - containerPort: 67
+        - containerPort: 80
+        - containerPort: 443
+        env:
+        - name: TZ
+          valueFrom:
+            configMapKeyRef:
+              name: pihole-configmap
+              key: pihole_tz
+        - name: WEBPASSWORD
+          valueFrom:
+            secretKeyRef:
+              name: pihole-secret
+              key: pihole-webpassword
+---
+apiVersion: v1
+kind: Service
+metadata:
+  name: pihole-service
+spec:
+  selector:
+    app: pihole
+  type: NodePort
+  ports:
+    - protocol: TCP
+      port: 2053
+      targetPort: 53
+      nodePort: 30153
+      name: "pihole-tcp-53"
+    - protocol: UDP
+      port: 2053
+      targetPort: 53
+      nodePort: 30153
+      name: "pihole-udp-53"
+    - protocol: UDP
+      port: 2067
+      targetPort: 67
+      nodePort: 30167
+      name: "pihole-udp-67"
+    - protocol: TCP
+      port: 2080
+      targetPort: 80
+      nodePort: 30180
+      name: "pihole-tcp-80"
+    - protocol: TCP
+      port: 20443
+      targetPort: 443
+      nodePort: 30443
+      name: "pihole-tcp-443"
diff --git a/kubernetes/pihole/pihole-secret.yaml b/kubernetes/pihole/pihole-secret.yaml
new file mode 100644
index 0000000..f79d6a6
--- /dev/null
+++ b/kubernetes/pihole/pihole-secret.yaml
@@ -0,0 +1,7 @@
+apiVersion: v1
+kind: Secret
+metadata:
+  name: pihole-secret
+type: Opaque
+data:
+  pihole-webpassword: WGFzaG1pdGgjNjY2Cg==
-- 
cgit v1.2.3