- Description
- Overview
- Key Features
- How to use it
- 1. Deploy a stack
- 2. Updating the Stack
- 3. Check the logs of your container
- 4. Clean up old images from server
Description
Portainer is a powerful container management tool that simplifies the deployment and management of containerised applications within Docker environments. A deployment with Portainer involves utilising the Portainer platform to streamline the process of creating, managing, and monitoring Docker containers and services.
Here's a detailed description of a deployment with Portainer
Overview
Portainer acts as a user-friendly interface for Docker, providing a graphical representation of Docker containers, images, networks, and volumes. It enables users, regardless of their level of expertise with Docker, to manage and interact with containerised applications efficiently.
Key Features
- User Interface (UI) Portainer offers an intuitive web-based UI that makes it easy for users to navigate and interact with Docker components. The UI presents a visual representation of containers, making it simple to monitor their status and manage configurations.
- Container Deployment Users can deploy containers directly through Portainer. This involves specifying the image to use, defining environment variables, configuring network settings, and allocating resources. Portainer simplifies this process, reducing the complexity of Docker commands.
- Application Templates Portainer provides a range of application templates, allowing users to deploy common applications with predefined settings. This feature simplifies the deployment of popular services like databases, web servers, and content management systems.
- Resource Management Users can monitor and manage resource usage (CPU, memory, storage) of containers through the Portainer interface. This ensures optimal performance and resource allocation for running applications.
- User Access Control Portainer supports user authentication and access control, allowing organisations to define roles and permissions for different users. This enhances security by restricting access to sensitive operations and configurations.
- Volume and Network Management Portainer facilitates the creation and management of Docker volumes and networks. Users can configure data storage for containers and define network connections, ensuring seamless communication between containers.
- Health Checks and Logging Portainer provides health check indicators for containers, helping users identify and address issues promptly. It also offers logs and event tracking, aiding in troubleshooting and monitoring container activities.
How to use it
1. Deploy a stack
- Login to B1 Portainer URL
- You will see an overview with all environments.
- Select the server you want to deploy to
- Select “Add stack”
- Give it a name like
myapp
, - Select “Web editor” (should be selected by default)
- Navigate to Bitbucket of your app and copy the full content of the file at the following path
.deploy/portainer.deployment.docker-compose.yml
- Paste back in the Web Editor in Portainer
- Move on to next step (Do not deploy yet!)
- Webhooks:
false
- Add the environment variables by pressing “Add an environment variable”
- Sample application, match the casing for the names as those are read into the configuration as variables
- STACK (this will be your sub sub domain)
- Name: STACK
- Value
<your application name>
- VERSION
- Name: VERSION
- VALUE
<version tag or branch your application is based on>
i.e.develop
- DOMAIN
- Name: DOMAIN
- VALUE
domain.de
- DEFAULT_APP
- Name: DEFAULT_APP
- Value: <name of your app in B1>
- If you want to connect an existing Security-Hub (Formerly known as secureable)
- AUTHENTICATION_OIDC_ROLE_ID
- Name: AUTHENTICATION_OIDC_ROLE_ID
- Value: <Value form Sechub>
- AUTHENTICATION_AUDIENCE
- Name: AUTHENTICATION_AUDIENCE
- Value: <Value form Sechub>
- Enable access control and set access control to
restricted
and notprivate
and select all teams. - Deploy the stack
- Give it 2 to 5 min to start properly - test to open your new environment at
https://<STACK>.<DOMAIN>
develop
is not built and published for swat
, but for offer
2. Updating the Stack
- Open an existing stack
- 🚨 update the editor the latest config from your repo by:
- looking for
.deploy/portainer.deployment.docker-compose.yml
in your repo - compare it with the stack editor
- Update to latest values and additions, without removing customisations
- Update the stack, find under the environment variables the option to Update the stack.
3. Check the logs of your container
- Open Portainer
- Choose your environment
- Choose your stack
- Look for the pasoe container (1) and click on icon “Console” (2)
- Click on Connect
- Enter in console:
cd /workspace/pasoe/logs
Enterls -la
Enter- Look for app.agent.[DATE].log
- Open the file
- for the last 100 lines:
cat app.agent.[DATE].log
- Live reading:
tail -f app.agent.[DATE].log
- Click
disconnect
4. Clean up old images from server
- Portainer will download each image on the local server and will not delete them automatically. This must be done manually
- Open Portainer
- Go to
Images
- On the upper left of the grid you can filter the images, show only the unused ones
- Now you can select all and delete them
Back to Documentation
Back to Home Page