Files
openlan/docker/kubernetes.yml
Daniel Ding 84c638ffe8
Some checks are pending
Coverage CI / build (push) Waiting to run
CodeQL / Analyze (go) (push) Waiting to run
Ubuntu CI / build (push) Waiting to run
docs: update kubernetes
2025-04-20 14:39:33 +08:00

174 lines
3.4 KiB
YAML

apiVersion: v1
kind: Namespace
metadata:
name: openlan
---
apiVersion: v1
kind: ConfigMap
metadata:
name: network-etc
namespace: openlan
data:
private.json: |-
{
"name": "private",
"provider": "openlan",
"bridge": {
"address": "172.32.99.20/24"
},
"routes": [
{
"prefix": "172.16.0.0/16"
}
],
"links": [
{
"connection": "your.public.addres",
"password": "abcdefghijkl",
"username": "admin",
"crypt": {
"secret": "53a843402fa9"
}
}
]
}
ipsec.json: |-
{
"name": "ipsec",
"provider": "esp"
}
---
apiVersion: v1
kind: ConfigMap
metadata:
name: switch-etc
namespace: openlan
data:
switch.json: |-
{
"alias": "your-switch-alias-name",
"crypt": {
"secret": "53a843402fa9"
}
}
---
apiVersion: v1
kind: ConfigMap
metadata:
name: proxy-etc
namespace: openlan
data:
proxy.json: |-
"tcp": [
{
"listen": "0.0.0.0:80",
"target": [
"192.168.100.80:80",
"192.168.100.81:80"
]
}
]
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: openlan
namespace: openlan
spec:
selector:
matchLabels:
name: openlan
template:
metadata:
labels:
name: openlan
spec:
containers:
- name: "openlan-switch"
image: "luscis/openlan:23.04.02"
imagePullPolicy: IfNotPresent
command:
- /var/openlan/script/switch.sh
- start
env:
- name: ESPUDP
value: "4500"
securityContext:
privileged: true
ports:
- containerPort: 10000
- containerPort: 10002
resources:
limits:
cpu: 1000m
memory: 512Mi
requests:
cpu: 1000m
memory: 512Mi
volumeMounts:
- name: openlan-etc
mountPath: /etc/openlan
- name: switch-etc
mountPath: /etc/openlan/switch/switch.json
subPath: switch.json
- name: network-etc
mountPath: /etc/openlan/switch/network
- name: "openlan-proxy"
image: "luscis/openlan:23.04.02"
imagePullPolicy: IfNotPresent
command:
- /usr/bin/openlan-proxy
- -conf
- /etc/openlan/proxy.json
- -log:file
- /dev/null
volumeMounts:
- name: proxy-etc
mountPath: /etc/openlan/proxy.json
subPath: proxy.json
volumes:
- name: openlan-etc
hostPath:
path: /opt/openlan/etc/openlan
- name: network-etc
configMap:
defaultMode: 0777
name: network-etc
- name: switch-etc
configMap:
defaultMode: 0777
name: switch-etc
- name: proxy-etc
configMap:
defaultMode: 0777
name: proxy-etc
---
# apiVersion: v1
# kind: Service
# metadata:
# name: openlan
# namespace: openlan
# spec:
# type: LoadBalancer
# ports:
# - name: openlan-web
# port: 10000
# protocol: TCP
# targetPort: 10000
# - name: openlan-tun
# port: 10002
# protocol: TCP
# targetPort: 10002
# selector:
# name: openlan