Initialisation depot
This commit is contained in:
18
RdpBroker/web-gateway/chart/rdp-web-gateway/Chart.yaml
Normal file
18
RdpBroker/web-gateway/chart/rdp-web-gateway/Chart.yaml
Normal file
@@ -0,0 +1,18 @@
|
||||
apiVersion: v2
|
||||
name: rdp-web-gateway
|
||||
description: HTML5 WebSocket-based RDP Web Gateway
|
||||
type: application
|
||||
version: 1.0.0
|
||||
appVersion: "1.0.0"
|
||||
keywords:
|
||||
- rdp
|
||||
- websocket
|
||||
- html5
|
||||
- gateway
|
||||
- web
|
||||
dependencies: []
|
||||
maintainers:
|
||||
- name: RdpBroker Team
|
||||
home: https://github.com/yourusername/rdpbroker
|
||||
sources:
|
||||
- https://github.com/yourusername/rdpbroker
|
||||
@@ -0,0 +1,108 @@
|
||||
# Raspberry Pi 4 optimized values for K3s cluster
|
||||
# Deploy with: helm install rdp-web-gateway ./chart/rdp-web-gateway -f examples/rpi4-k3s.yaml
|
||||
|
||||
# Use ClusterIP with Traefik (common on K3s)
|
||||
service:
|
||||
type: ClusterIP
|
||||
port: 80
|
||||
targetPort: 8080
|
||||
|
||||
# Traefik IngressRoute (K3s includes Traefik by default)
|
||||
traefik:
|
||||
enabled: true
|
||||
host: rdp.yourdomain.com
|
||||
entryPoints:
|
||||
- websecure
|
||||
tls:
|
||||
enabled: true
|
||||
certResolver: letsencrypt
|
||||
|
||||
# Reduced resources for Raspberry Pi 4
|
||||
resources:
|
||||
limits:
|
||||
cpu: 500m # 0.5 CPU core
|
||||
memory: 512Mi # 512MB RAM
|
||||
requests:
|
||||
cpu: 100m # 0.1 CPU core minimum
|
||||
memory: 128Mi # 128MB RAM minimum
|
||||
|
||||
# Conservative autoscaling for RPi cluster
|
||||
autoscaling:
|
||||
enabled: true
|
||||
minReplicas: 1 # Start with 1 pod
|
||||
maxReplicas: 3 # Max 3 pods (adjust based on cluster size)
|
||||
targetCPUUtilizationPercentage: 70
|
||||
targetMemoryUtilizationPercentage: 80
|
||||
|
||||
# Start with single replica
|
||||
replicaCount: 1
|
||||
|
||||
# RDP Broker connection (internal ClusterIP)
|
||||
config:
|
||||
rdpBroker:
|
||||
host: "rdpbroker"
|
||||
port: 3389
|
||||
server:
|
||||
port: 8080
|
||||
|
||||
# Spread pods across nodes if you have multiple RPi
|
||||
affinity:
|
||||
podAntiAffinity:
|
||||
preferredDuringSchedulingIgnoredDuringExecution:
|
||||
- weight: 100
|
||||
podAffinityTerm:
|
||||
labelSelector:
|
||||
matchExpressions:
|
||||
- key: app.kubernetes.io/name
|
||||
operator: In
|
||||
values:
|
||||
- rdp-web-gateway
|
||||
topologyKey: kubernetes.io/hostname
|
||||
|
||||
# Optimize for ARM64
|
||||
podAnnotations:
|
||||
cluster.autoscaler.kubernetes.io/safe-to-evict: "true"
|
||||
|
||||
# Security context
|
||||
securityContext:
|
||||
capabilities:
|
||||
drop:
|
||||
- ALL
|
||||
readOnlyRootFilesystem: false
|
||||
runAsNonRoot: true
|
||||
runAsUser: 1001
|
||||
allowPrivilegeEscalation: false
|
||||
|
||||
podSecurityContext:
|
||||
fsGroup: 1001
|
||||
runAsNonRoot: true
|
||||
runAsUser: 1001
|
||||
|
||||
# Health checks with longer delays for slower RPi startup
|
||||
livenessProbe:
|
||||
httpGet:
|
||||
path: /health
|
||||
port: http
|
||||
initialDelaySeconds: 45 # Increased from 30
|
||||
periodSeconds: 15 # Increased from 10
|
||||
timeoutSeconds: 5
|
||||
failureThreshold: 3
|
||||
|
||||
readinessProbe:
|
||||
httpGet:
|
||||
path: /health
|
||||
port: http
|
||||
initialDelaySeconds: 15 # Increased from 10
|
||||
periodSeconds: 10 # Increased from 5
|
||||
timeoutSeconds: 3
|
||||
failureThreshold: 3
|
||||
|
||||
# Optional: Node selector for ARM64 nodes only
|
||||
# nodeSelector:
|
||||
# kubernetes.io/arch: arm64
|
||||
|
||||
# Optional: Tolerate RPi-specific taints
|
||||
# tolerations:
|
||||
# - key: "node.kubernetes.io/arm64"
|
||||
# operator: "Exists"
|
||||
# effect: "NoSchedule"
|
||||
@@ -0,0 +1,71 @@
|
||||
# Example: Traefik with multiple middlewares and custom cert
|
||||
# Deploy with: helm install rdp-web-gateway ./chart/rdp-web-gateway -f examples/traefik-advanced.yaml
|
||||
|
||||
service:
|
||||
type: ClusterIP
|
||||
port: 80
|
||||
targetPort: 8080
|
||||
|
||||
traefik:
|
||||
enabled: true
|
||||
host: rdp.yourdomain.com
|
||||
annotations:
|
||||
# Optional annotations
|
||||
kubernetes.io/ingress.class: traefik
|
||||
entryPoints:
|
||||
- web # HTTP (will redirect to HTTPS)
|
||||
- websecure # HTTPS
|
||||
middlewares:
|
||||
# Redirect HTTP to HTTPS
|
||||
- name: redirect-to-https
|
||||
# Add security headers
|
||||
- name: security-headers
|
||||
# Rate limiting
|
||||
- name: rate-limit
|
||||
tls:
|
||||
enabled: true
|
||||
certResolver: letsencrypt
|
||||
# Specify multiple domains/SANs
|
||||
domains:
|
||||
- main: rdp.yourdomain.com
|
||||
sans:
|
||||
- www.rdp.yourdomain.com
|
||||
- rdp-gateway.yourdomain.com
|
||||
|
||||
config:
|
||||
rdpBroker:
|
||||
host: "rdpbroker"
|
||||
port: 3389
|
||||
server:
|
||||
port: 8080
|
||||
|
||||
# Production resource limits
|
||||
resources:
|
||||
limits:
|
||||
cpu: 2000m
|
||||
memory: 2Gi
|
||||
requests:
|
||||
cpu: 500m
|
||||
memory: 512Mi
|
||||
|
||||
# Autoscaling for production
|
||||
autoscaling:
|
||||
enabled: true
|
||||
minReplicas: 3
|
||||
maxReplicas: 20
|
||||
targetCPUUtilizationPercentage: 60
|
||||
targetMemoryUtilizationPercentage: 70
|
||||
|
||||
# Pod anti-affinity for high availability
|
||||
affinity:
|
||||
podAntiAffinity:
|
||||
preferredDuringSchedulingIgnoredDuringExecution:
|
||||
- weight: 100
|
||||
podAffinityTerm:
|
||||
labelSelector:
|
||||
matchExpressions:
|
||||
- key: app.kubernetes.io/name
|
||||
operator: In
|
||||
values:
|
||||
- rdp-web-gateway
|
||||
topologyKey: kubernetes.io/hostname
|
||||
@@ -0,0 +1,63 @@
|
||||
# Example: Traefik with Let's Encrypt
|
||||
# Deploy with: helm install rdp-web-gateway ./chart/rdp-web-gateway -f examples/traefik-letsencrypt.yaml
|
||||
|
||||
# Disable LoadBalancer, use IngressRoute instead
|
||||
service:
|
||||
type: ClusterIP
|
||||
port: 80
|
||||
targetPort: 8080
|
||||
|
||||
# Enable Traefik IngressRoute
|
||||
traefik:
|
||||
enabled: true
|
||||
host: rdp.yourdomain.com
|
||||
entryPoints:
|
||||
- websecure # HTTPS entry point
|
||||
tls:
|
||||
enabled: true
|
||||
certResolver: letsencrypt # Must match your Traefik certResolver name
|
||||
# Optional: Add middlewares
|
||||
# middlewares:
|
||||
# - name: redirect-to-https
|
||||
# - name: rate-limit
|
||||
|
||||
# RDP Broker connection (internal ClusterIP)
|
||||
config:
|
||||
rdpBroker:
|
||||
host: "rdpbroker" # Kubernetes service name
|
||||
port: 3389
|
||||
server:
|
||||
port: 8080
|
||||
|
||||
# Recommended: Enable network policies for security
|
||||
networkPolicy:
|
||||
enabled: true
|
||||
policyTypes:
|
||||
- Ingress
|
||||
- Egress
|
||||
ingress:
|
||||
# Allow traffic from Traefik
|
||||
- from:
|
||||
- namespaceSelector:
|
||||
matchLabels:
|
||||
name: traefik # Adjust to your Traefik namespace
|
||||
ports:
|
||||
- protocol: TCP
|
||||
port: 8080
|
||||
egress:
|
||||
# Allow traffic to RdpBroker
|
||||
- to:
|
||||
- podSelector:
|
||||
matchLabels:
|
||||
app: rdpbroker
|
||||
ports:
|
||||
- protocol: TCP
|
||||
port: 3389
|
||||
# Allow DNS resolution
|
||||
- to:
|
||||
- namespaceSelector:
|
||||
matchLabels:
|
||||
name: kube-system
|
||||
ports:
|
||||
- protocol: UDP
|
||||
port: 53
|
||||
@@ -0,0 +1,71 @@
|
||||
# Recommended Traefik Middlewares for RDP Web Gateway
|
||||
# Apply these in your Traefik namespace or the same namespace as web-gateway
|
||||
|
||||
---
|
||||
# Redirect HTTP to HTTPS
|
||||
apiVersion: traefik.containo.us/v1alpha1
|
||||
kind: Middleware
|
||||
metadata:
|
||||
name: redirect-to-https
|
||||
spec:
|
||||
redirectScheme:
|
||||
scheme: https
|
||||
permanent: true
|
||||
|
||||
---
|
||||
# Security Headers
|
||||
apiVersion: traefik.containo.us/v1alpha1
|
||||
kind: Middleware
|
||||
metadata:
|
||||
name: security-headers
|
||||
spec:
|
||||
headers:
|
||||
browserXssFilter: true
|
||||
contentTypeNosniff: true
|
||||
forceSTSHeader: true
|
||||
frameDeny: true
|
||||
stsIncludeSubdomains: true
|
||||
stsPreload: true
|
||||
stsSeconds: 31536000
|
||||
customFrameOptionsValue: "SAMEORIGIN"
|
||||
customResponseHeaders:
|
||||
X-Forwarded-Proto: "https"
|
||||
# Allow WebSocket upgrade
|
||||
Connection: "upgrade"
|
||||
Upgrade: "$http_upgrade"
|
||||
|
||||
---
|
||||
# Rate Limiting (adjust as needed)
|
||||
apiVersion: traefik.containo.us/v1alpha1
|
||||
kind: Middleware
|
||||
metadata:
|
||||
name: rate-limit
|
||||
spec:
|
||||
rateLimit:
|
||||
average: 100
|
||||
burst: 50
|
||||
period: 1s
|
||||
|
||||
---
|
||||
# IP Whitelist (optional - restrict to specific IPs/ranges)
|
||||
apiVersion: traefik.containo.us/v1alpha1
|
||||
kind: Middleware
|
||||
metadata:
|
||||
name: ip-whitelist
|
||||
spec:
|
||||
ipWhiteList:
|
||||
sourceRange:
|
||||
- 192.168.1.0/24
|
||||
- 10.0.0.0/8
|
||||
# For use behind a proxy/load balancer
|
||||
ipStrategy:
|
||||
depth: 1
|
||||
|
||||
---
|
||||
# Compression
|
||||
apiVersion: traefik.containo.us/v1alpha1
|
||||
kind: Middleware
|
||||
metadata:
|
||||
name: compression
|
||||
spec:
|
||||
compress: {}
|
||||
@@ -0,0 +1,38 @@
|
||||
1. Get the application URL by running these commands:
|
||||
{{- if .Values.ingress.enabled }}
|
||||
{{- range $host := .Values.ingress.hosts }}
|
||||
{{- range .paths }}
|
||||
http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ .path }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- else if contains "NodePort" .Values.service.type }}
|
||||
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "rdp-web-gateway.fullname" . }})
|
||||
export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
|
||||
echo "RDP Web Gateway available at: http://$NODE_IP:$NODE_PORT"
|
||||
{{- else if contains "LoadBalancer" .Values.service.type }}
|
||||
NOTE: It may take a few minutes for the LoadBalancer IP to be available.
|
||||
You can watch the status by running:
|
||||
|
||||
kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "rdp-web-gateway.fullname" . }}
|
||||
|
||||
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "rdp-web-gateway.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}")
|
||||
echo "RDP Web Gateway available at: http://$SERVICE_IP:{{ .Values.service.port }}"
|
||||
echo "Open in your browser to access the web interface"
|
||||
{{- else if contains "ClusterIP" .Values.service.type }}
|
||||
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "rdp-web-gateway.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
|
||||
echo "Visit http://127.0.0.1:8080 to use the application"
|
||||
kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:{{ .Values.config.server.port }}
|
||||
{{- end }}
|
||||
|
||||
2. View logs:
|
||||
kubectl logs -f deployment/{{ include "rdp-web-gateway.fullname" . }} -n {{ .Release.Namespace }}
|
||||
|
||||
3. Check health:
|
||||
kubectl exec -it deployment/{{ include "rdp-web-gateway.fullname" . }} -n {{ .Release.Namespace }} -- curl http://localhost:{{ .Values.config.server.port }}/health
|
||||
|
||||
Configuration:
|
||||
- RDP Broker: {{ .Values.config.rdpBroker.host }}:{{ .Values.config.rdpBroker.port }}
|
||||
- Server Port: {{ .Values.config.server.port }}
|
||||
- Replicas: {{ if .Values.autoscaling.enabled }}{{ .Values.autoscaling.minReplicas }}-{{ .Values.autoscaling.maxReplicas }} (autoscaling){{ else }}{{ .Values.replicaCount }}{{ end }}
|
||||
|
||||
Note: Authentication is handled by RdpBroker. Logs are sent to stdout for Kubernetes.
|
||||
@@ -0,0 +1,60 @@
|
||||
{{/*
|
||||
Expand the name of the chart.
|
||||
*/}}
|
||||
{{- define "rdp-web-gateway.name" -}}
|
||||
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Create a default fully qualified app name.
|
||||
*/}}
|
||||
{{- define "rdp-web-gateway.fullname" -}}
|
||||
{{- if .Values.fullnameOverride }}
|
||||
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
|
||||
{{- else }}
|
||||
{{- $name := default .Chart.Name .Values.nameOverride }}
|
||||
{{- if contains $name .Release.Name }}
|
||||
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
|
||||
{{- else }}
|
||||
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Create chart name and version as used by the chart label.
|
||||
*/}}
|
||||
{{- define "rdp-web-gateway.chart" -}}
|
||||
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Common labels
|
||||
*/}}
|
||||
{{- define "rdp-web-gateway.labels" -}}
|
||||
helm.sh/chart: {{ include "rdp-web-gateway.chart" . }}
|
||||
{{ include "rdp-web-gateway.selectorLabels" . }}
|
||||
{{- if .Chart.AppVersion }}
|
||||
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
|
||||
{{- end }}
|
||||
app.kubernetes.io/managed-by: {{ .Release.Service }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Selector labels
|
||||
*/}}
|
||||
{{- define "rdp-web-gateway.selectorLabels" -}}
|
||||
app.kubernetes.io/name: {{ include "rdp-web-gateway.name" . }}
|
||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Create the name of the service account to use
|
||||
*/}}
|
||||
{{- define "rdp-web-gateway.serviceAccountName" -}}
|
||||
{{- if .Values.serviceAccount.create }}
|
||||
{{- default (include "rdp-web-gateway.fullname" .) .Values.serviceAccount.name }}
|
||||
{{- else }}
|
||||
{{- default "default" .Values.serviceAccount.name }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,17 @@
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: {{ include "rdp-web-gateway.fullname" . }}-config
|
||||
labels:
|
||||
{{- include "rdp-web-gateway.labels" . | nindent 4 }}
|
||||
data:
|
||||
config.json: |
|
||||
{
|
||||
"rdpBroker": {
|
||||
"host": "{{ .Values.config.rdpBroker.host }}",
|
||||
"port": {{ .Values.config.rdpBroker.port }}
|
||||
},
|
||||
"server": {
|
||||
"port": {{ .Values.config.server.port }}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: {{ include "rdp-web-gateway.fullname" . }}
|
||||
labels:
|
||||
{{- include "rdp-web-gateway.labels" . | nindent 4 }}
|
||||
spec:
|
||||
{{- if not .Values.autoscaling.enabled }}
|
||||
replicas: {{ .Values.replicaCount }}
|
||||
{{- end }}
|
||||
selector:
|
||||
matchLabels:
|
||||
{{- include "rdp-web-gateway.selectorLabels" . | nindent 6 }}
|
||||
template:
|
||||
metadata:
|
||||
annotations:
|
||||
checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
|
||||
{{- with .Values.podAnnotations }}
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
labels:
|
||||
{{- include "rdp-web-gateway.selectorLabels" . | nindent 8 }}
|
||||
spec:
|
||||
{{- with .Values.imagePullSecrets }}
|
||||
imagePullSecrets:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
serviceAccountName: {{ include "rdp-web-gateway.serviceAccountName" . }}
|
||||
securityContext:
|
||||
{{- toYaml .Values.podSecurityContext | nindent 8 }}
|
||||
containers:
|
||||
- name: {{ .Chart.Name }}
|
||||
securityContext:
|
||||
{{- toYaml .Values.securityContext | nindent 12 }}
|
||||
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
|
||||
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
||||
env:
|
||||
- name: PORT
|
||||
value: {{ .Values.config.server.port | quote }}
|
||||
- name: RDP_BROKER_HOST
|
||||
value: {{ .Values.config.rdpBroker.host | quote }}
|
||||
- name: RDP_BROKER_PORT
|
||||
value: {{ .Values.config.rdpBroker.port | quote }}
|
||||
{{- if .Values.config.rdpTargets }}
|
||||
- name: RDP_TARGETS
|
||||
value: {{ .Values.config.rdpTargets | toJson | quote }}
|
||||
{{- end }}
|
||||
- name: NODE_ENV
|
||||
value: "production"
|
||||
{{- range .Values.env }}
|
||||
- name: {{ .name }}
|
||||
value: {{ .value | quote }}
|
||||
{{- end }}
|
||||
ports:
|
||||
- name: http
|
||||
containerPort: {{ .Values.config.server.port }}
|
||||
protocol: TCP
|
||||
livenessProbe:
|
||||
{{- toYaml .Values.livenessProbe | nindent 12 }}
|
||||
readinessProbe:
|
||||
{{- toYaml .Values.readinessProbe | nindent 12 }}
|
||||
resources:
|
||||
{{- toYaml .Values.resources | nindent 12 }}
|
||||
{{- with .Values.nodeSelector }}
|
||||
nodeSelector:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- with .Values.affinity }}
|
||||
affinity:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- with .Values.tolerations }}
|
||||
tolerations:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,32 @@
|
||||
{{- if .Values.autoscaling.enabled }}
|
||||
apiVersion: autoscaling/v2
|
||||
kind: HorizontalPodAutoscaler
|
||||
metadata:
|
||||
name: {{ include "rdp-web-gateway.fullname" . }}
|
||||
labels:
|
||||
{{- include "rdp-web-gateway.labels" . | nindent 4 }}
|
||||
spec:
|
||||
scaleTargetRef:
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
name: {{ include "rdp-web-gateway.fullname" . }}
|
||||
minReplicas: {{ .Values.autoscaling.minReplicas }}
|
||||
maxReplicas: {{ .Values.autoscaling.maxReplicas }}
|
||||
metrics:
|
||||
{{- if .Values.autoscaling.targetCPUUtilizationPercentage }}
|
||||
- type: Resource
|
||||
resource:
|
||||
name: cpu
|
||||
target:
|
||||
type: Utilization
|
||||
averageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }}
|
||||
{{- end }}
|
||||
{{- if .Values.autoscaling.targetMemoryUtilizationPercentage }}
|
||||
- type: Resource
|
||||
resource:
|
||||
name: memory
|
||||
target:
|
||||
type: Utilization
|
||||
averageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,41 @@
|
||||
{{- if .Values.ingress.enabled -}}
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: Ingress
|
||||
metadata:
|
||||
name: {{ include "rdp-web-gateway.fullname" . }}
|
||||
labels:
|
||||
{{- include "rdp-web-gateway.labels" . | nindent 4 }}
|
||||
{{- with .Values.ingress.annotations }}
|
||||
annotations:
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
{{- if .Values.ingress.className }}
|
||||
ingressClassName: {{ .Values.ingress.className }}
|
||||
{{- end }}
|
||||
{{- if .Values.ingress.tls }}
|
||||
tls:
|
||||
{{- range .Values.ingress.tls }}
|
||||
- hosts:
|
||||
{{- range .hosts }}
|
||||
- {{ . | quote }}
|
||||
{{- end }}
|
||||
secretName: {{ .secretName }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
rules:
|
||||
{{- range .Values.ingress.hosts }}
|
||||
- host: {{ .host | quote }}
|
||||
http:
|
||||
paths:
|
||||
{{- range .paths }}
|
||||
- path: {{ .path }}
|
||||
pathType: {{ .pathType }}
|
||||
backend:
|
||||
service:
|
||||
name: {{ include "rdp-web-gateway.fullname" $ }}
|
||||
port:
|
||||
number: {{ $.Values.service.port }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,44 @@
|
||||
{{- if .Values.traefik.enabled -}}
|
||||
apiVersion: traefik.containo.us/v1alpha1
|
||||
kind: IngressRoute
|
||||
metadata:
|
||||
name: {{ include "rdp-web-gateway.fullname" . }}
|
||||
labels:
|
||||
{{- include "rdp-web-gateway.labels" . | nindent 4 }}
|
||||
{{- with .Values.traefik.annotations }}
|
||||
annotations:
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
entryPoints:
|
||||
{{- toYaml .Values.traefik.entryPoints | nindent 4 }}
|
||||
routes:
|
||||
- match: Host(`{{ .Values.traefik.host }}`)
|
||||
kind: Rule
|
||||
services:
|
||||
- name: {{ include "rdp-web-gateway.fullname" . }}
|
||||
port: {{ .Values.service.port }}
|
||||
{{- if .Values.traefik.middlewares }}
|
||||
middlewares:
|
||||
{{- toYaml .Values.traefik.middlewares | nindent 6 }}
|
||||
{{- end }}
|
||||
{{- if .Values.traefik.tls.enabled }}
|
||||
tls:
|
||||
{{- if .Values.traefik.tls.certResolver }}
|
||||
certResolver: {{ .Values.traefik.tls.certResolver }}
|
||||
{{- end }}
|
||||
{{- if .Values.traefik.tls.secretName }}
|
||||
secretName: {{ .Values.traefik.tls.secretName }}
|
||||
{{- end }}
|
||||
{{- if .Values.traefik.tls.domains }}
|
||||
domains:
|
||||
{{- range .Values.traefik.tls.domains }}
|
||||
- main: {{ .main }}
|
||||
{{- if .sans }}
|
||||
sans:
|
||||
{{- toYaml .sans | nindent 10 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,22 @@
|
||||
{{- if .Values.networkPolicy.enabled }}
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: NetworkPolicy
|
||||
metadata:
|
||||
name: {{ include "rdp-web-gateway.fullname" . }}
|
||||
labels:
|
||||
{{- include "rdp-web-gateway.labels" . | nindent 4 }}
|
||||
spec:
|
||||
podSelector:
|
||||
matchLabels:
|
||||
{{- include "rdp-web-gateway.selectorLabels" . | nindent 6 }}
|
||||
policyTypes:
|
||||
{{- toYaml .Values.networkPolicy.policyTypes | nindent 4 }}
|
||||
{{- with .Values.networkPolicy.ingress }}
|
||||
ingress:
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- with .Values.networkPolicy.egress }}
|
||||
egress:
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,19 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: {{ include "rdp-web-gateway.fullname" . }}
|
||||
labels:
|
||||
{{- include "rdp-web-gateway.labels" . | nindent 4 }}
|
||||
{{- with .Values.service.annotations }}
|
||||
annotations:
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
type: {{ .Values.service.type }}
|
||||
ports:
|
||||
- port: {{ .Values.service.port }}
|
||||
targetPort: http
|
||||
protocol: TCP
|
||||
name: http
|
||||
selector:
|
||||
{{- include "rdp-web-gateway.selectorLabels" . | nindent 4 }}
|
||||
@@ -0,0 +1,10 @@
|
||||
apiVersion: v1
|
||||
kind: ServiceAccount
|
||||
metadata:
|
||||
name: {{ include "rdp-web-gateway.serviceAccountName" . }}
|
||||
labels:
|
||||
{{- include "rdp-web-gateway.labels" . | nindent 4 }}
|
||||
{{- with .Values.serviceAccount.annotations }}
|
||||
annotations:
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
171
RdpBroker/web-gateway/chart/rdp-web-gateway/values.yaml
Normal file
171
RdpBroker/web-gateway/chart/rdp-web-gateway/values.yaml
Normal file
@@ -0,0 +1,171 @@
|
||||
# Default values for rdp-web-gateway
|
||||
|
||||
replicaCount: 2
|
||||
|
||||
image:
|
||||
repository: rdp-web-gateway
|
||||
pullPolicy: IfNotPresent
|
||||
tag: "latest"
|
||||
|
||||
imagePullSecrets: []
|
||||
nameOverride: ""
|
||||
fullnameOverride: ""
|
||||
|
||||
serviceAccount:
|
||||
create: true
|
||||
annotations: {}
|
||||
name: ""
|
||||
|
||||
podAnnotations: {}
|
||||
|
||||
podSecurityContext:
|
||||
fsGroup: 1001
|
||||
|
||||
securityContext:
|
||||
capabilities:
|
||||
drop:
|
||||
- ALL
|
||||
readOnlyRootFilesystem: false
|
||||
runAsNonRoot: true
|
||||
runAsUser: 1001
|
||||
|
||||
service:
|
||||
type: LoadBalancer
|
||||
port: 80
|
||||
targetPort: 8080
|
||||
annotations: {}
|
||||
|
||||
ingress:
|
||||
enabled: false
|
||||
className: ""
|
||||
annotations: {}
|
||||
# kubernetes.io/ingress.class: nginx
|
||||
# cert-manager.io/cluster-issuer: letsencrypt-prod
|
||||
hosts:
|
||||
- host: rdp.example.com
|
||||
paths:
|
||||
- path: /
|
||||
pathType: Prefix
|
||||
tls: []
|
||||
# - secretName: rdp-tls
|
||||
# hosts:
|
||||
# - rdp.example.com
|
||||
|
||||
# Traefik IngressRoute configuration (alternative to standard Ingress)
|
||||
traefik:
|
||||
enabled: false
|
||||
annotations: {}
|
||||
# Host for the IngressRoute
|
||||
host: rdp.example.com
|
||||
# Traefik entryPoints
|
||||
entryPoints:
|
||||
- websecure
|
||||
# Optional middlewares
|
||||
middlewares: []
|
||||
# - name: redirect-to-https
|
||||
# - name: rate-limit
|
||||
# TLS configuration
|
||||
tls:
|
||||
enabled: true
|
||||
# Use Let's Encrypt cert resolver
|
||||
certResolver: letsencrypt
|
||||
# Or use existing secret
|
||||
secretName: ""
|
||||
# Optional: Specify domains
|
||||
domains: []
|
||||
# - main: rdp.example.com
|
||||
# sans:
|
||||
# - www.rdp.example.com
|
||||
|
||||
resources:
|
||||
limits:
|
||||
cpu: 1000m
|
||||
memory: 1Gi
|
||||
requests:
|
||||
cpu: 200m
|
||||
memory: 256Mi
|
||||
|
||||
autoscaling:
|
||||
enabled: true
|
||||
minReplicas: 2
|
||||
maxReplicas: 10
|
||||
targetCPUUtilizationPercentage: 70
|
||||
targetMemoryUtilizationPercentage: 80
|
||||
|
||||
nodeSelector: {}
|
||||
|
||||
tolerations: []
|
||||
|
||||
affinity: {}
|
||||
|
||||
# Application configuration
|
||||
config:
|
||||
# RDP Broker connection
|
||||
rdpBroker:
|
||||
host: "rdpbroker"
|
||||
port: 3389
|
||||
|
||||
# Server configuration
|
||||
server:
|
||||
port: 8080
|
||||
|
||||
# Optional: Pre-configure RDP targets
|
||||
# If not set, targets will be managed by RdpBroker
|
||||
# Format: JSON array of target objects
|
||||
rdpTargets: null
|
||||
# Example:
|
||||
# - name: "Windows Server 2022"
|
||||
# host: "ws2022.example.com"
|
||||
# port: 3389
|
||||
# description: "Production Windows Server"
|
||||
# - name: "Development Server"
|
||||
# host: "dev.example.com"
|
||||
# port: 3389
|
||||
# description: "Development environment"
|
||||
|
||||
# Environment variables
|
||||
env: []
|
||||
# - name: CUSTOM_VAR
|
||||
# value: "value"
|
||||
|
||||
# Liveness and readiness probes
|
||||
livenessProbe:
|
||||
httpGet:
|
||||
path: /health
|
||||
port: http
|
||||
initialDelaySeconds: 30
|
||||
periodSeconds: 10
|
||||
timeoutSeconds: 5
|
||||
failureThreshold: 3
|
||||
|
||||
readinessProbe:
|
||||
httpGet:
|
||||
path: /health
|
||||
port: http
|
||||
initialDelaySeconds: 10
|
||||
periodSeconds: 5
|
||||
timeoutSeconds: 3
|
||||
failureThreshold: 3
|
||||
|
||||
# Network Policy
|
||||
networkPolicy:
|
||||
enabled: false
|
||||
policyTypes:
|
||||
- Ingress
|
||||
- Egress
|
||||
ingress:
|
||||
- from:
|
||||
- namespaceSelector:
|
||||
matchLabels:
|
||||
name: default
|
||||
ports:
|
||||
- protocol: TCP
|
||||
port: 8080
|
||||
egress:
|
||||
- to:
|
||||
- podSelector:
|
||||
matchLabels:
|
||||
app: rdpbroker
|
||||
ports:
|
||||
- protocol: TCP
|
||||
port: 3389
|
||||
Reference in New Issue
Block a user