Getting Started with Portainer - Tool to manage your Docker containers

Getting Started with Portainer - Tool to manage your Docker containers

What is Portainer ?

Portainer is an easy-to-use management tool that lets you manage various Docker environments. It offers a simple and easy way to manage Docker containers and Swarm services from a web interface. The Portainer application allows you to manage Docker containers, such as creating and deleting Swarm services, granting access approvals, executing commands in the console of running containers, and viewing their logs. With a self-service management portal like portainer, you can deliver containerized applications from the data center out to the edge and accelerate the adoption of Kubernetes and Docker.

It reduces the operational complexity associated with containers, which speeds up adoption and reduces errors It addresses critical skill shortages by making the technology safely accessible to everyone inside the organization It simplifies the setting-up of 'safe' security configurations within Docker and Kubernetes through centralized IAM.

How to install Docker ?

Installing on Windows

Windows 10 Pro is the best option for those who wish to take the advantage of the Windows Linux subsystem. If you're using a work computer with a lot of options disabled, you might have some trouble, but don't give up, ask for help if you need it.

You can download docker from docs.docker.com/desktop/windows/install. Make sure you select the "stable versions".

Download and run the installer. Be sure to choose WSL (Windows Subsystems for Linux).

1.jpg

Restart Windows after installation is complete.

Installing on Linux

Docker is best suited to a native Linux environment due to its superior performance. For installation, you will need to follow the instructions on the Docker website due to the numerous Linux distributions and platforms that you may be running it on. This docs.docker.com/desktop/linux/install contains links to distribution instructions.

Installing on macOS

Docker Desktop for Mac can be downloaded and installed from the following website. Be sure to download the stable version. When the Docker application is downloaded, open the .dmg installer file and drag it to the Applications folder, as shown here.

Installing Portainer

The commands below will work regardless of the operating system you're using. Using a terminal or command prompt, create a portable_data disk by running the following command

docker volume create portainer_data

Using the above command, Portainer creates a data volume on your hard drive which will store your configuration data. In the absence of it, data would be stored in the container and lost every time it restarted.

Startup the Portainer container by running the following command.

docker run -d -p 8000:8000 -p 9000:9000 --name=portainer --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer

Why Portainer ?

Portainer: is designed for organizations that don't have access to container management expertise, but want to exploit the power of containers today.

With an intuitive GUI and a set of sane defaults that get users up and running fast, Portainer dramatically reduces the need for teams to learn Docker and Kubernetes, which leads to faster adoption and time savings right across the organization.

It reduces the operational complexity associated with containers, which speeds up adoption and reduces errors It addresses critical skill shortages by making the technology safely accessible to everyone inside the organization It simplifies the setting-up of 'safe' security configurations within Docker and Kubernetes through centralized IAM. shivam-sharma.in/getting-started-with-porta...

Portainer Architecture

Overview of Portainer architecture: Portainer consists of two elements: the Portainer Server and the Portainer Agent. Both run as lightweight containers on your existing containerized infrastructure. The Portainer Agent should be deployed to each node in your cluster and configured to report back to the Portainer Server container. A single Portainer Server will accept connections from any number of Portainer Agents, providing the ability to manage multiple clusters from one centralized interface. To do this, the Portainer Server container requires data persistence. The Portainer Agents are stateless, with data being shipped back to the Portainer Server container.

archi technyure.png

Uses

Portainer allows you to manage registries, images, networks, events, volumes, hosts, environments, logs, even full-stack applications. That's right, this web-based GUI isn't limited to only single app deployments. With Portainer you can create a full-stack application and even assign that stack to teams.

Agent vs Edge Agent

In standard deployments, the central Portainer Server instance and any environments it manages are assumed to be on the same network, that is, Portainer Server and the Portainer Agents are able to seamlessly communicate with one another. However, in configurations where the remote environments are on a completely separate network to Portainer Server, say, across the internet, historically we would have been unable to centrally manage these devices. With the new Edge Agent, we altered the architecture. Rather than the Portainer Server needing seamless access to the remote environment, only the remote environments need to be able to access the Portainer Server. This communication is performed over an encrypted TLS tunnel. This is important in Internet-connected configurations where there is no desire to expose the Portainer Agent to the internet.

Features

Application Deployment

At its heart, Portainer helps developers deploy cloud-native applications into containers simply, quickly and securely.

Portainer has its own simplified GUI, which makes it easy for users to get started. For advanced users, Portainer incorporates an API that allows it to connect to CI/CD tools or third-party dashboards/deployment tools.

app deploy.webp

Observability

To do their jobs properly, developers need to know how their apps are behaving inside their containers. This capability is captured under the category of 'observability'

To monitor container-based apps properly you need to have direct and deep visibility into the underlying container platform. Containers can crash and be rescheduled in seconds, often meaning failures could go unnoticed by end users, but this doesn’t mean there isn’t a problem.

Observe.gif

Through its close integration with the underlying container platforms, Portainer is able to help users not only identify issues in the application deployment but also identify issues in the container platform itself and provide a live visualization of what’s running where and how

Governance and Security

Orchestration platforms like Kubernetes are insecure by default, which is a problem for any organization looking to deploy K8s at any scale.

Portainer helps Platform Egnineers secure their environments by allowing them to control who can do what, logging who does what and providing the ability to backup and restore the Portainer configuration database. RBAC and oAuth are cornerstones of the Governance framework.

At its core, Portainer is a powerful policy and governance platform and an essential element in the IT stack.

security.webp

Platform Management

The ability to set up, manage and configure a containerized environment is central to the Platform Manager's role.

Portainer's platform management functionality allows engineers to both configure the orchestrator and then set up configuration 'rules' which define what users of the platform (typically developers) can and can't do inside the environment.

managment.webp

Conclusion

Portainer provides a simple and intuitive web-based interface for managing Docker containers, Swarm services, and other resources. The Portainer platform offers a number of free features and paid plugins that can enhance Docker cluster management.