From f9e8deec17ea1784b45e7ea620ed0fef49170359 Mon Sep 17 00:00:00 2001 From: terminaldweller Date: Sat, 8 Oct 2022 11:55:21 +0330 Subject: update --- kubernetes/bitlbee-purple/bitlbee-data-volume.yaml | 12 ++ kubernetes/bitlbee-purple/bitlbee-deployment.yaml | 40 +++++-- kubernetes/bitlbee-purple/bitlbee.conf | 132 +++++++++++++++++++++ kubernetes/bitlbee-purple/conf/bitlbee.conf | 132 --------------------- kubernetes/bitlbee-purple/deploy.sh | 9 ++ kubernetes/debug/debug-deployment.yaml | 46 +++++++ 6 files changed, 231 insertions(+), 140 deletions(-) create mode 100644 kubernetes/bitlbee-purple/bitlbee-data-volume.yaml create mode 100644 kubernetes/bitlbee-purple/bitlbee.conf delete mode 100644 kubernetes/bitlbee-purple/conf/bitlbee.conf create mode 100755 kubernetes/bitlbee-purple/deploy.sh create mode 100644 kubernetes/debug/debug-deployment.yaml (limited to 'kubernetes') diff --git a/kubernetes/bitlbee-purple/bitlbee-data-volume.yaml b/kubernetes/bitlbee-purple/bitlbee-data-volume.yaml new file mode 100644 index 0000000..e2ed65b --- /dev/null +++ b/kubernetes/bitlbee-purple/bitlbee-data-volume.yaml @@ -0,0 +1,12 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + creationTimestamp: null + name: bitlbee-data +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 100Mi +status: {} diff --git a/kubernetes/bitlbee-purple/bitlbee-deployment.yaml b/kubernetes/bitlbee-purple/bitlbee-deployment.yaml index 642794a..a8971fa 100644 --- a/kubernetes/bitlbee-purple/bitlbee-deployment.yaml +++ b/kubernetes/bitlbee-purple/bitlbee-deployment.yaml @@ -17,16 +17,40 @@ spec: containers: - name: bitlbee-libpurple image: ezkrg/bitlbee-libpurple:debian-20220408145536 + imagePullPolicy: IfNotPresent + command: + - /usr/sbin/bitlbee + - -F + - -n + - -u + - bitlbee + - -c + - /var/lib/bitlbee/bitlbee.conf + - -d + - /bitlbee-user-data/ ports: - containerPort: 6667 - # volumeMounts: - # - name: bitlbee-libpurple-conf - # mountPath: /var/lib/bitlbee - # readOnly: true - # volumes: - # - name: bitlbee-conf - # configMap: - # name: bitlbee-config-file + volumeMounts: + - name: bitlbee-conf + mountPath: /var/lib/bitlbee/bitlbee.conf + subPath: bitlbee.conf + readOnly: true + - name: bitlbee-data + mountPath: /bitlbee-user-data/ + env: + - name: HTTPS_PROXY + value: socks5://192.168.1.103:9995 + - name: HTTP_PROXY + value: socks5://192.168.1.103:9995 + - name: NO_PROXY + value: localhost, 127.0.0.1, 10.0.0.0/24 + volumes: + - name: bitlbee-conf + configMap: + name: bitlbee-config-file + - name: bitlbee-data + persistentVolumeClaim: + claimName: bitlbee-data --- apiVersion: v1 kind: Service diff --git a/kubernetes/bitlbee-purple/bitlbee.conf b/kubernetes/bitlbee-purple/bitlbee.conf new file mode 100644 index 0000000..e230337 --- /dev/null +++ b/kubernetes/bitlbee-purple/bitlbee.conf @@ -0,0 +1,132 @@ +## BitlBee default configuration file +## +## Comments are marked like this. The rest of the file is INI-style. The +## comments should tell you enough about what all settings mean. +## + +[settings] + +## RunMode: +## +## Inetd -- Run from inetd (default) +## Daemon -- Run as a stand-alone daemon, serving all users from one process. +## This saves memory if there are more users, the downside is that when one +## user hits a crash-bug, all other users will also lose their connection. +## ForkDaemon -- Run as a stand-alone daemon, but keep all clients in separate +## child processes. This should be pretty safe and reliable to use instead +## of inetd mode. +## +##RunMode = Daemon + +## User: +## +## If BitlBee is started by root as a daemon, it can drop root privileges, +## and change to the specified user. +## +##User = bitlbee + +## DaemonPort/DaemonInterface: +## +## For daemon mode, you can specify on what interface and port the daemon +## should be listening for connections. +## +##DaemonInterface = 127.0.0.1 +DaemonPort = 6667 + +## ClientInterface: +## +## If for any reason, you want BitlBee to use a specific address/interface +## for outgoing traffic (IM connections, HTTP(S), etc.), set it here. +## +# ClientInterface = 0.0.0.0 + +## AuthMode +## +## Open -- Accept connections from anyone, use NickServ for user authentication. +## (default) +## Closed -- Require authorization (using the PASS command during login) before +## allowing the user to connect at all. +## Registered -- Only allow registered users to use this server; this disables +## the register- and the account command until the user identifies himself. +## +# AuthMode = Open +## AuthPassword +## +## Password the user should enter when logging into a closed BitlBee server. +## You can also have an MD5-encrypted password here. Format: "md5:", followed +## by a hash as generated for the attribute in a BitlBee +## XML file (for now there's no easier way to generate the hash). +## +# AuthPassword = ItllBeBitlBee ## Heh.. Our slogan. ;-) +## or +# AuthPassword = md5:gzkK0Ox/1xh+1XTsQjXxBJ571Vgl + +## OperPassword +## +## Password that unlocks access to special operator commands. +## +# OperPassword = ChangeMe! +## or +# OperPassword = md5:I0mnZbn1t4R731zzRdDN2/pK7lRX + +## HostName +## +## Normally, BitlBee gets a hostname using getsockname(). If you have a nicer +## alias for your BitlBee daemon, you can set it here and BitlBee will identify +## itself with that name instead. +## +# HostName = localhost + +## MotdFile +## +## Specify an alternative MOTD (Message Of The Day) file. Default value depends +## on the --etcdir argument to configure. +## +# MotdFile = /etc/bitlbee/motd.txt + +## ConfigDir +## +## Specify an alternative directory to store all the per-user configuration +## files. (.nicks/.accounts) +## +ConfigDir = /var/lib/bitlbee + +## Ping settings +## +## BitlBee can send PING requests to the client to check whether it's still +## alive. This is not very useful on local servers, but it does make sense +## when most clients connect to the server over a real network interface. +## (Public servers) Pinging the client will make sure lost clients are +## detected and cleaned up sooner. +## +## PING requests are sent every PingInterval seconds. If no PONG reply has + +## been received for PingTimeOut seconds, BitlBee aborts the connection. +## +## To disable the pinging, set at least one of these to 0. +## +# PingInterval = 180 +# PingTimeOut = 300 + +## Using proxy servers for outgoing connections +## +## If you're running BitlBee on a host which is behind a restrictive firewall +## and a proxy server, you can tell BitlBee to use that proxy server here. +## The setting has to be a URL, formatted like one of these examples: +## +## (Obviously, the username and password are optional) +## +## Proxy = http://john:doe@proxy.localnet.com:8080 +## Proxy = socks4://socksproxy.localnet.com +Proxy = socks5://192.168.1.103:9995 + + +[defaults] + +## Here you can override the defaults for some per-user settings. Users are +## still able to override your defaults, so this is not a way to restrict +## your users... + +## To enable private mode by default, for example: + +## private = 1 diff --git a/kubernetes/bitlbee-purple/conf/bitlbee.conf b/kubernetes/bitlbee-purple/conf/bitlbee.conf deleted file mode 100644 index 4a1540b..0000000 --- a/kubernetes/bitlbee-purple/conf/bitlbee.conf +++ /dev/null @@ -1,132 +0,0 @@ -## BitlBee default configuration file -## -## Comments are marked like this. The rest of the file is INI-style. The -## comments should tell you enough about what all settings mean. -## - -[settings] - -## RunMode: -## -## Inetd -- Run from inetd (default) -## Daemon -- Run as a stand-alone daemon, serving all users from one process. -## This saves memory if there are more users, the downside is that when one -## user hits a crash-bug, all other users will also lose their connection. -## ForkDaemon -- Run as a stand-alone daemon, but keep all clients in separate -## child processes. This should be pretty safe and reliable to use instead -## of inetd mode. -## -##RunMode = Daemon - -## User: -## -## If BitlBee is started by root as a daemon, it can drop root privileges, -## and change to the specified user. -## -##User = bitlbee - -## DaemonPort/DaemonInterface: -## -## For daemon mode, you can specify on what interface and port the daemon -## should be listening for connections. -## -##DaemonInterface = 127.0.0.1 -DaemonPort = 6667 - -## ClientInterface: -## -## If for any reason, you want BitlBee to use a specific address/interface -## for outgoing traffic (IM connections, HTTP(S), etc.), set it here. -## -# ClientInterface = 0.0.0.0 - -## AuthMode -## -## Open -- Accept connections from anyone, use NickServ for user authentication. -## (default) -## Closed -- Require authorization (using the PASS command during login) before -## allowing the user to connect at all. -## Registered -- Only allow registered users to use this server; this disables -## the register- and the account command until the user identifies himself. -## -# AuthMode = Open -## AuthPassword -## -## Password the user should enter when logging into a closed BitlBee server. -## You can also have an MD5-encrypted password here. Format: "md5:", followed -## by a hash as generated for the attribute in a BitlBee -## XML file (for now there's no easier way to generate the hash). -## -# AuthPassword = ItllBeBitlBee ## Heh.. Our slogan. ;-) -## or -# AuthPassword = md5:gzkK0Ox/1xh+1XTsQjXxBJ571Vgl - -## OperPassword -## -## Password that unlocks access to special operator commands. -## -# OperPassword = ChangeMe! -## or -# OperPassword = md5:I0mnZbn1t4R731zzRdDN2/pK7lRX - -## HostName -## -## Normally, BitlBee gets a hostname using getsockname(). If you have a nicer -## alias for your BitlBee daemon, you can set it here and BitlBee will identify -## itself with that name instead. -## -# HostName = localhost - -## MotdFile -## -## Specify an alternative MOTD (Message Of The Day) file. Default value depends -## on the --etcdir argument to configure. -## -# MotdFile = /etc/bitlbee/motd.txt - -## ConfigDir -## -## Specify an alternative directory to store all the per-user configuration -## files. (.nicks/.accounts) -## -ConfigDir = /var/lib/bitlbee - -## Ping settings -## -## BitlBee can send PING requests to the client to check whether it's still -## alive. This is not very useful on local servers, but it does make sense -## when most clients connect to the server over a real network interface. -## (Public servers) Pinging the client will make sure lost clients are -## detected and cleaned up sooner. -## -## PING requests are sent every PingInterval seconds. If no PONG reply has - -## been received for PingTimeOut seconds, BitlBee aborts the connection. -## -## To disable the pinging, set at least one of these to 0. -## -# PingInterval = 180 -# PingTimeOut = 300 - -## Using proxy servers for outgoing connections -## -## If you're running BitlBee on a host which is behind a restrictive firewall -## and a proxy server, you can tell BitlBee to use that proxy server here. -## The setting has to be a URL, formatted like one of these examples: -## -## (Obviously, the username and password are optional) -## -## Proxy = http://john:doe@proxy.localnet.com:8080 -## Proxy = socks4://socksproxy.localnet.com -## Proxy = socks5://socksproxy.localnet.com - - -[defaults] - -## Here you can override the defaults for some per-user settings. Users are -## still able to override your defaults, so this is not a way to restrict -## your users... - -## To enable private mode by default, for example: - -## private = 1 diff --git a/kubernetes/bitlbee-purple/deploy.sh b/kubernetes/bitlbee-purple/deploy.sh new file mode 100755 index 0000000..a9ee40a --- /dev/null +++ b/kubernetes/bitlbee-purple/deploy.sh @@ -0,0 +1,9 @@ +#!/usr/bin/env sh + +kubectl create configmap bitlbee-config-file --from-file=bitlbee.conf +kubectl apply -f ./bitlbee-data-volume.yaml +kubectl apply -f ./bitlbee-deployment.yaml + +# kubectl delete pod mongodb +# kubectl delete pvc +# kubectl delete pv diff --git a/kubernetes/debug/debug-deployment.yaml b/kubernetes/debug/debug-deployment.yaml new file mode 100644 index 0000000..a11d80d --- /dev/null +++ b/kubernetes/debug/debug-deployment.yaml @@ -0,0 +1,46 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: debug + labels: + app: debug +spec: + replicas: 1 + selector: + matchLabels: + app: debug + template: + metadata: + labels: + app: debug + spec: + containers: + - name: debug + image: 192.168.1.103:5000/bullseye-slim + imagePullPolicy: IfNotPresent + command: + - tail + - -f + - /dev/null + env: + - name: HTTP_PROXY + value: socks5://192.168.1.103:9995 + - name: HTTPS_PROXY + value: socks5://192.168.1.103:9995 + - name: NO_PROXY + value: localhost, 127.0.0.1, 10.0.0.0/24 +--- +apiVersion: v1 +kind: Service +metadata: + name: debug-service +spec: + selector: + app: debug + type: LoadBalancer + ports: + - protocol: TCP + name: "7777" + port: 27777 + targetPort: 27777 + nodePort: 30777 -- cgit v1.2.3