A simple CLI that will migrate service-level-operator CRs to sloth CRs.
Example: go run ./ --slos ./example/awesome.yaml --out /tmp && sloth generate -i /tmp/_gen__awesome-service.yaml
These are the steps:
- Get service-level-operator SLOs from Kubernetes using
kubectl
. - Use this CLI to migrate them.
- Apply new sloth CRs using sloth CLI or Kubernetes controller mode.
Lets see an example:
# Get service-level-operator SLOs.
kubect get servicelevels --all-namespaces -o yaml > ./slos.yaml
# Migrate to sloth.
mkdir ./sloth-specs
go run ./ --slos ./slos.yaml --out ./sloth-specs
# Check sloth specs by generating prometheus-operator rules CRs.
mkdir ./prom-specs
for f in ./sloth-specs/*; do sloth generate -i ${f} -o ./prom-specs/$(basename ${f}); done
--ignore-disable
: If used, it will not migrate the SLOs that havedisable: true
.