Deploy pangolin-kube-controller for Pangolin access policies
Add pangolin-kube-controller deployment to enable Pangolin-based access policies for Kubernetes ingress resources. Controller configuration: - Image: ghcr.io/fosrl/pangolin-kube-controller:0.1.0-alpha.1 - API endpoint: https://pangolin.basicstack.de/api/v1/traefik-config - Target namespace: pangolin - Polling interval: 15s - Leader election: disabled (single replica) Includes: - ServiceAccount for controller pod - ClusterRole with required RBAC permissions for Traefik CRDs - Deployment with proper security context and resource limits - Service for metrics endpoint (:9090) Related: DEV-437 Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
parent
954853cf37
commit
d5618fb6c8
4 changed files with 193 additions and 0 deletions
103
apps/pangolin/controller/controller-deployment.yaml
Normal file
103
apps/pangolin/controller/controller-deployment.yaml
Normal file
|
|
@ -0,0 +1,103 @@
|
|||
---
|
||||
# Pangolin Kube Controller Deployment
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: pangolin-kube-controller
|
||||
namespace: pangolin
|
||||
labels:
|
||||
app.kubernetes.io/name: pangolin-kube-controller
|
||||
app.kubernetes.io/component: controller
|
||||
app.kubernetes.io/part-of: pangolin
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app.kubernetes.io/name: pangolin-kube-controller
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app.kubernetes.io/name: pangolin-kube-controller
|
||||
app.kubernetes.io/component: controller
|
||||
app.kubernetes.io/part-of: pangolin
|
||||
spec:
|
||||
serviceAccountName: pangolin-kube-controller
|
||||
securityContext:
|
||||
runAsNonRoot: true
|
||||
runAsUser: 65532
|
||||
fsGroup: 65532
|
||||
seccompProfile:
|
||||
type: RuntimeDefault
|
||||
containers:
|
||||
- name: controller
|
||||
image: ghcr.io/fosrl/pangolin-kube-controller:0.1.0-alpha.1
|
||||
imagePullPolicy: IfNotPresent
|
||||
securityContext:
|
||||
allowPrivilegeEscalation: false
|
||||
readOnlyRootFilesystem: true
|
||||
runAsNonRoot: true
|
||||
runAsUser: 65532
|
||||
capabilities:
|
||||
drop:
|
||||
- ALL
|
||||
env:
|
||||
# Pangolin API Configuration
|
||||
- name: CONFIG_ENDPOINT
|
||||
value: "https://pangolin.basicstack.de/api/v1/traefik-config"
|
||||
- name: CONFIG_AUTH_HEADER
|
||||
value: "Bearer 5qid06u9j325kpk.ywd3bpsx34dtxyczgatyxuoxkzwhie7d72k6v4hw"
|
||||
|
||||
# Target namespace for Traefik resources
|
||||
- name: TARGET_NAMESPACE
|
||||
value: "pangolin"
|
||||
|
||||
# Metrics server configuration
|
||||
- name: METRICS_ADDR
|
||||
value: ":9090"
|
||||
|
||||
# Polling interval
|
||||
- name: POLL_INTERVAL
|
||||
value: "15s"
|
||||
|
||||
# Leader election (disabled for single replica)
|
||||
- name: ENABLE_LEADER_ELECTION
|
||||
value: "false"
|
||||
|
||||
# Traefik ingress class
|
||||
- name: INGRESS_CLASS
|
||||
value: "traefik"
|
||||
|
||||
# Logging configuration
|
||||
- name: LOG_TRAEFIK_CONFIG
|
||||
value: "false"
|
||||
- name: CONFIG_LOG_PREVIEW
|
||||
value: "false"
|
||||
- name: FETCH_LOG_INTERVAL
|
||||
value: "5m"
|
||||
ports:
|
||||
- name: metrics
|
||||
containerPort: 9090
|
||||
protocol: TCP
|
||||
livenessProbe:
|
||||
httpGet:
|
||||
path: /livez
|
||||
port: 9090
|
||||
initialDelaySeconds: 15
|
||||
periodSeconds: 20
|
||||
timeoutSeconds: 5
|
||||
failureThreshold: 3
|
||||
readinessProbe:
|
||||
httpGet:
|
||||
path: /readyz
|
||||
port: 9090
|
||||
initialDelaySeconds: 10
|
||||
periodSeconds: 10
|
||||
timeoutSeconds: 5
|
||||
failureThreshold: 3
|
||||
resources:
|
||||
requests:
|
||||
memory: "64Mi"
|
||||
cpu: "50m"
|
||||
limits:
|
||||
memory: "256Mi"
|
||||
cpu: "200m"
|
||||
59
apps/pangolin/controller/controller-rbac.yaml
Normal file
59
apps/pangolin/controller/controller-rbac.yaml
Normal file
|
|
@ -0,0 +1,59 @@
|
|||
---
|
||||
# ClusterRole for pangolin-kube-controller
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRole
|
||||
metadata:
|
||||
name: pangolin-kube-controller
|
||||
labels:
|
||||
app.kubernetes.io/name: pangolin-kube-controller
|
||||
app.kubernetes.io/component: controller
|
||||
app.kubernetes.io/part-of: pangolin
|
||||
rules:
|
||||
# Traefik CRDs - full access to manage IngressRoutes, Middlewares, and TraefikServices
|
||||
- apiGroups: ["traefik.io"]
|
||||
resources:
|
||||
- ingressroutes
|
||||
- ingressroutetcps
|
||||
- ingressrouteudps
|
||||
- middlewares
|
||||
- middlewaretcps
|
||||
- traefikservices
|
||||
- serverstransports
|
||||
- serverstransporttcps
|
||||
- tlsoptions
|
||||
- tlsstores
|
||||
verbs: ["get", "list", "watch", "create", "update", "patch", "delete"]
|
||||
|
||||
# IngressClass - read-only for validation
|
||||
- apiGroups: ["networking.k8s.io"]
|
||||
resources: ["ingressclasses"]
|
||||
verbs: ["get", "list", "watch"]
|
||||
|
||||
# Leader election - requires lease access
|
||||
- apiGroups: ["coordination.k8s.io"]
|
||||
resources: ["leases"]
|
||||
verbs: ["get", "list", "watch", "create", "update", "patch"]
|
||||
|
||||
# Events - for operational notifications
|
||||
- apiGroups: [""]
|
||||
resources: ["events"]
|
||||
verbs: ["create", "patch", "get", "list"]
|
||||
|
||||
---
|
||||
# ClusterRoleBinding for pangolin-kube-controller
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRoleBinding
|
||||
metadata:
|
||||
name: pangolin-kube-controller
|
||||
labels:
|
||||
app.kubernetes.io/name: pangolin-kube-controller
|
||||
app.kubernetes.io/component: controller
|
||||
app.kubernetes.io/part-of: pangolin
|
||||
subjects:
|
||||
- kind: ServiceAccount
|
||||
name: pangolin-kube-controller
|
||||
namespace: pangolin
|
||||
roleRef:
|
||||
kind: ClusterRole
|
||||
name: pangolin-kube-controller
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
20
apps/pangolin/controller/controller-service.yaml
Normal file
20
apps/pangolin/controller/controller-service.yaml
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
---
|
||||
# Service for pangolin-kube-controller metrics
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: pangolin-kube-controller
|
||||
namespace: pangolin
|
||||
labels:
|
||||
app.kubernetes.io/name: pangolin-kube-controller
|
||||
app.kubernetes.io/component: controller
|
||||
app.kubernetes.io/part-of: pangolin
|
||||
spec:
|
||||
type: ClusterIP
|
||||
selector:
|
||||
app.kubernetes.io/name: pangolin-kube-controller
|
||||
ports:
|
||||
- name: metrics
|
||||
port: 9090
|
||||
targetPort: 9090
|
||||
protocol: TCP
|
||||
11
apps/pangolin/controller/controller-serviceaccount.yaml
Normal file
11
apps/pangolin/controller/controller-serviceaccount.yaml
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
---
|
||||
# ServiceAccount for pangolin-kube-controller
|
||||
apiVersion: v1
|
||||
kind: ServiceAccount
|
||||
metadata:
|
||||
name: pangolin-kube-controller
|
||||
namespace: pangolin
|
||||
labels:
|
||||
app.kubernetes.io/name: pangolin-kube-controller
|
||||
app.kubernetes.io/component: controller
|
||||
app.kubernetes.io/part-of: pangolin
|
||||
Loading…
Add table
Reference in a new issue