CA - 01 Automated Container Deployment and Administration

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 14

B9IS121 Networks and System Administration

CA 01

Assessment Title

Automated Container deployment and Administration

Professor
Kingsley Ibomo

Student Name:

Onkar Kshirsagar

Student No.

20023913

1
Summary:

This report outlines the deployment of the Apache service in a Docker container using
Ansible automation. The project aims to streamline container deployment and
administration processes to enhance efficiency and scalability in network
infrastructure.
As part of the deployment process, a public GitHub repository has been set up to
house Ansible playbooks, Docker files, and configuration files. Ansible automation is
utilized to install Docker, construct the Docker container with the Apache service, and
configure it to host a static web page. Additionally, network communication is enabled
within the Docker container, allowing accessibility from the host machine.
The results indicate that the Apache service has been successfully deployed and
made accessible within a Docker container. The network diagram illustrates the setup,
showing the container operating within the specified subnet and allowing traffic from
the host machine.
In conclusion, this project demonstrates the effectiveness of automation tools such as
Ansible and Docker in streamlining container deployment and administration tasks.
Automating these processes could potentially help organizations achieve greater
efficiency, reliability, and scalability in managing their network infrastructure. It is worth
considering future enhancements such as optimizing configurations, implementing
security measures, and exploring additional automation techniques for advanced
container management.

2
Content:

Introduction: ............................................................................................................. 4
Tools Introduction:................................................................................................ 4
Docker: ............................................................................................................... 4
Ansible: .............................................................................................................. 4
Apache server: ................................................................................................... 5
CentOS: .............................................................................................................. 5
GitHub Repository: ............................................................................................ 5
Steps for Automated Container Deployment and Administration: ...................... 5
Docker Container Deployment with Ansible:...................................................... 5
Configuration for Network Communication: ...................................................... 9
Verification of Accessibility: .................................................................................. 12
Network Diagram:................................................................................................... 13
Conclusions: .......................................................................................................... 14
References: ............................................................................................................. 14
Bibliography: .......................................................................................................... 14

3
Introduction:

This report documents the process of automating container deployment and


administration, specifically deploying an Apache service within a Docker container
using Ansible automation. In the current IT landscape, efficient and scalable
infrastructure management solutions are of great importance. Organizations may
consider using automation tools like Ansible and containerization technologies such
as Docker to improve their deployment processes, resource utilization, and operational
efficiency.
This report outlines the steps involved in deploying the Apache service within a Docker
container, from setting up a public GitHub repository to configuring network
communication and verifying accessibility. Additionally, this document will elaborate on
the rationale for adopting Ansible for automation and Docker for containerization. It will
highlight the benefits of these tools in simplifying and standardizing the deployment
process.
This report intends to offer readers a thorough comprehension of automated container
deployment and administration. It aims to provide insights that can improve their
infrastructure management workflows. We invite you to join us on this exploration of
innovative technologies and practices that are transforming the IT operations
landscape.

Tools Introduction:

Docker:

Docker is an important component of our deployment strategy, as it offers lightweight


and portable containers for hosting our Apache service. By defining the environment
and dependencies required for our application, Docker files make deployment and
scaling faster. Additionally, Docker's networking capabilities facilitate seamless
communication between containers and the host machine, ensuring accessibility of
our Apache service over the network.

Ansible:

Ansible is a software configuration management tool designed for IT professionals.


Active voice is predominantly used, and subject-specific vocabulary is used when it
conveys the meaning more precisely than a similar non-technical term. It provides
powerful automation for cross-platform computer support, including application
deployment, workstation and server updates, cloud provisioning, configuration
management, and intra-service orchestration.

4
Apache server:

Apache is a web server software that accepts HTTP requests and sends back the
requested information as web pages. This allows visitors to view content on your
website.

CentOS:

The CentOS Linux distribution is a platform that is known for its stability, predictability,
manageability, and reproducibility. It is derived from the sources of Red Hat Enterprise
Linux (RHEL). Our goal is to provide the necessary resources for other communities
to build on the CentOS Linux platform.

GitHub Repository:

A GitHub repository has been created to store the template file and resources
needed for deploying Docker containers with Ansible.

Repository Link: https://github.com/logan2800/Deploy-Web-Application-in-


Docker-Container-using-Ansible

Steps for Automated Container Deployment and


Administration:

Docker Container Deployment with Ansible:

Ansible was utilized to deploy a Docker container that runs the Apache service (httpd)
with a static web page. The Ansible playbook comprises of tasks that involve pulling
the required Docker image, creating and initiating the container, and configuring the
Apache service with the specified static web page.
Two virtual machines were employed, both of which had Cent OS 7 installed.
One of the virtual machines was assigned as the controller node while the other was
designated as the managed node.
The controller node is identified as CentOS Slave, while the managed node is referred
to as CentOS Slave1.
Ansible has been installed on the controller node, and a playbook named
docker_conf.yml has been created to facilitate the deployment of a web server in a
Docker container using Ansible.

5
6
7
8
An index.HTML file has been created in the controller node to display the web page
in the browser. This file will be copied to the managed node via playbook and run
through the Apache webserver.

Configuration for Network Communication:

The Docker container has been configured to enable network communication. The
relevant network settings have been set up to ensure accessibility from the host
machine to the container subnet (172.168.10.0/30).

9
10
11
Verification of Accessibility:

Accessibility from the controller node to the managed node Docker container was
verified to ensure successful communication. Tests confirmed that the Apache web
service running within the container was accessible from the controller node.
The web page was accessed on the CentOS Linux machine, which is being used in a
virtual environment.

12
Network Diagram:

A network diagram has been created to illustrate the Docker container named
'apacher_container' running on the 172.168.10.0/30 subnet. The diagram shows traffic
allowance from the host machine to the container subnet, providing a visual
representation of the network configuration. Additionally, the GitHub repository is
connected to the host machine (controller node), and the managed node is connected
to the controller node via SSH using the ssh-keygen function and a public key.

13
Conclusions:

The deployment of Docker containers using the configuration management tool


Ansible was successful in meeting the objectives of the assignment. The network
communication configuration was implemented, and accessibility from the host
machine to the Docker container was verified. The assessment suggests that
deploying Docker containers and managing network configurations using Ansible can
be an efficient approach.

References:

https://docs.ansible.com/
https://www.youtube.com/watch?v=y2TSR7p3N0M&t=3094s
https://www.youtube.com/watch?v=OhnTMWmfTBE&t=9643s
https://www.digitalocean.com/community/tutorials/how-to-install-and-configure-
ansible-on-centos-7

Bibliography:

https://docs.ansible.com/ansible/2.9/dev_guide/developing_collections.html#:~:text=
You%20can%20publish%20collections%20to,the%20Galaxy%20docsite%20for%20
details.&text=Once%20you%20upload%20a%20version,delete%20or%20modify%2
0that%20version.

14

You might also like