feat: replace gluetun-auth ConfigMap with ip-reporter service for public IP retrieval
This commit is contained in:
parent
b2024efb7e
commit
4c62bfa7b8
@ -21,23 +21,6 @@ spec:
|
|||||||
requests:
|
requests:
|
||||||
storage: 1Gi
|
storage: 1Gi
|
||||||
---
|
---
|
||||||
apiVersion: v1
|
|
||||||
kind: ConfigMap
|
|
||||||
metadata:
|
|
||||||
name: gluetun-auth
|
|
||||||
namespace: downloads
|
|
||||||
data:
|
|
||||||
config.toml: |
|
|
||||||
[[roles]]
|
|
||||||
name = "public"
|
|
||||||
|
|
||||||
[roles.auth]
|
|
||||||
method = "none"
|
|
||||||
|
|
||||||
[[roles.routes]]
|
|
||||||
method = "GET"
|
|
||||||
path = "/v1/publicip/ip"
|
|
||||||
---
|
|
||||||
apiVersion: apps/v1
|
apiVersion: apps/v1
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
metadata:
|
metadata:
|
||||||
@ -86,10 +69,6 @@ spec:
|
|||||||
volumeMounts:
|
volumeMounts:
|
||||||
- name: tun
|
- name: tun
|
||||||
mountPath: /dev/net/tun
|
mountPath: /dev/net/tun
|
||||||
- name: gluetun-auth
|
|
||||||
mountPath: /gluetun/auth
|
|
||||||
ports:
|
|
||||||
- containerPort: 8000
|
|
||||||
- name: qbittorrent
|
- name: qbittorrent
|
||||||
image: lscr.io/linuxserver/qbittorrent:5.2.0
|
image: lscr.io/linuxserver/qbittorrent:5.2.0
|
||||||
ports:
|
ports:
|
||||||
@ -108,6 +87,31 @@ spec:
|
|||||||
mountPath: /config
|
mountPath: /config
|
||||||
- name: torrents
|
- name: torrents
|
||||||
mountPath: /mnt/storage/torrents
|
mountPath: /mnt/storage/torrents
|
||||||
|
- name: ip-reporter
|
||||||
|
image: python:3-alpine
|
||||||
|
ports:
|
||||||
|
- containerPort: 8888
|
||||||
|
command:
|
||||||
|
- python3
|
||||||
|
- -c
|
||||||
|
- |
|
||||||
|
import http.server, urllib.request
|
||||||
|
|
||||||
|
class Handler(http.server.BaseHTTPRequestHandler):
|
||||||
|
def do_GET(self):
|
||||||
|
try:
|
||||||
|
ip = urllib.request.urlopen('https://ipinfo.io/ip').read().decode().strip()
|
||||||
|
except Exception as e:
|
||||||
|
ip = f'error: {e}'
|
||||||
|
body = ip.encode()
|
||||||
|
self.send_response(200)
|
||||||
|
self.send_header('Content-Type', 'text/plain')
|
||||||
|
self.send_header('Content-Length', len(body))
|
||||||
|
self.end_headers()
|
||||||
|
self.wfile.write(body)
|
||||||
|
def log_message(self, *a): pass
|
||||||
|
|
||||||
|
http.server.HTTPServer(('0.0.0.0', 8888), Handler).serve_forever()
|
||||||
volumes:
|
volumes:
|
||||||
- name: tun
|
- name: tun
|
||||||
hostPath:
|
hostPath:
|
||||||
@ -120,9 +124,6 @@ spec:
|
|||||||
hostPath:
|
hostPath:
|
||||||
path: /mnt/storage/torrents
|
path: /mnt/storage/torrents
|
||||||
type: Directory
|
type: Directory
|
||||||
- name: gluetun-auth
|
|
||||||
configMap:
|
|
||||||
name: gluetun-auth
|
|
||||||
---
|
---
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: Service
|
kind: Service
|
||||||
@ -136,9 +137,9 @@ spec:
|
|||||||
- name: web
|
- name: web
|
||||||
port: 80
|
port: 80
|
||||||
targetPort: 8080
|
targetPort: 8080
|
||||||
- name: gluetun-api
|
- name: ip-reporter
|
||||||
port: 8000
|
port: 8888
|
||||||
targetPort: 8000
|
targetPort: 8888
|
||||||
---
|
---
|
||||||
apiVersion: networking.k8s.io/v1
|
apiVersion: networking.k8s.io/v1
|
||||||
kind: Ingress
|
kind: Ingress
|
||||||
@ -193,6 +194,6 @@ spec:
|
|||||||
kind: Rule
|
kind: Rule
|
||||||
services:
|
services:
|
||||||
- name: qbittorrent
|
- name: qbittorrent
|
||||||
port: 8000
|
port: 8888
|
||||||
tls:
|
tls:
|
||||||
secretName: gluetun-tls
|
secretName: gluetun-tls
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user