This example shows how to deploy an httpbin service using Opta.
This directory contains:
.
├── env-aws.yaml # opta environment file for AWS
├── env-azure.yaml # opta environment file for Azure
├── env-gcp.yaml # opta environment file for GCP
├── env-local.yaml # opta environment file for local
└── httpbin.yaml # opta service file
- Create the local kubernetes cluster
opta apply --local --auto-approve -c env-local.yaml
- Apply the service
opta apply --config httpbin.yaml --auto-approve --env local
- Test
curl http://localhost:8080/
- Clean up
opta destroy --auto-approve --local --config hello.yaml opta destroy --auto-approve --local --config env-local.yaml
NOTE: We are using opta apply
as opta deploy
is only needed when the image is set to AUTO
- Select the target environment
# pick one export ENV=[aws/azure/gcp] # edit the env file to specify where to deploy (Account information) open env-${ENV}.yaml
- Create the environment infrastructure (VPC, Kubernetes...)
opta apply --auto-approve -c env-${ENV}.yaml # when done, find load_balancer_raw_dns or load_balancer_raw_ip in the output and save it export load_balancer=[Value from output]
- Deploy the service: push the image and deploy it to Kubernetes
opta apply --config httpbin.yaml --auto-approve --env $ENV
- Test
curl http://${load_balancer} # you can run any kubectl command at this point kubectl -n httpbin get all
- Clean up
opta destroy --auto-approve --config httpbin.yaml --env $ENV opta destroy --auto-approve --config env-${ENV}.yaml
For more guidance, please reach out to us in our slack channel.