Skip to content

Latest commit

 

History

History
86 lines (63 loc) · 2.53 KB

README-fleet.md

File metadata and controls

86 lines (63 loc) · 2.53 KB

fleet

In order to debug fleet it is first necessary to recompile it with debug symbols.

  1. install fleet as usual (eg. as part of Rancher)
  2. determine the current chart version (eg. 100.0.3+up0.3.9):
if kubectl get ns | grep cattle-fleet-system; then
  export NAMESPACE=cattle-fleet-system
else
  export NAMESPACE=fleet-system
fi
helm --namespace $NAMESPACE list
  1. determine the new version for the component debug deployment (eg. 100.0.4-dbg)
  2. recompile with debugging symbols, eg.
cd fleet
export VERSION=100.0.4-dbg
DEBUG=true TAG=$VERSION make build package

NOTE: currently make support for debug symbols is available on the master branch A 0.3.9 fork with the patch is available here: https://github.com/moio/fleet/tree/v0.3.9-dbg

  1. either push built images onto a registry, or import them into your cluster nodes manually. If you are using k3d:
export CLUSTER=upstream
k3d image import --mode direct --cluster $CLUSTER rancher/fleet:$VERSION rancher/fleet-agent:$VERSION
  1. upgrade the installation to the latest build
helm -n $NAMESPACE upgrade --version $VERSION --reuse-values --set debug=true fleet-crd ./dist/artifacts/fleet-crd-$VERSION.tgz
helm -n $NAMESPACE upgrade --version $VERSION --reuse-values --set debug=true --set image.tag=$VERSION --set agentImage.tag=$VERSION fleet ./dist/artifacts/fleet-$VERSION.tgz

Note: if fleet is installed by Rancher, its version string starts with 100. Installing a lower version will be overwritten by Rancher with a vanilla version.

  1. run
./util/debug-fleet-controller.sh

or

./util/debug-fleet-agent.sh

gitjob additional steps

After following instructions above:

  1. determine the current image version (eg. v0.1.26):
kubectl --namespace $NAMESPACE describe deployment gitjob | grep Image
  1. determine a new version for the component debug deployment (eg. v0.1.26-dbg)

  2. build gitjob:

cd ../gitjob
export GITJOB_VERSION=v0.1.26-dbg
DEBUG=true TAG=$GITJOB_VERSION make
  1. either push built images onto a registry, or import them into your cluster nodes manually. If you are using k3d:
export CLUSTER=upstream
k3d image import --mode direct --cluster $CLUSTER rancher/gitjob:$GITJOB_VERSION
  1. upgrade the fleet chart specifying the rebuilt gitjob image:
cd ../fleet
helm -n $NAMESPACE upgrade --version $VERSION --reuse-values --set gitjob.gitjob.tag=$GITJOB_VERSION --set gitjob.debug=true fleet ./dist/artifacts/fleet-$VERSION.tgz