feat(pangolin): Add Kubernetes controller manifests
Create complete manifest set for Pangolin controller deployment: - RBAC with ServiceAccount, ClusterRole, and ClusterRoleBinding - ConfigMap with controller configuration (endpoint, namespace, leader election) - Deployment with resource limits, health probes, and security context - Service for metrics endpoint on port 8080 Controller will manage Traefik CRDs (IngressRoute, Middleware, TraefikService) and sync configuration from Pangolin API. Relates to DEV-397 Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
parent
dae46cecac
commit
0fe46b77ec
4 changed files with 150 additions and 0 deletions
10
apps/pangolin/kube-controller/configmap.yaml
Normal file
10
apps/pangolin/kube-controller/configmap.yaml
Normal file
|
|
@ -0,0 +1,10 @@
|
||||||
|
apiVersion: v1
|
||||||
|
kind: ConfigMap
|
||||||
|
metadata:
|
||||||
|
name: pangolin-controller-config
|
||||||
|
namespace: pangolin
|
||||||
|
data:
|
||||||
|
CONFIG_ENDPOINT: "http://pangolin.pangolin.svc.cluster.local:3001/api/v1/traefik-config"
|
||||||
|
TARGET_NAMESPACE: "pangolin"
|
||||||
|
ENABLE_LEADER_ELECTION: "true"
|
||||||
|
LOG_LEVEL: "info"
|
||||||
65
apps/pangolin/kube-controller/deployment.yaml
Normal file
65
apps/pangolin/kube-controller/deployment.yaml
Normal file
|
|
@ -0,0 +1,65 @@
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: pangolin-controller
|
||||||
|
namespace: pangolin
|
||||||
|
labels:
|
||||||
|
app: pangolin-controller
|
||||||
|
component: controller
|
||||||
|
spec:
|
||||||
|
replicas: 1
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: pangolin-controller
|
||||||
|
component: controller
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: pangolin-controller
|
||||||
|
component: controller
|
||||||
|
spec:
|
||||||
|
serviceAccountName: pangolin-controller
|
||||||
|
containers:
|
||||||
|
- name: controller
|
||||||
|
image: fosrl/pangolin-kube-controller:latest
|
||||||
|
imagePullPolicy: Always
|
||||||
|
envFrom:
|
||||||
|
- configMapRef:
|
||||||
|
name: pangolin-controller-config
|
||||||
|
ports:
|
||||||
|
- name: metrics
|
||||||
|
containerPort: 8080
|
||||||
|
protocol: TCP
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
cpu: 100m
|
||||||
|
memory: 128Mi
|
||||||
|
limits:
|
||||||
|
cpu: 500m
|
||||||
|
memory: 512Mi
|
||||||
|
livenessProbe:
|
||||||
|
httpGet:
|
||||||
|
path: /healthz
|
||||||
|
port: 8080
|
||||||
|
initialDelaySeconds: 15
|
||||||
|
periodSeconds: 20
|
||||||
|
timeoutSeconds: 5
|
||||||
|
failureThreshold: 3
|
||||||
|
readinessProbe:
|
||||||
|
httpGet:
|
||||||
|
path: /readyz
|
||||||
|
port: 8080
|
||||||
|
initialDelaySeconds: 5
|
||||||
|
periodSeconds: 10
|
||||||
|
timeoutSeconds: 5
|
||||||
|
failureThreshold: 3
|
||||||
|
securityContext:
|
||||||
|
allowPrivilegeEscalation: false
|
||||||
|
runAsNonRoot: true
|
||||||
|
capabilities:
|
||||||
|
drop:
|
||||||
|
- ALL
|
||||||
|
securityContext:
|
||||||
|
runAsNonRoot: true
|
||||||
|
seccompProfile:
|
||||||
|
type: RuntimeDefault
|
||||||
57
apps/pangolin/kube-controller/rbac.yaml
Normal file
57
apps/pangolin/kube-controller/rbac.yaml
Normal file
|
|
@ -0,0 +1,57 @@
|
||||||
|
apiVersion: v1
|
||||||
|
kind: ServiceAccount
|
||||||
|
metadata:
|
||||||
|
name: pangolin-controller
|
||||||
|
namespace: pangolin
|
||||||
|
---
|
||||||
|
apiVersion: rbac.authorization.k8s.io/v1
|
||||||
|
kind: ClusterRole
|
||||||
|
metadata:
|
||||||
|
name: pangolin-controller
|
||||||
|
rules:
|
||||||
|
# Traefik CRDs - full CRUD
|
||||||
|
- apiGroups:
|
||||||
|
- traefik.containo.us
|
||||||
|
- traefik.io
|
||||||
|
resources:
|
||||||
|
- ingressroutes
|
||||||
|
- middlewares
|
||||||
|
- traefikservices
|
||||||
|
verbs:
|
||||||
|
- get
|
||||||
|
- list
|
||||||
|
- watch
|
||||||
|
- create
|
||||||
|
- update
|
||||||
|
- patch
|
||||||
|
- delete
|
||||||
|
# Leases for leader election
|
||||||
|
- apiGroups:
|
||||||
|
- coordination.k8s.io
|
||||||
|
resources:
|
||||||
|
- leases
|
||||||
|
verbs:
|
||||||
|
- get
|
||||||
|
- create
|
||||||
|
- update
|
||||||
|
# Events for logging
|
||||||
|
- apiGroups:
|
||||||
|
- ""
|
||||||
|
resources:
|
||||||
|
- events
|
||||||
|
verbs:
|
||||||
|
- create
|
||||||
|
- patch
|
||||||
|
---
|
||||||
|
apiVersion: rbac.authorization.k8s.io/v1
|
||||||
|
kind: ClusterRoleBinding
|
||||||
|
metadata:
|
||||||
|
name: pangolin-controller
|
||||||
|
roleRef:
|
||||||
|
apiGroup: rbac.authorization.k8s.io
|
||||||
|
kind: ClusterRole
|
||||||
|
name: pangolin-controller
|
||||||
|
subjects:
|
||||||
|
- kind: ServiceAccount
|
||||||
|
name: pangolin-controller
|
||||||
|
namespace: pangolin
|
||||||
18
apps/pangolin/kube-controller/service.yaml
Normal file
18
apps/pangolin/kube-controller/service.yaml
Normal file
|
|
@ -0,0 +1,18 @@
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: pangolin-controller-metrics
|
||||||
|
namespace: pangolin
|
||||||
|
labels:
|
||||||
|
app: pangolin-controller
|
||||||
|
component: controller
|
||||||
|
spec:
|
||||||
|
type: ClusterIP
|
||||||
|
ports:
|
||||||
|
- name: metrics
|
||||||
|
port: 8080
|
||||||
|
targetPort: 8080
|
||||||
|
protocol: TCP
|
||||||
|
selector:
|
||||||
|
app: pangolin-controller
|
||||||
|
component: controller
|
||||||
Loading…
Add table
Reference in a new issue