Optional Cluster Resources
On this page
Starting with Ververica Platform 3.1.6, the ververica-platform Helm chart can create five kinds of cluster resources for the platform services. Each kind is off by default: an install or upgrade that doesn't turn one on creates none of these resources.
On a cluster older than the required Kubernetes version, turning on pdb or hpa fails the Helm command with an error that names the missing API.
Common Settings
Every kind takes these keys:
enabled: turns the resource on for every service.labels: added to every resource of that kind. A key that is also a default label (system,chart,app,component,heritage,release) replaces it.namespace: where the resources go. The default is the release namespace. PodDisruptionBudgets, HorizontalPodAutoscalers, and NetworkPolicies act only on pods in their own namespace, so keep the default for them unless the platform services run in another namespace. A ServiceMonitor or PrometheusRule can go in the Prometheus namespace, and the ServiceMonitor still scrapes the release namespace.
pdb, hpa, and serviceMonitor also take services, which overrides any key for a single service, by service name. To turn on a single service while the kind stays off for the others, set services.<name>.enabled: true.
The service names are access-control-service, api-gateway, vvp-advisor, vvp-agent, vvp-jar, vvp-nginx, vvp-sql, vvp-appmanager, vvp-autopilot-worker, vvp-console-ui, vvp-gateway, vvp-meta, vvp-vvp-premise, and, when the Kubernetes operator is installed, vvp-operator.
PodDisruptionBudget
Use a PodDisruptionBudget to keep a minimum number of replicas of a service running while nodes drain for maintenance.
1pdb:
2 enabled: true
3 minAvailable: 1 # or: minAvailable: null, maxUnavailable: 1- Set exactly one of
minAvailableandmaxUnavailable, as an integer or a percentage. Setting both, or neither, fails the Helm command. To usemaxUnavailablefor every service, setminAvailable: null. Aservicesentry that sets either one replaces both values for that service. - A service with one replica never gets a budget. A budget on a single pod blocks every voluntary eviction, so
kubectl drain, managed node pool upgrades, and the Cluster Autoscaler would stall on its node. All platform services run one replica by default, sopdb.enabled: truealone creates nothing until you scale a service out. The Helm output names each service that gets no budget.
NetworkPolicy
Use NetworkPolicies to restrict which pods can reach the platform services and, with defaultDeny, which destinations the platform services can reach. Your cluster needs a network plugin (CNI) that enforces NetworkPolicy.
1networkPolicy:
2 enabled: true
3 defaultDeny: true
4 allowFrom:
5 - namespaceSelector:
6 matchLabels:
7 kubernetes.io/metadata.name: ingress-nginx
8 allowTo:
9 - namespaceSelector:
10 matchLabels:
11 kubernetes.io/metadata.name: vvp-deployThe chart creates one policy for each service, which selects only that service's pods. Other pods in the namespace aren't affected. Without further settings, the policies allow:
- Ingress from every pod in the release namespace, from the peers in
allowFrom, and from anywhere to the webhook port of the Kubernetes operator. - Egress, only with
defaultDeny: true: to every pod in the release namespace, to the peers inallowTo, and to any address on these ports: DNS (53 and 5353, UDP and TCP), TCP 443 and 6443 (Kubernetes API and HTTPS blob storage), and the database port (global.database.port, otherwise 3306, or 5432 for PostgreSQL).
defaultDeny limits egress to those ports, not to particular hosts on them. To limit the hosts, add your own NetworkPolicy or an egress firewall.
allowFrom and allowTo take lists of NetworkPolicy peers, allowed on all ports. Add the peers that the chart can't know:
- The namespace of your ingress controller, in
allowFrom. Otherwise, the console and the API are unreachable. - The Flink deployment namespaces, in both
allowFromandallowTo. Otherwise, jobs can't fetch their artifacts and the platform can't reach the JobManagers. - The Prometheus namespace, in
allowFrom, whenserviceMonitoris on. Otherwise, every scrape fails andVervericaPlatformServiceDownfires for every service. - Blob storage or an identity provider on a port other than 443, in
allowTo. - The cloud metadata endpoint on port 80, as an
ipBlockinallowTo, when the pods get their cloud credentials from it, as with GKE Workload Identity and EKS Pod Identity.
With defaultDeny: false, the policies restrict ingress only, and egress stays open. The chart doesn't create policies for the Flink deployment namespaces.
HorizontalPodAutoscaler
HorizontalPodAutoscalers are unsupported unless the target service is known to be safe with several replicas. The platform services are designed to run as one replica. The Helm output repeats this warning whenever the chart creates an autoscaler.
1hpa:
2 services:
3 vvp-gateway:
4 enabled: true
5 maxReplicas: 3An autoscaler scales a service on CPU utilization (targetCPUUtilizationPercentage, default 70) between minReplicas (default 1) and maxReplicas (default 3). Setting minReplicas above maxReplicas fails the Helm command. Turn on single services through services rather than hpa.enabled.
- The service needs a CPU request, because utilization is a share of the request.
access-control-serviceandapi-gatewayhave none by default: setaccess-control.resources.requests.cpuorapi-gateway.resources.requests.cpubefore you turn on an autoscaler for them. helm upgraderesets the replica count to the chart value. The autoscaler scales the service again after the upgrade.
ServiceMonitor
Use a ServiceMonitor to have the Prometheus Operator scrape the metrics of the platform services. Your cluster needs the Prometheus Operator CRDs. Without them, the chart creates no ServiceMonitor, and the Helm output says so.
1serviceMonitor:
2 enabled: true
3 labels:
4 release: kube-prometheus-stack # whatever your Prometheus selects ServiceMonitors by
5 interval: 30sSet serviceMonitor.labels to the labels that your Prometheus selects ServiceMonitors by.
The scraped services are vvp-advisor, vvp-agent, vvp-appmanager, vvp-autopilot-worker, vvp-gateway, and vvp-meta. Each gets a <name>-metrics Service on port 9090, which the ServiceMonitor scrapes. The other services don't expose Prometheus metrics.
With helm template, which runs without a cluster, pass --api-versions monitoring.coreos.com/v1.
PrometheusRule
Use a PrometheusRule to get alerts when a platform service stops answering scrapes or has no pod, and to ship your own rules with the release. It needs the same Prometheus Operator CRDs as the ServiceMonitor.
1prometheusRule:
2 enabled: true
3 labels:
4 release: kube-prometheus-stack
5 additionalRules:
6 - alert: AppManagerHeapHigh
7 expr: jvm_memory_used_bytes{area="heap", job="vvp-appmanager-metrics"} > 4e9
8 for: 10m
9 labels:
10 severity: warningVervericaPlatformServiceDown(built in, severity critical, after 5 minutes): fires when a scraped platform service stops answering scrapes. It works only withserviceMonitorturned on.VervericaPlatformServiceAbsent(built in, one for each service with a ServiceMonitor): fires when Prometheus has no target for the service, for example when its pod is missing or pending. It also fires when your Prometheus doesn't select the ServiceMonitor, so checkserviceMonitor.labels.additionalRules: your own Prometheus rules, added as their own group.