Skip to content

In Place Pod Vertical Scaling Steps to run E2E Test

Vinay Kulkarni edited this page Aug 29, 2022 · 1 revision

Pre-requisites

  1. Ubuntu 20.04 or later system with either cgroup v1 or cgroup v2 (preferred).
  2. Build tools (make) isntalled.
  3. golang 1.19 installed and go env vars setup.
  4. docker installed.
  5. containerd installed.
  6. kubetest installed. (See: https://github.com/kubernetes/test-infra/blob/master/kubetest/README.md)

Running E2E test with local cluster

This requires two terminal windows.

Terminal window #1

  1. Clone my repository and switch to feature branch.

    mkdir -p $HOME/go/src/k8s.io && cd $HOME/go/src/k8s.io
    git clone https://github.com/vinaykul/kubernetes
    cd kubernetes
    git checkout restart-free-pod-vertical-scaling
  2. Build kubernetes and verify it builds successfully.

    ./hack/install-etcd.sh
    export PATH="${HOME}/go/src/k8s.io/kubernetes/third_party/etcd:${PATH}"
    make clean && make all
  3. Start a local cluster with feature gate enabled.

    FEATURE_GATES="InPlacePodVerticalScaling=true" ./hack/local-up-cluster.sh

    Upon successful cluster start, it will print out KUBECONFIG info as below:

    ...
    ...
    storageclass.storage.k8s.io/standard created
    Local Kubernetes cluster is running. Press Ctrl-C to shut it down.
    
    Logs:
      /tmp/kube-apiserver.log
      /tmp/kube-controller-manager.log
    
      /tmp/kube-proxy.log
      /tmp/kube-scheduler.log
      /tmp/kubelet.log
    
    To start using your cluster, you can open up another terminal/tab and run:
    
      export KUBECONFIG=/var/run/kubernetes/admin.kubeconfig
      cluster/kubectl.sh
    
    Alternatively, you can write to the default kubeconfig:
    
      export KUBERNETES_PROVIDER=local
    
      cluster/kubectl.sh config set-cluster local --server=https://localhost:6443 --certificate-authority=/var/run/kubernetes/server-ca.crt
      cluster/kubectl.sh config set-credentials myself --client-key=/var/run/kubernetes/client-admin.key --client-certificate=/var/run/kubernetes/client-admin.crt
      cluster/kubectl.sh config set-context local --cluster=local --user=myself
      cluster/kubectl.sh config use-context local
      cluster/kubectl.sh

Terminal window #2

  1. Verify cluster is up and running.

    cd $HOME/go/src/k8s.io/kubernetes
    ./cluster/kubectl.sh get no -owide
    ./cluster/kubectl.sh get po -owide -A
  2. If coredns is crash-looping, then delete the deployment as a workaround.

    ./cluster/kubectl.sh delete deploy coredns -n kube-system
  3. Run pod-resize E2E test against local cluster as follows (it takes ~20 minutes to run 34 tests on my older baremetal server system)

    kubetest --test --test_args="--ginkgo.focus=InPlacePodVerticalScaling" --provider=local