A demo-level SPIRE and service mesh deployment to show how to use workload identities.
We want you to understand how use workload identities both transparently and actively.
This example deployment focuses on meeting the following infrastructure requirements:
- Ensure confidentiality of HTTP requests inside the cluster
- Use strong and short lived OAuth client credentials, rather than client secrets
- Use strong and short lived database credentials, rather than passwords
Deploy the system on a computer running Linux, macOS or Windows (with Git bash).
First ensure that the following components are installed:
- A Docker Engine such as Docker Desktop
- Kubernetes in Docker (KIND)
- Helm
- openssl
- envsubst
Create a cluster and run a load balancer to enable the API to be exposed on an external IP address.
On Windows, use a Run as administrator
shell in order to run the load balancer:
./1-create-cluster.sh
Then run another shell to run basic installations of cert-manager and SPIRE.
See the PKI setup documentation for details.
./2-deploy-pki.sh
Next, deploy the Istio service mesh, to enable transparent mTLS inside the cluster.
See the Service mesh setup for details on the Istio SPIRE integration.
./3-deploy-service-mesh.sh
Next deploy the Kong API gateway to enable ingress into the cluster:
./4-deploy-api-gateway.sh
The script outputs the external IP address of the API gateway with a line similar to this:
The cluster's external IP address is 172.19.0.5 ...
Add these entries to your computer's /etc/hosts
file for that IP address:
172.19.0.5 api.democluster.example login.democluster.example admin.democluster.example
Next deploy the Curity Identity Server as the authorization server.
See the authorization server setup documentation for details of the configuration.
./5-deploy-authorization-server.sh
Next deploy a test workload which will use a Kubernetes service account token as an OAuth client credential.
See the oauth client setup documentation for details of how connections work.
./6-deploy-oauthclient.sh
First, run this command to deploy a postgres database server configured to use Mutual TLS with SPIRE X509 SVIDs.
See the database server setup documentation for details of the configuration.
./7-deploy-dbserver.sh
Next, run this command to deploy a postgres database client that will connect to the database server.
See the database client setup documentation for details of the configuration.
./8-deploy-dbclient.sh
Finally, run this command to deploy a simple REST API that makes a JDBC connection to the database server.
To build and deploy the API you must have a Java 21 SDK installed.
See the API setup documentation for details of the configuration.
./9-deploy-api.sh
Finally, once you have finished testing, free resources by running these commands:
./delete-cluster.sh