Files
traces/operations/jsonnet/microservices/memcached.libsonnet
Zach Leslieandzeekay 66d0392e67 Introduce PDB for several components (#6271)
* Introduce PDB for several components

* Include pod-disruption-budget.libsonnet

* Allow configuration of maxUnavailable

* Adhere to config standard

* Add pdb configuration to compiled jsonnet extras
2026-02-22 00:55:19 -08:00

41 lines
1.1 KiB
Jsonnet

local memcached = import 'memcached/memcached.libsonnet';
memcached {
memcached+:: {
cpu_limits:: null,
connection_limit: $._config.memcached.connection_limit,
memory_limit_mb: $._config.memcached.memory_limit_mb,
deployment: {},
local k = import 'ksonnet-util/kausal.libsonnet',
local statefulSet = k.apps.v1.statefulSet,
statefulSet:
statefulSet.new(self.name, $._config.memcached.replicas, [
self.memcached_container,
self.memcached_exporter,
], []) +
statefulSet.mixin.spec.withServiceName(self.name) +
k.util.antiAffinityStatefulSet,
local service = k.core.v1.service,
service:
k.util.serviceFor(self.statefulSet) +
service.mixin.spec.withClusterIp('None'),
},
// Dedicated memcached instance used to cache query results.
memcached_all: $.memcached {
name: 'memcached',
max_item_size: '5m',
},
// Vertacal Pod Autoscaler
memcached_vpa: $.vpaForController($.memcached_all.statefulSet, 'memcached'),
// Pod Disruption Budget
memcached_pdb: $.pdbForController($.memcached_all.statefulSet, 'memcached'),
}