Skip to content

Instantly share code, notes, and snippets.

@tahmmee
Last active Jun 3, 2021
Embed
What would you like to do?

Spec snippet:

apiVersion: couchbase.com/v2
kind: CouchbaseCluster
metadata:
  name: cb-example
spec:
  image: couchbase/server:6.6.2
  ...
  servers:
    - size: 3
      autoscaleEnabled: true
      name: data
      services:
        - data
  servers:
    - size: 2
      autoscaleEnabled: true
      name: index
      services:
        - index
  servers:
    - size: 2
      autoscaleEnabled: true
      name: query
      services:
        - query

initial cba resources

data.cb-example      3      data
index.cb-example     2      index
query.cb-example     2      query

all server classes are referenced by an hpa

NAME        REFERENCE                              TARGETS             MINPODS   MAXPODS   REPLICAS   AGE
cpu-hpa     CouchbaseAutoscaler/query.cb-example   5/15                2         9         2          52s
data-hpa    CouchbaseAutoscaler/data.cb-example    4956m/10, 894m/80   3         10        3          6m41s
index-hpa   CouchbaseAutoscaler/index.cb-example   6871m/60            2         8         2          36m

Data is scaling up

Normal   SuccessfulRescale             12s                 horizontal-pod-autoscaler  New size: 4; reason: pods metric cbbucketinfo_basic_quota_user_percent above target

all hpas go into maint mode with target set to

NAME        REFERENCE                              TARGETS                      MINPODS   MAXPODS   REPLICAS   AGE
cpu-hpa     CouchbaseAutoscaler/query.cb-example   <unknown>/15                 2         9         0          19m
data-hpa    CouchbaseAutoscaler/data.cb-example    <unknown>/10, <unknown>/80   3         10        0          25m
index-hpa   CouchbaseAutoscaler/index.cb-example   <unknown>/60                 2         8         0          54m

Resources have scaled

data.cb-example      4      data
index.cb-example     2      index
query.cb-example     2      query

stats are back online

NAME        REFERENCE                              TARGETS                MINPODS   MAXPODS   REPLICAS   AGE
cpu-hpa     CouchbaseAutoscaler/query.cb-example   3/15                   2         9         2          33m
data-hpa    CouchbaseAutoscaler/data.cb-example    23482m/10, 19775m/80   3         10        4          39m
index-hpa   CouchbaseAutoscaler/index.cb-example   21936m/60              2         8         2          68m
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment