Follow us
Breaking
Software

Moving from infrastructure provisioning to Juju application

Learn how Juju uses charms to automate application deployment and interconnection across Kubernetes and bare metal. Discover why Juju's model-driven approach outperforms Ansible and Terraform for managing complex service lifecycles.

Share

Beyond Ansible and Terraform

Ansible manages host configuration using YAML playbooks and SSH sessions. Terraform provisions cloud infrastructure using HCL and a provider ecosystem. Juju automates application deployments using charms. While Terraform manages the cloud resources and Ansible handles host configuration, Juju uses charms to automate the deployment, interconnection, and operation of complex applications across diverse substrates like Kubernetes, OpenStack, and bare metal. I find that Juju beats both for complex service deployments.

Juju is the answer.

Ansible is a configuration management tool maintained by Red Hat. It uses a serverless, agentless architecture and relies on SSH or remote PowerShell sessions to perform configuration tasks. Ansible is well suited for traditional automation, but it cannot orchestrate services. It fails to scale in large environments consisting of various interconnected applications. Terraform is an open-source infrastructure-as-code solution from HashiCorp. It uses a declarative paradigm to define an ultimate state through providers. Terraform handles infrastructure provisioning, but the applications being deployed still require installation using traditional scripts or images. Terraform uses execution plans and resource graphs to orchestrate deployed workloads. Juju is an application modeling tool from Canonical. It goes beyond providers to the application layer. You can declare application configuration and relations, and Juju handles the rest. Juju uses charms, which are collections of scripts and metadata, to install and operate applications. The Charm Store contains over 400 charms. Juju supports providers like AWS, Google Cloud, Azure, LXD, MAAS, VMware vSphere, and Kubernetes.

Setting up Charmed Kubernetes

To set up Charmed Kubernetes, you need an Ubuntu environment or a system that supports snapd. You must install Juju, add cloud credentials, bootstrap a controller, and add a model. For instance, you can run juju add-credential aws to add credentials. To register a Kubernetes cluster, use the juju add-k8s command. You can choose kubernetes-core for a minimalist installation or canonical-kubernetes for production workloads. If you have MicroK8s installed locally, Juju detects it and adds it as a k8s cloud automatically.

Tool Focus Paradigm
Ansible Configuration Imperative
Terraform Infrastructure Declarative
Juju Applications Model-driven

You can deploy a bundle with juju deploy charmed-kubernetes. This command pulls the latest stable bundle from Charmhub.io. Customization is possible through bundle overlays. You can change constraints or modify configuration values in the YAML file. Charmed Kubernetes provides Containers-as-a-Service to build and run multiple services on Kubernetes clusters. It is built on Ubuntu and uses Juju charms for lifecycle management. Engineers can add or delete services and scale the environment with a few commands. You, who already know how to manage clusters, can use the Kubernetes dashboard to monitor activities.

Stop using Ansible.

Engineers can customize deployments by adding components or personalizing network topologies. You can also test different versions or copy current configurations. Charmed Kubernetes simplifies managing complex applications. It adheres to CIS and FIPS benchmarks to improve security. The Kubeescape charm provides remediation advice for compliance testing.

Managing Application Lifecycles

Juju uses operator pods to manage workloads in Kubernetes. These pods run alongside application pods and respond to messages from the Juju controller. You can scale an application with the juju scale-application command. This tool handles the lifecycle of services across multi-cloud environments.

Juju provides predictable unit identifiers to ensure entity stability. A unit in a deployment like users-db might have the name users-db/0. This stability allows Prometheus to maintain consistent metrics during unit restarts. You can upgrade your cluster by setting a target version and upgrading master and worker nodes. How will Juju handle the next generation of specialized AI workloads?

Start with Juju.

The Juju topology uniquely identifies workloads using the model name, model UUID, application name, and unit identifier. This metadata helps improve the processing of telemetry. In a Kubernetes environment, Juju uses kubectl to manage entities. In a full-OS environment, you use juju ssh, juju scp, and juju exec. This flexibility allows you to deploy databases to bare metal and then applications to Kubernetes. Juju charms adhere to CIS and FIPS benchmarks to improve security and compliance.

Share

Technewsdaily

Senior tech writer covering AI, gadgets and cybersecurity. Breaking down the news that matters, every day.