Add dispatch workflow and manifest to deploy application load balancer service #3
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
As the Kubernetes load balancer service for the mongo-express application does not require redeployment on every application change, add a dispatch workflow to perform the deployment of the load balancer service only when triggered by an administrative dispatch event.
This GitHub Actions workflow expects an Azure Kubernetes Service cluster to exist and for its name and resource group to be configured as GitHub Actions secrets, as well as the Azure login credentials.
This manifest defines a Kubernetes load balancer service across all application pods with the
role
label offrontend
. The balancer will listen on port 80 and forward requests to the pods on port 8081. Pods are selected if they also have therole
label offrontend
as well.After deployment of the persistent volumes manifest, the workflow uses
kubectl
to wait for the service's ingress IP to be assigned. Unfortunately this can not be done exclusively with thekubectl wait
command as its JSON condition matching requires a fixed string, and the IP address cannot be known in advance. Instead, usekubectl get
in a loop and wait for the load balancer's status to contain aningress
key, as suggested in this comment. See also this concern regarding how JSON condition matching was implemented forkubectl wait
.