Docs Home
Viewing docs for
Self-ManagedNot available for BYOC

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.

ResourceValues keyWhat the chart createsRequirements
PodDisruptionBudgetpdbOne for each service with more than one replicaKubernetes 1.21 or later
NetworkPolicynetworkPolicyOne for each serviceA network plugin (CNI) that enforces NetworkPolicy
HorizontalPodAutoscalerhpaOne for each service with at least one replicaKubernetes 1.23 or later, metrics-server
ServiceMonitorserviceMonitorOne <name>-metrics Service and one ServiceMonitor for each service that exposes metricsPrometheus Operator CRDs
PrometheusRuleprometheusRuleOne PrometheusRulePrometheus Operator CRDs

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.

YAML
1pdb:
2  enabled: true
3  minAvailable: 1        # or: minAvailable: null, maxUnavailable: 1
  • Set exactly one of minAvailable and maxUnavailable, as an integer or a percentage. Setting both, or neither, fails the Helm command. To use maxUnavailable for every service, set minAvailable: null. A services entry 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, so pdb.enabled: true alone 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.

YAML
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-deploy

The 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 in allowTo, 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 allowFrom and allowTo. Otherwise, jobs can't fetch their artifacts and the platform can't reach the JobManagers.
  • The Prometheus namespace, in allowFrom, when serviceMonitor is on. Otherwise, every scrape fails and VervericaPlatformServiceDown fires 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 ipBlock in allowTo, 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

YAML
1hpa:
2  services:
3    vvp-gateway:
4      enabled: true
5      maxReplicas: 3

An 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-service and api-gateway have none by default: set access-control.resources.requests.cpu or api-gateway.resources.requests.cpu before you turn on an autoscaler for them.
  • helm upgrade resets 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.

YAML
1serviceMonitor:
2  enabled: true
3  labels:
4    release: kube-prometheus-stack   # whatever your Prometheus selects ServiceMonitors by
5  interval: 30s

Set 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.

YAML
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: warning
  • VervericaPlatformServiceDown (built in, severity critical, after 5 minutes): fires when a scraped platform service stops answering scrapes. It works only with serviceMonitor turned 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 check serviceMonitor.labels.
  • additionalRules: your own Prometheus rules, added as their own group.
Was this helpful?