diff options
Diffstat (limited to '')
-rw-r--r-- | kubernetes/pihole/10-customdns.conf | 1 | ||||
-rwxr-xr-x | kubernetes/pihole/deploy.sh | 1 | ||||
-rw-r--r-- | kubernetes/pihole/pihole-deployment.yaml | 28 | ||||
-rwxr-xr-x | kubernetes/squid/deploy.sh | 4 | ||||
-rw-r--r-- | kubernetes/squid/squid-configmap.yaml | 7 | ||||
-rw-r--r-- | kubernetes/squid/squid-proxy-deployment.yaml | 36 |
6 files changed, 41 insertions, 36 deletions
diff --git a/kubernetes/pihole/10-customdns.conf b/kubernetes/pihole/10-customdns.conf index a5c4539..af0b1b7 100644 --- a/kubernetes/pihole/10-customdns.conf +++ b/kubernetes/pihole/10-customdns.conf @@ -6,3 +6,4 @@ host-record=phone.lan,192.168.1.110 host-record=switch.lan,192.168.1.106 host-record=router.lan,192.168.1.200 host-record=voidbox.lan,192.168.1.103 +host-record=searx.lan,192.168.1.109 diff --git a/kubernetes/pihole/deploy.sh b/kubernetes/pihole/deploy.sh index 7b2dc5b..52bdd90 100755 --- a/kubernetes/pihole/deploy.sh +++ b/kubernetes/pihole/deploy.sh @@ -2,4 +2,5 @@ kubectl apply -f ./pihole-secret.yaml kubectl apply -f ./pihole-configmap.yaml +kubectl create configmap local-dns-file --from-file=10-customdns.conf kubectl apply -f ./pihole-deployment.yaml diff --git a/kubernetes/pihole/pihole-deployment.yaml b/kubernetes/pihole/pihole-deployment.yaml index 8f48319..cd04227 100644 --- a/kubernetes/pihole/pihole-deployment.yaml +++ b/kubernetes/pihole/pihole-deployment.yaml @@ -23,16 +23,24 @@ spec: - 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 + - name: TZ + valueFrom: + configMapKeyRef: + name: pihole-configmap + key: pihole_tz + - name: WEBPASSWORD + valueFrom: + secretKeyRef: + name: pihole-secret + key: pihole-webpassword + volumeMounts: + - name: local-dns + mountPath: /etc/dnsmasq.d/10-customdns.conf + readOnly: true + volumes: + - name: local-dns + configMap: + name: local-dns-file --- apiVersion: v1 kind: Service diff --git a/kubernetes/squid/deploy.sh b/kubernetes/squid/deploy.sh new file mode 100755 index 0000000..0ff1d92 --- /dev/null +++ b/kubernetes/squid/deploy.sh @@ -0,0 +1,4 @@ +#!/usr/bin/env sh + +kubectl create configmap squid-config-file --from-file=squid.conf +kubectl apply -f ./squid-proxy-deployment.yaml diff --git a/kubernetes/squid/squid-configmap.yaml b/kubernetes/squid/squid-configmap.yaml deleted file mode 100644 index 8820f6d..0000000 --- a/kubernetes/squid/squid-configmap.yaml +++ /dev/null @@ -1,7 +0,0 @@ -apiVersion: v1 -kind: ConfigMap -metadata: - name: squid-configmap -data: - pihole_tz: iran/tehran - squid_config_vol: /etc/squid/ diff --git a/kubernetes/squid/squid-proxy-deployment.yaml b/kubernetes/squid/squid-proxy-deployment.yaml index 1ef2c40..1fa2c4c 100644 --- a/kubernetes/squid/squid-proxy-deployment.yaml +++ b/kubernetes/squid/squid-proxy-deployment.yaml @@ -2,12 +2,12 @@ apiVersion: apps/v1 kind: Deployment metadata: name: squid - lables: + labels: app: squid spec: replicas: 1 - selctor: - matchlabels: + selector: + matchLabels: app: squid template: metadata: @@ -16,21 +16,17 @@ spec: spec: containers: - name: squid - image: bloodstalker/squid:apline-5.0 + image: b4tman/squid:5.2 ports: - - containerPort: 80 - env: - - name: TZ - valueFrom: - configMapKeyRef: - name: squid-configmap - key: pihole_tz + - containerPort: 80 + volumeMounts: + - name: squid-conf + mountPath: /etc/squid/squid.conf + readOnly: true volumes: - - name: squid-config-volume - valueFrom: - configMapKeyRef: - name: k3s-rpi-configmap - key: squid_config_vol + - name: squid-conf + configMap: + name: squid-config-file --- apiVersion: v1 kind: Service @@ -39,13 +35,15 @@ metadata: spec: selector: app: squid - type: LoadBalancer + type: NodePort ports: - protocol: UDP port: 80 targetPort: 80 - nodePort: 80 + nodePort: 30880 + name: "squid-udp-80" - protocol: TCP port: 80 targetPort: 80 - nodePort: 80 + nodePort: 30880 + name: "squid-tcp-80" |