statefulset-pingcap

module
v0.4.1-0...-6a09f1e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 25, 2020 License: Apache-2.0

README

StatefulSet

Advanced StatefulSet from PingCAP.

https://github.com/q8s-io/statefulset-pingcap

import development

package main

import (
	"github.com/q8s-io/statefulset-pingcap/client/apis/apps/v1"
)

run advanced statefulset controller locally

Open a new terminal and run controller:

sh hack/build.sh

kubectl --kubeconfig kubeconfig apply -f manifests/crd.v1.yaml

kubectl --kubeconfig kubeconfig -n kube-system delete ep advanced-statefulset-controller --ignore-not-found

./tmp/statefulset-pingcap-controller-manager --kubeconfig kubeconfig -v 4 --leader-elect-resource-name advanced-statefulset-controller --leader-elect-resource-namespace kube-system

deploy a statefulset

kubectl apply -f examples/statefulset.yaml

scale out

Note that --resource-version is required for CRD objects.

RESOURCE_VERSION=$(kubectl get statefulsets.pingcap.com web -ojsonpath='{.metadata.resourceVersion}')

kubectl scale --resource-version=$RESOURCE_VERSION --replicas=4 statefulsets.pingcap.com web

scale in

RESOURCE_VERSION=$(kubectl get statefulsets.pingcap.com web -ojsonpath='{.metadata.resourceVersion}')

kubectl scale --resource-version=$RESOURCE_VERSION --replicas=3 statefulsets.pingcap.com web

scale in at arbitrary position

We should set delete-slots annotations and decrement spec.replicas at the same time.

kubectl apply -f examples/scale-in-statefulset.yaml 

Directories

Path Synopsis
client
client/clientset/versioned
This package has the automatically generated clientset.
This package has the automatically generated clientset.
client/clientset/versioned/fake
This package has the automatically generated fake clientset.
This package has the automatically generated fake clientset.
client/clientset/versioned/scheme
This package contains the scheme of the automatically generated clientset.
This package contains the scheme of the automatically generated clientset.
client/clientset/versioned/typed/apps/v1
This package has the automatically generated typed clients.
This package has the automatically generated typed clients.
client/clientset/versioned/typed/apps/v1/fake
Package fake has the automatically generated clients.
Package fake has the automatically generated clients.
cmd
pkg

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL