mirror of
https://github.com/hanzoai/traces.git
synced 2026-10-30 18:20:41 +00:00
* 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
41 lines
1.1 KiB
Jsonnet
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'),
|
|
}
|