Skip to content

Instantly share code, notes, and snippets.

@ihcsim
Last active June 24, 2019 16:45
Show Gist options
  • Save ihcsim/1747c05f43e455a4e8f807b6d1b25434 to your computer and use it in GitHub Desktop.
Save ihcsim/1747c05f43e455a4e8f807b6d1b25434 to your computer and use it in GitHub Desktop.

The following are test cases for linkerd/linkerd2#2987, which introduces global resources checks to linkerd check --pre and linkerd install.

Single control plane installation:

bin/linkerd version --client
Client version: git-b8ba3b26

# expect pre-check to succeed
bin/linkerd check --pre
bin/linkerd check --pre -l linkerd-dev

# install the control plane
bin/linkerd install | k apply -f -
bin/linkerd check
bin/linkerd check --proxy

# expect pre-check to fail because global resources already exist
bin/linkerd check --pre
bin/linkerd check --pre -l linkerd-dev

# expect install to fail because global resources already exist
bin/linkerd install | k apply -f -
bin/linkerd install -l linkerd-dev | k apply -f -

# --ignore-cluster will still overrules the checks
bin/linkerd install --ignore-cluster | k delete -f -
bin/linkerd install -l linkerd-dev --ignore-cluster | k apply -f -

Multi-stage install:

bin/linkerd install config | k apply -f -

# expect pre-check to fail
bin/linkerd check --pre
bin/linkerd check --pre -l linkerd-dev

# expect check to fail because the linkerd-config config map and workloads don't
# exist yet. this used to be stuck at "controller pod is running" check
bin/linkerd check

# 2nd phase install still works
bin/linkerd install control-plane|k apply -f -

# these are not allowed because the control plane is already installed
bin/linkerd install control-plane
bin/linkerd install control-plane -l linkerd-dev| k apply -f -
bin/linkerd install | k apply -f -
bin/linkerd install -l linkerd-dev | k apply -f -

# `--ignore-cluster` can still be used to override the installation
bin/linkerd cli install config --ignore-cluster
bin/linkerd cli install -l linkerd-dev --ignore-cluster
bin/linkerd cli install control-plane --ignore-cluster
bin/linkerd cli install control-plane -l linkerd-dev --ignore-cluster
bin/linkerd install config --ignore-cluster

ToDo:

  1. backward compatibility? e.g. an older linkerd control plane won't have the label
  2. docs for l5d-existence-mwc, l5d-existence-vwc, l5d-existence-psp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment