Converter
This subdirectory contains the Go command which converts topology YAML to
various formats.
The root main.go outputs a Cobra CLI for
controlling the behavior of the program.
Conversion Outputs
- Kubernetes (
go run main.go kubernetes <topology_path> ...
):
Generates services and deployments for all topology services and the
Fortio client to load test against them.
To generate the output for isotope mock services:
go run main.go kubernetes <topology_path> --service-image <isotope-service-image> > output.yaml
To see all the options:
go run main.go kubernetes --help
Using the examples
To generate the output for 2 services in a different namespace:
go run main.go kubernetes ../example-topologies/chain-2-services-different-namespaces.yaml \
--service-image <isotope-service-image> > output.yaml
To generate the output for specific services belonging to a given cluster name:
# For cluster1
go run main.go kubernetes ../example-topologies/chain-2-services-different-cluster.yaml \
--service-image <isotope-service-image> --cluster cluster1 > cluster1.yaml
# For cluster2
go run main.go kubernetes ../example-topologies/chain-2-services-different-cluster.yaml \
--service-image <isotope-service-image> --cluster cluster2 > cluster2.yaml
Using the container
docker run -it \
-v $(pwd)/../example-topologies/chain-2-services-different-namespaces.yaml:/etc/config/service-graph.yaml \
<isotope-convert-image> kubernetes --service-image <isotope-service-image> > output.yaml
Deploy
You can build and deploy the image by your own, or to build and push the image
with ko
and a ephemeral registry
in one command like follows:
export KO_DOCKER_REPO=ttl.sh/<my-prefix>-isotope-convert
ko build --bare -t 1h .