Sample Deployments
Check examples directory of deploying applications using CaaStle.
Some typical workflows using CaaStle are presented below:
1) Developer workflow when developing locally:
Suppose the application is a single container application and needs MySQL for backend.
- Write application code
- Create application-specific artifacts:
Ensure that app.yaml includes interpolated variables corresponding to the environment variables that should be bound to cloud resources in the environment
- Create local environment: cld env create localenv env.yaml
- Create container: cld container create cont1 local
- Edit app.yaml to include image id obtained from output of ‘cld container show cont1’ command
- Deploy application: cld app deploy app1 localenv app.yaml
- Test and modify application code
- Create new container: cld container create cont2 local
- Edit app.yaml to include image id obtained from output of ‘cld container show cont2’ command
- Deploy application: cld app deploy app2 localenv app.yaml
- Cleanup:
- cld container delete cont1
- cld app delete app1
- cld container delete cont2
- cld app delete app2
- cld env delete localenv
2) Developer workflow to test application on Public cloud:
Suppose your deployment target is Google cloud.
- Modify env.yaml to include Google cloud resources (cloudsql and gke)
- Create environment: cld env create testenv1 env.yaml
- Create container: cld container create gkecont gcr
- Edit app.yaml to include image uri obtained from output of ‘cld container show gkecont’ command
- Deploy application: cld app deploy gkeapp testenv1 app.yaml
- Test the application
- Open environment-specific shell: cld env shell testenv1
- Execute kubectl commands in the shell to verify that pods and services are working as expected:
- kubectl get pods
- kubectl get services
- kubectl logs <pod-name>
- Execute gcloud commands in the shell to verify that Cloud SQL was provisioned correctly:
- gcloud sql instances list
- gcloud sql instances describe <instance-name>
- Check-in following application artifacts to source control: env.yaml, app.yaml
3) Operator workflow to perform staging/production deployments:
- Create staging-env.yaml with appropriate resource attributes
- Create staging environment: cld env create staging staging-env.yaml
- Take app.yaml available in source control. There is no need to edit it as the container image uri that should be used for deployment is already defined in app.yaml
- Deploy application on staging environment: cld app deploy app1 staging app.yaml
- Get application URL and IP address from output of: cld app show app1
- Verify that app1 is working as expected
- Get application deployment and runtime logs for inspection: cld app logs app1
- Create production-env.yaml with appropriate resource attributes
- Create production environment: cld env create production production-env.yaml
- Deploy application on production environment: cld app deploy prodapp production app.yaml
- Get application URL and IP address from output of: cld app show prodapp
- Update application’s canonical DNS entry to point to IP address of prodapp
Demo Videos
- CaaStle setup: https://youtu.be/88kClIy8qp4
- Wordpress deployment on GKE: https://youtu.be/c7pO7TO0KzU
- Wordpress deployment on ECS: https://youtu.be/psgFyCa2PQA