mirror of
https://github.com/hanzozt/zt.git
synced 2026-11-02 11:38:22 +00:00
1.8 KiB
1.8 KiB
Purpose
This script sets up an echo service which is hosted by two SDK applications and is accessed by another sdk application.
Prerequisites
You need at least one controller and an edge router running. for this to work. You can use the quick-start script found here.
Setup
Ensure we're logged into the controller.
ziti edge login
If your session times out you can run ziti edge login again.
Remove any entities from previous runs.
ziti edge delete service echo
ziti edge delete config echo-host
ziti edge delete identities echo-host-1 echo-host-2
ziti edge delete service-policies echo-bind
ziti edge delete edge-router-policies echo
ziti edge delete service-edge-router-policies echo
Create the echo service
ziti edge create service echo -a echo
Create and enroll the hosting identities
ziti edge create identity echo-host-1 -a echo,echo-host -o echo-host-1.jwt
ziti edge enroll --rm echo-host-1.jwt
ziti edge create identity echo-host-2 -a echo,echo-host -o echo-host-2.jwt
ziti edge enroll --rm echo-host-2.jwt
Configure policies
ziti edge create service-policy echo-bind Bind --service-roles @echo --identity-roles #echo-host
ziti edge create edge-router-policy echo --identity-roles #echo --edge-router-roles #all
ziti edge create service-edge-router-policy echo --service-roles @echo --edge-router-roles #all
You should now be to run two instances of the echo server with:
ziti demo echo-server -i echo-host-1.json
ziti demo echo-server -i echo-host-2.json
and the zcat client using
ziti demo zcat -i zcat.json ziti:echo