Materials for presentation about modern DevOps with DC/OS.
Similar presentation for Kubernetes can be found here.
Project structure:
src
: code of microservice with docker build filedevops
: files related with DC/OSothers
: other samples for demo purposes
Demo agenda:
The purposes of this demo & presentation is to show how micro-services can be managed using DC/OS, thus following scenarios are covered:
- deployment
- publishing & LB
- rollback & rolling update
- config management
- web-socket support (with TCP connections load balancing)
- monitoring & log aggregation
- GET
/hello
: printing sample message using config - GET
/secrets
: printing sample message using secrets - GET
/probe/health
: doing health-check - POST
/probe/health
: changing status of health-check - GET
/probe/ready
: doing readiness check - POST
/probe/ready
: changing status of readiness /web-socket
: establish web-socket connection (usetest_web_socket.sh
script, seeweb-sockets
section)
- Build project
mvn clean build
or
mvn clean istall
- Build and push docker image
mvn clean package docker:build -DpushImage -DpushImageTags -DdockerImageTags=<VERSION>
Pre-requisites:
- DC/OS at Vagrant
- Maven
- Java 8
- Set-up desired version (optional)
export DCOS_GENERATE_CONFIG_PATH=installers/dcos/dcos_generate_config-{version}-dev.sh
export DCOS_CONFIG_PATH=etc/config-{version}.yaml
- Set cluster configuration
cp VagrantConfig-1m-1a-1p.yaml VagrantConfig.yaml
- Start the cluster
vagrant up
- Access the UI using URL:
http://m1.dcos
Docs:
DC/OS cluster uses external OAuth by default but it is more convenient to have it disabled for local testing.
echo "oauth_enabled: 'false'" >> etc/config-{version}.yaml
- Create application
dcos marathon app add devops/service.json
- Update application's property
dcos marathon app update /dcos-java-sample <property>=<value>
or using whole file:
dcos marathon app update /dcos-java-sample < devops/service.json
- List deployed apps
dcos marathon app list
- Scale application
dcos marathon app update /dcos-java-sample instances=3
- Check logs
dcos task log --follow dcos-java-sample
- Watch progress of deployment
Check on-going deployments
dcos marathon deployment list
and then:
dcos marathon deployment watch --interval=1 <deployment_id>
-
Reach the service (on
Vagrant
) using URL:http://192.168.65.60:10010/hello
-
Make deployment & config update
dcos marathon app update /dcos-java-sample < devops/service.json
- Make rollback
Check on-going deployments
dcos marathon deployment list
and then:
dcos marathon deployment rollback <deployment_id>
- Update config
dcos marathon app update /dcos-java-sample < devops/config.json
- Get services
dcos service
- Install app form universe
dcos package install <package-name>
- Uninstall app from universe
dcos package uninstall <package_name> --app-id=/<sub_package_name>
- Check current marathon configuration
dcos package describe --config marathon
- Checking logs
dcos service log --follow <scheduler-service-name>
- Checking deployments
dcos marathon deployment list
- Check options of marathon load-balancer
dcos package describe --config marathon-lb
- Install LB
dcos package install marathon-lb --yes
- Deploy sample
nginx
fromothers/nginx-hostname-app.json
dcos marathon app add others/nginx-hostname-app.json
and check sample output (for Vagrant
) with auto-refresh
option using browser:
http://192.168.65.60:10006/
or you can check internal address, from within your cluster:
curl http://marathon-lb.marathon.mesos:10006
Docs:
Overall installation description can be found here.
Follow instruction for DC/OS at Vagrant.
Template for AWS CloudFromattion
dcos package install datadog --options=monitoring/datadog.json --yes
Docs: