Skip to content

Commit

Permalink
Add: socks-proxy in infra (#7718)
Browse files Browse the repository at this point in the history
* Add: socks-proxy in infra

* Add: internal loadbalancer annotation
  • Loading branch information
Fraggle authored Sep 26, 2024
1 parent 6e56717 commit 16666af
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 0 deletions.
3 changes: 3 additions & 0 deletions k8s/apply_infra.sh
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ kubectl apply -f "$(dirname "$0")/configmaps/core-sqlite-worker-configmap.yaml"
kubectl apply -f "$(dirname "$0")/configmaps/oauth-configmap.yaml"
kubectl apply -f "$(dirname "$0")/configmaps/prodbox-configmap.yaml"
kubectl apply -f "$(dirname "$0")/configmaps/viz-configmap.yaml"
kubectl apply -f "$(dirname "$0")/configmaps/socks-proxy-configmap.yaml"

echo "-----------------------------------"
echo "Applying backend configs"
Expand Down Expand Up @@ -130,6 +131,7 @@ apply_deployment core-sqlite-worker-deployment
apply_deployment oauth-deployment
apply_deployment prodbox-deployment
apply_deployment viz-deployment
apply_deployment socks-proxy-deployment

echo "-----------------------------------"
echo "Applying HPAs"
Expand All @@ -152,6 +154,7 @@ kubectl apply -f "$(dirname "$0")/services/core-service.yaml"
kubectl apply -f "$(dirname "$0")/services/core-sqlite-worker-headless-service.yaml"
kubectl apply -f "$(dirname "$0")/services/oauth-service.yaml"
kubectl apply -f "$(dirname "$0")/services/viz-service.yaml"
kubectl apply -f "$(dirname "$0")/services/socks-proxy-service.yaml"


echo "-----------------------------------"
Expand Down
9 changes: 9 additions & 0 deletions k8s/configmaps/socks-proxy-configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: socks-proxy-config
data:
DD_ENV: "prod"
DD_SERVICE: "socks-proxy"
DD_LOGS_INJECTION: "true"
DD_RUNTIME_METRICS_ENABLED: "true"
40 changes: 40 additions & 0 deletions k8s/deployments/socks-proxy-deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: socks-proxy-deployment
spec:
replicas: 1
selector:
matchLabels:
app: socks-proxy
template:
metadata:
labels:
app: socks-proxy
name: socks-proxy-pod
admission.datadoghq.com/enabled: "true"
annotations:
ad.datadoghq.com/web.logs: '[{"source": "sock5-proxy","service": "sock5-proxy","tags": ["env:prod"]}]'
spec:
containers:
- name: socks-proxy
image: vimagick/dante
ports:
- containerPort: 1080

envFrom:
- configMapRef:
name: socks-proxy-config
env:
- name: DD_AGENT_HOST
valueFrom:
fieldRef:
fieldPath: status.hostIP

resources:
requests:
cpu: 1000m
memory: 1Gi
limits:
cpu: 1000m
memory: 1Gi
14 changes: 14 additions & 0 deletions k8s/services/socks-proxy-service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
apiVersion: v1
kind: Service
metadata:
name: socks-proxy-service
annotations:
kubernetes.io/ingress.global-static-ip-name: "socks-proxy-static-ip"
networking.gke.io/load-balancer-type: "Internal"
spec:
type: LoadBalancer
ports:
- port: 1080
targetPort: 1080
selector:
app: socks-proxy

0 comments on commit 16666af

Please sign in to comment.