Skip to content

Instantly share code, notes, and snippets.

@howardjohn
Last active June 25, 2020 13:26
Show Gist options
  • Save howardjohn/33e896b31265c8a8635cc5e03d016b83 to your computer and use it in GitHub Desktop.
Save howardjohn/33e896b31265c8a8635cc5e03d016b83 to your computer and use it in GitHub Desktop.
Running istio-agent locally bootstrapped with SA token
mkdir -p ./var/run/secrets/tokens ./var/run/secrets/istio
echo '{"kind":"TokenRequest","apiVersion":"authentication.k8s.io/v1","spec":{"audiences":["istio-ca"]}}' | kubectl create --raw /api/v1/namespaces/default/serviceaccounts/default/token -f - | jq -j '.status.token' > ./var/run/secrets/tokens/istio-token
kubectl -n istio-system get secret istio-ca-secret -ojsonpath='{.data.ca-cert\.pem}' | base64 -d > ./var/run/secrets/istio/root-cert.pem
CA_ADDR=localhost:15012 PROXY_CONFIG="$(cat proxyconfig.yaml | envsubst)" go run ./pilot/cmd/pilot-agent proxy sidecar --templateFile ./tools/packaging/common/envoy_bootstrap_v2.json
where proxyconfig.yaml:
binaryPath: $GOPATH/src/istio.io/istio/out/linux_amd64/release/envoy
configPath: $HOME/kube/local/proxy
discoveryAddress: localhost:15012
statusPort: 15020
@howardjohn
Copy link
Author

Also need to port-forward istiod on port 15012 in this example

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment