This sample creates a simple helloworld service that bootstraps the Envoy proxy with a custom configuration file.
First, we need to create a ConfigMap
resource with our bootstrap configuration.
kubectl apply -f custom-bootstrap.yaml
Next, we can create a service that uses this bootstrap configuration.
To do this, we need to add an annotation, sidecar.istio.io/bootstrapOverride
, with the name of our ConfigMap as the value.
We can create our helloworld app, using the custom config, with:
kubectl apply -f example-app.yaml
If you don't have automatic sidecar injection set in your cluster you will need to manually inject it to the services instead:
istioctl kube-inject -f example-app.yaml -o example-app-istio.yaml
kubectl apply -f example-app-istio.yaml
To see what bootstrap configuration a pod is using:
istioctl proxy-config bootstrap <POD-NAME>
The configuration provided will be passed to envoy using the --config-yaml
flag.
This will merge the passed in configuration with the default configuration. Singular values will replace the default values, while repeated values will be appended.
For reference, the default bootstrap configuration and Envoy's configuration reference may be useful
The annotation above configures a volume mount and configures Istio to use it.
When running outside of Kubernetes or in custom setups, similar functionality can be achieved by setting the ISTIO_BOOTSTRAP_OVERRIDE
variable pointing to a file containing the custom bootstrap.
kubectl delete -f custom-bootstrap.yaml
kubectl delete -f example-app.yaml