Skip to content

Instantly share code, notes, and snippets.

@pwschuurman
Last active February 6, 2023 23:46
Show Gist options
  • Save pwschuurman/3ad3800b054671fdda99b2f2fbba7318 to your computer and use it in GitHub Desktop.
Save pwschuurman/3ad3800b054671fdda99b2f2fbba7318 to your computer and use it in GitHub Desktop.

KEP-3335 Demo

Instructions for testing out kep-3335 with on a Kubernetes-on-GCE cluster using kubetest.

Set up gcloud project

gcloud config configurations create kep-3335-demo
gcloud config set project kep-3335-demo
gcloud auth login

Create a Kubernetes Cluster (Kubernetes on GCE)

go get -v -u k8s.io/test-infra/kubetest
cd ~/go/src/k8s.io/kubernetes
kubetest --build && \
  NODE_SCOPES=https://www.googleapis.com/auth/cloud-platform \
  KUBE_FEATURE_GATES="StatefulSetStartOrdinal=true" \
  kubetest --up --test_args="--feature-gates=StatefulSetSlice=true"

Create a StatefulSet with a sliced set

This creates a single StatefulSet with a pod sleep-2

cat <<EOF | kubectl apply -f -

kah
apiVersion: apps/v1
kind: StatefulSet
metadata:
  name: sleep
spec:
  serviceName: "sleep"
  replicas: 1
  replicaStartOrdinal: 2
  selector:
    matchLabels:
      app: sleep
  template:
    metadata:
      labels:
        app: sleep
    spec:
      containers:
      - name: busybox
        image: busybox
        command:
        - sleep
        - "3600"
<<EOF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment