DevOps
Introduction
The goal of DevOps is to unify application development (Dev) and its operations (Ops) throughout the software development life-cycle (SDLC), from strategy, planning, coding, building, and testing, through release, deploy, operate and monitor.
DevOps encourages the maximum possibility of automation by using DevOps tools and scripts.
We have to answer this type of questions:
- Which tools can I use for development, for CI/CD, management and operations?
- How can my company manage errors in containers when running in production?
- How can we change pieces of our software in production with minimum downtime?
- How can we scale and how can we monitor our production system?
- How can we include testing and deployment of containers in our release pipeline?
- How can we use Open Source tools/platforms for containers in Microsoft Azure?
Container Orchestration
As mission-critical applications are overwhelmingly being built through loosely coupled, yet highly cohesive components/services destined to run on geographically distributed IT infrastructures and platforms, the concept of composition is getting a lot of attention and attraction.
The orchestration of containers is being prescribed as one of the most critical and crucial requirements in the ensuing instant-on, adaptive, and smart IT era. There are a few proven and promising methods and standards-compliant tools for enabling the enigmatic orchestration goals.
- Installation and cluster configuration
- Container setup
- Scalability
- High availability
- Load balancing
- Container updates and rollbacks
- Data volumes
- Networking
- Service Discovery
Container orchestration is all about managing the lifecycles of containers, especially in large, dynamic environments.
Acquire is related to select and download a base image to build the containerized application. Deliver concerns to bring the application in production. Deploy is about deploying the application and maintaining its update. The run step set the management system and runtime environment (e.g., scaling policy, health check, recovery policies). The final step, Maintain, determines how you will get visibility into your application for maintenance.
Software teams use container orchestration to control and automate many tasks:
- Provisioning and deployment of containers
- Redundancy and availability of containers
- Scaling up or removing containers to spread application load evenly across host infrastructure
- Movement of containers from one host to another if there is a shortage of resources in a host, or if a host dies
- Allocation of resources between containers
- External exposure of services running in a container with the outside world
- Load balancing of service discovery between containers
- Health monitoring of containers and hosts
- Configuration of an application in relation to the containers running it
Linking Containers
One of the basic functionalities which is related to orchestration is to link the containers together. It is part of docker networking concept.
The Docker engine provides the --link option in the docker run subcommand to link a source container to a recipient container.
<container>
is the name of the source container and <alias>
is the name seen by the recipient container.
The name of the container must be unique in a Docker host, whereas alias is very specific and local to the recipient container, and hence, the alias need not be unique to the Docker host.
When two containers are linked together, the Docker engine automatically exports a few environment variables to the recipient container.
Exercise
Exercise 1:
Pull and run MySQL docker container:
$ docker pull mysql:8.0.1
$ docker run --name my-own-mysql -e MYSQL_ROOT_PASSWORD=mypass123 -d mysql:8.0.1
$ docker pull phpmyadmin/phpmyadmin:latest
$ docker run --name my-own-phpmyadmin -d --link my-own-mysql:db -p 8081:80 phpmyadmin/phpmyadmin
http://localhost:8081/
Exercise 2:
Pull and run a Jenkins Instance:
Read the admin password using logs command: call thehttp://localhost:8080
port, login to the Jenkins using the password you read.