diff --git a/k8s/apply_infra.sh b/k8s/apply_infra.sh index e5d9b9b557ea..0ff2a2409a53 100755 --- a/k8s/apply_infra.sh +++ b/k8s/apply_infra.sh @@ -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" @@ -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" @@ -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 "-----------------------------------" diff --git a/k8s/configmaps/socks-proxy-configmap.yaml b/k8s/configmaps/socks-proxy-configmap.yaml new file mode 100644 index 000000000000..618d36ed91ce --- /dev/null +++ b/k8s/configmaps/socks-proxy-configmap.yaml @@ -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" diff --git a/k8s/deployments/socks-proxy-deployment.yaml b/k8s/deployments/socks-proxy-deployment.yaml new file mode 100644 index 000000000000..ea0d079e8888 --- /dev/null +++ b/k8s/deployments/socks-proxy-deployment.yaml @@ -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 \ No newline at end of file diff --git a/k8s/services/socks-proxy-service.yaml b/k8s/services/socks-proxy-service.yaml new file mode 100644 index 000000000000..85518ea69bfe --- /dev/null +++ b/k8s/services/socks-proxy-service.yaml @@ -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