Join our Discord Server
Ajeet Raina Ajeet Singh Raina is a former Docker Captain, Community Leader and Distinguished Arm Ambassador. He is a founder of Collabnix blogging site and has authored more than 700+ blogs on Docker, Kubernetes and Cloud-Native Technology. He runs a community Slack of 9800+ members and discord server close to 2600+ members. You can follow him on Twitter(@ajeetsraina).

A First Look at Portainer 2.0 CE – Now with Kubernetes Support

6 min read

Managing Your Kubernetes Environment with few “mouse” clicks

Irrespective of the immaturity of the container ecosystem and lack of best practices, the adoption of Kubernetes is massively growing for legacy modernization and cloud-native applications. Cloud-native applications require a high degree of infrastructure automation and specialized operations skills, which are not commonly found in enterprise IT organizations. Kubernetes has emerged as the de facto standard for container orchestration, with a vibrant community and support from most of the leading commercial vendors. While Kubernetes solves a lot of problems with deploying containers, the platform itself is more complicated to understand and manage.Today most organizations face challenges in determining the right set of tools to scale pilot projects into production deployments, given the steep learning curve & lack of a DevOps culture. It is important for business leaders and DevOps architects to choose the right tool which can simplify the build, management and deployment of Kubernetes environments at a much faster pace.

Introducing Portainer 2.0 Community Edition

With over 2 billion+ DockerHub pulls and approximately 500,000+ users per month, Portainer has already gained a massive popularity in the last 3 years  as  a lightweight management UI which allows you to easily manage your different Docker environments. But now with the latest 2.0 release, the much awaited support for Kubernetes has finally arrived.

If you’re looking out for a simple but robust management UI which can help you to build, manage and deploy containers in your Kubernetes environment quickly and easily, Portainer 2.0 CE is the right tool for you. No more CLI, no more YAML Manifestos, no more mistakes; just simple, fast, Kubernetes configuration in a graphical UI, built on a trusted open source platform. You can use it to deploy apps in seconds not minutes, troubleshoot complex configurations and facilitate a seamless migration from Docker to Kubernetes without having to learn Kubernetes at all. Portainer CE lets you leave complex CLI commands behind, to focus on delivering outstanding software. As a GUI based tool, Portainer CE skips up the learning curve to get your Docker & Kubernetes environments up and running quickly. Once operational, Portainer CE allows you to reliably and quickly create, operate and troubleshoot your Docker & Kubernetes environments.

Click on this image to redirect to Collabnix Slack

Below are the list of top 8 critical factors which differentiate Portainer from other existing UI tools:

  • Focus on apps, not infrastructure
  • Deploy apps in seconds not minutes
  • Create small or large clusters and assign resources to individuals
  • Add additional clusters(endpoints) in seconds
  • Visually monitor how memory and CPU is used
  • Monitor events and the applications running in each node
  • Convert docker-compose format file to YAML compatible with k8s.
  • Inspect apps, volumes, configurations in a few clicks

What’s New in Portainer 2.0 CE Edition?

Portainer CE 2.0 includes a staggering number of enhancements (~150), as well as a few breaking changes. It is an entirely new image designed as portainer/portainer-ce with the latest tag pointing to the latest release. Below are the list of top 7 new features introduced under CE 2.0 Release:

Support for Kubernetes

Support for Kubernetes enabled endpoints have been introduced under Portainer CE 2.0 release for the first time. This means you can manage the deployment of applications atop Kubernetes clusters from within Portainer, using the familiar Portainer UX. If you are new to YAML and haven’t written any Kubernetes Manifests in the past, don’t panic. Portainer makes deploying apps and troubleshooting problems so simple, anyone can do it.

Introduction of Application Template

With the newer 2.0 release, the list of application templates is being published by Portainer, maintained and updated by Portainer, and users can’t change it. Admins can choose to unsubscribe from the list and instead provide their own centrally managed list, but it would be “consume only” from a user perspective.

In addition, a feature called “custom templates’ ‘has been introduced. Now Portainer users can create their own bespoke templates. Unlike previous capability, the new custom templates rely solely upon Stack/Compose files, so when you add a new template, you add it by pasting in (or uploading) a compose file and then annotating some detail around the file.  Through Portainer access control, users can choose to publish their custom templates for themselves, for their team, or for all users within their organization.

Built-in oAUTH Authentication support

With the new 2.0 release, a basic oAUTH authentication have been introduced.This means now you can configure Portainer to authenticate users from an oAUTH source. This looks to be a very technical implementation, so you need to be competent with oAUTH before attempting it. The Portainer 2.0 Business Edition is expected to retain ‘click to configure’ simplicity for the most common oAUTH providers like Azure AD, GitHub, Google.

Support for Azure ACI 

Portainer 2.0 CE brings support for Azure ACI. You can now reliably deploy applications in an Azure ACI instance from within Portainer. These containers are all stateless, and internet facing. It takes mere seconds to deploy any container in ACI with a Portainer, which is damn cool.

Edge Compute Features

Regarding Edge Compute; Portainer team have relocated the former “Host Jobs” functionality into “Edge Jobs” and reconfigured the logic that underpins this so that they only function when used against Edge Agent enabled endpoints. This now means that the “Edge Compute” specific features includes; the ability to group edge endpoints, the ability to deploy stacks against groups of endpoints, and the ability to run cron jobs against edge endpoints.

Custom Session Control 

Portainer 2.0 CE now comes with an added support for the Admin to set a custom “session timeout’. This setting defines how often users are forced to re-authenticate with their Portainer session; the default remains at 8 hours, but it can now be changed to up to 1 year. 

Adding Your Own Custom Logo

With the new 2.0 release, you have flexibility to add your own custom logo under “Settings” in just 2 minutes. This means that you can add your own company’s logo right on the top right corner of the UI.

I was lucky enough to get early access to Portainer 2.0 Community Edition. Thanks to Neil Cresswell, CEO at Portainer.io for all great work in leading this robust platform. Under this blog post, I will test drive Portainer 2.0 CE for the first time. Most of the CLIs are run on macOS but it should work for any of Linux distros. We will take a look at two popular applications –  Minecraft and wordpress and how easy it is to setup without any dropping to CLI console. Let us get started:

Prerequisite:

  • Macbook Pro
  • Docker Desktop 2.3.5.0 or any existing  Kubernetes cluster(either single node or multi-node based on your preference)

Download Docker Desktop from this link if you haven’t performed so far. Once installed, click on the “whale icon” on the top right of the screen. Choose “About Docker Desktop” to see the Docker version installed. (as shown below)

Close the window. Now click on “Preference” to select the Kubernetes option. Choose the first check box which shows “Kubernetes” and click on “Apply & Restart”.

Installing Portainer using Helm

% brew install helm
helm versionversion.BuildInfo{Version:"v3.3.0", GitCommit:"8a4aeec08d67a7b84472007529e8097ec3742105", GitTreeState:"dirty", GoVersion:"go1.14.6"}

Adding a Chart Repository for Portainer 

% helm repo add portainer https://portainer.github.io/k8s/"portainer" has been added to your repositories


Updating Helm Chart Repository

% helm repo update
Hang tight while we grab the latest from your chart repositories......Successfully got an update from the "portainer" chart repository
Update Complete. 
⎈ Happy Helming!⎈ 

Installing Portainer

% helm install -n portainer portainer portainer/portainer
NAME: portainer
LAST DEPLOYED: Sun Aug 30 10:36:44 2020
NAMESPACE: portainer
STATUS: deployed
REVISION: 1
NOTES:
1. Get the application URL by running these commands:
  export NODE_PORT=$(kubectl get --namespace portainer -o jsonpath="{.spec.ports[0].nodePort}" services portainer)
  export NODE_IP=$(kubectl get nodes --namespace portainer -o jsonpath="{.items[0].status.addresses[0].address}")
  echo http://$NODE_IP:$NODE_PORT
ajeetraina@Ajeets-MacBook-Pro ~ %


Listing the Portainer Helm Release


% helm list -n portainer
NAME     	NAMESPACE	REVISION	UPDATED                             	STATUS  	CHART          	APP VERSION
portainer	portainer	1       	2020-08-30 10:36:44.244921 +0530 IST	deployed	portainer-1.0.1	2.0.0      

Get the application URL


ajeetraina@Ajeets-MacBook-Pro ~ % export NODE_PORT=$(kubectl get --namespace portainer -o jsonpath="{.spec.ports[0].nodePort}" services portainer)
ajeetraina@Ajeets-MacBook-Pro ~ % export NODE_IP=$(kubectl get nodes --namespace portainer -o jsonpath="{.items[0].status.addresses[0].address}")
ajeetraina@Ajeets-MacBook-Pro ~ % echo http://$NODE_IP:$NODE_PORT
http://192.168.65.3:30777
ajeetraina@Ajeets-MacBook-Pro ~ %

Open https://localhost:30777 on your browser. Create a new password as admin user and you will see a dashboard as shown below:

Click on the local cluster as shown below to open up resource pools, applications, volumes  and configurations.

It will show the endpoint summary and list of resources as shown below:

Click on “Cluster”  on the left side of the dashboard.

Let’s try to deploy a Minecraft application using Portainer UI. We will be referring to a popular Docker Image of Minecraft.

Click on “Add Application”.

Ensure that you add environmental variable EULA=TRUE under configuration section.

Click “Deploy” to deploy Minecraft running as container image as show below:

Click “Deploy Application”.

Verifying the Minecraft Server is up and running with 1 replica.

As you can see above, Minecraft server is running as Kubernetes Pods.

Using traditional YAML approach

Let us try to use “Advanced Deployment” option and try to deploy WordPress application using Portainer UI.

One you click on “Advanced deployment” option, you will find a web editor where you can paste your YAML file.

Select “Kubernetes” to add manifest file format.

You can directly pick up NGINX YAML from this link

You can verify the right port as shown below:

By now, you should be able to access Nginx server at port 80.

Deploying WordPress by using traditional YAML way

Creating Secrets YAML file


apiVersion: v1
kind: Secret
metadata:
 name: mysql-pass
type: Opaque
data:
 password: YWRtaW4=

The YAML file content can be directly pasted into UI:

Verifying mysql-pass Pod

Next, copy the below YAML files and past it under the web editor one by one:

  1. wordpress-mysql YAML with Statefulset
  2. WordPress YAML with Statefulset

Once you deploy both of the above applications, you can verify the functionality of the application below:

As we have configured Statefulsets, you can verify the PVC by clicking on “Volumes” section

Checking the logs

Finally, the WordPress application is up and running.

Cleaning up WordPress  

In order to clean up WordPress application, all you need is just a single click and all the Pods get removed.

Conclusion

Portainer Community Edition 2.0 is a powerful, open source toolset that allows you to easily build and manage containers not only in Docker & Docker Swarm but also in Kubernetes and Azure ACI. This new release simplifies container management & used by software engineers to speed up software deployments, troubleshoot problems and simplify migrations.

References:

Portainer CE for Kubernetes

Portainer CE for Swarm

Portainer CE for Edge

Portainer CE for ACI

Have Queries? Join https://launchpass.com/collabnix

Ajeet Raina Ajeet Singh Raina is a former Docker Captain, Community Leader and Distinguished Arm Ambassador. He is a founder of Collabnix blogging site and has authored more than 700+ blogs on Docker, Kubernetes and Cloud-Native Technology. He runs a community Slack of 9800+ members and discord server close to 2600+ members. You can follow him on Twitter(@ajeetsraina).
Join our Discord Server
Index