Create Ambassador Instance
In this section we will show how you can create your ambassador instance as part of your kubernetes cluster, regardless of what cloud provider you have chosen.
Ambassador with AKS
When you create your Kubernetes Cluster, you have the option to specify an API Gateway. In the example below, we will demonstrate how to create an Ambassador instance part of your AKS.
Ambassador in AKS
AzureKubernetesService.builder()
.withId("aks-1")
.withDescription("AKS with Ambassador")
.withDisplayName("AKS #1")
.region(EUROPE_WEST)
.withAPIGateway(CaaSAmbassador.builder()
// Id assigned to the Fractal component
.withId("api-gateway")
// Description of the Fractal component
.withDescription("Ambassasdor API Gateway")
// Name assignaed to the Frcatal component that will be displayed in Fractal Web
.withDisplayName("API Gateway")
// Namespace assigned to Ambassador in Kubernetes
.withNamespace("ambassador")
// ACME provider authority
.withAcmeProviderAuthority("https://acme-v02.api.letsencrypt.org/directory")
// Host that will be used to access the API Gateway
.withHost("azure.test.mydomain.com")
// Host owner email. This could be any valid e-mail address
.withHostOwnerEmail("owner@mydomain.com")
// Name that will be assigned to the Tls secret once stored in the keyvault.
.withTlsSecretName("ambassador-tls-secret-name")
//Ambassador license key
.withLicenseKey("license-key")
.build())
.build();
For more details you can check the code on GitHub in our samples repository for Ambassador in Azure.
Ambassador in GKE
GoogleKubernetesEngine.builder()
.withId("gke-1")
.withDescription("GKE with Ambassador")
.withDisplayName("GKE #1")
.region(EU_WEST1)
.withAPIGateway(CaaSAmbassador.builder()
// Id assigned to the Fractal component
.withId("api-gateway")
// Description of the Fractal component
.withDescription("Ambassasdor API Gateway")
// Name assignaed to the Frcatal component that will be displayed in Fractal Web
.withDisplayName("API Gateway")
// Namespace assigned to Ambassador in Kubernetes
.withNamespace("ambassador")
// ACME provider authority
.withAcmeProviderAuthority("https://acme-v02.api.letsencrypt.org/directory")
// Host that will be used to access the API Gateway
.withHost("azure.test.mydomain.com")
// Host owner email. This could be any valid e-mail address
.withHostOwnerEmail("owner@mydomain.com")
// Name that will be assigned to the Tls secret once stored in the keyvault.
.withTlsSecretName("ambassador-tls-secret-name")
//Ambassador license key
.withLicenseKey("license-key")
.build())
.build();
For more details you can check the code on GitHub in our samples repository for Ambassador in GCP.
Ambassador Prerequisites
The Ambassador Edge Stack requires the following images:
- docker.io/datawire/aes:2.3.1
- docker.io/redis:5.0.1
If they are missing in the Fractal container registry, they must be pushed.
If you are instantiating Ambassador on Azure, you can simply push the images using a script like this:
resourceGroupId="<your resource group id>"
subscription="<your subscription id>"
az acr login --name ${resourceGroupId}acr
# aes
docker pull "docker.io/datawire/aes:2.3.1"
docker tag "docker.io/datawire/aes:2.3.1" "${resourceGroupId}acr.azurecr.io/${subscription}/yanchware/datawire/aes:2.3.1"
docker push "${resourceGroupId}acr.azurecr.io/${subscription}/yanchware/datawire/aes:2.3.1"
# redis:5.0.1
docker pull "docker.io/redis:5.0.1"
docker tag "docker.io/redis:5.0.1" "${resourceGroupId}acr.azurecr.io/${subscription}/yanchware/redis:5.0.1"
docker push "${resourceGroupId}acr.azurecr.io/${subscription}/yanchware/redis:5.0.1"