Skip to content

Materials for presentation about modern DevOps with DC/OS

License

Notifications You must be signed in to change notification settings

herolynx/conf-modern-devops-dc-os

Repository files navigation

conf-modern-devops-dc-os

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 file
  • devops: files related with DC/OS
  • others: 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

API

  • 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 (use test_web_socket.sh script, see web-sockets section)

Build

  1. Build project
mvn clean build

or

mvn clean istall
  1. Build and push docker image
mvn clean package docker:build -DpushImage -DpushImageTags -DdockerImageTags=<VERSION>

Local development

Pre-requisites:

  1. 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
  1. Set cluster configuration
cp VagrantConfig-1m-1a-1p.yaml VagrantConfig.yaml
  1. Start the cluster
vagrant up
  1. Access the UI using URL: http://m1.dcos

Docs:

Disable authentication.

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

DevOps

  1. Create application
dcos marathon app add devops/service.json
  1. 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
  1. List deployed apps
dcos marathon app list
  1. Scale application
dcos marathon app update /dcos-java-sample instances=3
  1. Check logs
dcos task log --follow dcos-java-sample
  1. Watch progress of deployment

Check on-going deployments

dcos marathon deployment list

and then:

dcos marathon deployment watch --interval=1 <deployment_id>
  1. Reach the service (on Vagrant) using URL: http://192.168.65.60:10010/hello

  2. Make deployment & config update

dcos marathon app update /dcos-java-sample < devops/service.json
  1. Make rollback

Check on-going deployments

dcos marathon deployment list

and then:

dcos marathon deployment rollback <deployment_id>
  1. Update config
dcos marathon app update /dcos-java-sample < devops/config.json
  1. Get services
dcos service
  1. Install app form universe
dcos package install <package-name>
  1. Uninstall app from universe
dcos package uninstall <package_name> --app-id=/<sub_package_name>
  1. Check current marathon configuration
dcos package describe --config marathon
  1. Checking logs
dcos service log --follow <scheduler-service-name>
  1. Checking deployments
dcos marathon deployment list
  1. Check options of marathon load-balancer
 dcos package describe --config marathon-lb
  1. Install LB
dcos package install marathon-lb --yes
  1. Deploy sample nginx from others/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:

DC/OS - set-up

Overall installation description can be found here.

Localhost

Follow instruction for DC/OS at Vagrant.

AWS

Template for AWS CloudFromattion

Monitoring

DataDog
dcos package install datadog --options=monitoring/datadog.json --yes

Docs:

Other docs

About

Materials for presentation about modern DevOps with DC/OS

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published