Charmed Kubernetes
What is Charmed Kubernetes?
Charmed Kubernetes offers Containers-as-a-Service (CaaS) models to build, deploy, and run multiple applications and services on Kubernetes clusters. The service is built on Ubuntu and carried out using Juju Charms, a set of tools that enable lifecycle management of all clusters in an enterprise. Charms is a model-driven approach DevOps engineers can leverage to build applications from the ground up and streamline multi-cloud cluster management.
Key features and benefits of Charmed Kubernetes
- Juju, the service modeling tool, eliminates the need for manual config management by offering shareable, reusable, and repeatable operator expressions.
- The reusable set of codes can be deployed for newer services in an organization, thus making the DevOps modeling tool scalable and adaptable.
- Juju Charms also adheres to a set of best practices, including the CIS (Center of Internet Security) and FIPS (Federal Information Processing Standard) benchmarks, thus improving the security and compliance of the clusters.
- Due to Juju Charms’ simplicity and flexibility when it comes to deployment, complex applications can also be managed with relative ease.
Charmed Kubernetes deployment and configuration
Before deploying and configuring Charmed Kubernetes, DevOps engineers need to have the following prerequisites:
- An Ubuntu environment or an environment that supports snapd.
- Juju installed on the system.
- Addition of credentials for the cloud.
- Addition of a bootstrapped controller.
- Addition of the Juju model to be deployed on Kubernetes.
If the above prerequisites aren’t met, follow the instructions below:
- Install Juju
sudo snap install juju —channel=3.1/stable
- Find the cloud on which Charmed Kubernetes must be deployed
juju clouds
- Add Credentials
juju add-credential aws
Note: For a different cloud, substitute aws with one of the names below:
- aws-china
- aws-gov
- azure
- azure-china
- cloudsigma
- joyent
- oracle
- oracle-classic
- rackspace
- Add a controller
juju bootstrap aws my-controller
- Add a model
juju add-model k8s
- Deploy Charmed Kubernetes Bundle
juju deploy charmed-kubernetes
Note: The above command will deploy the latest stable bundle from Charmhub.io.
Configuring customizations
With Charms, DevOps engineers can also customize the deployment in multiple ways:
- Addition of components
- Personalized configuration of network topologies
- Testing versions
- Copying current configurations
A few other customization options include:
Overlays
Bundle overlays can be customized for enterprises to use only fragments of the bundle. For instance, to deploy and integrate only the aws-integrator Charm, the below fragment can be used.
applications: aws-integrator: charm: aws-integrator num_units: 1 trust: true relations: - ['aws-integrator', 'kubernetes-control-plane'] - ['aws-integrator', 'kubernetes-worker']
Modifying Constraints
Constraints within overlays can be added, deleted, or changed. For example: To change root disk space from 3 (default) to 6, the command is:
kubernetes-worker: constraints: cores=4 mem=8G root-disk=100G num_units: 6
Modifying configuration values
The options setting in the bundle YAML file enables you to change configuration settings, including the number of allowed configurations.
kubernetes-worker: annotations: gui-x: '100' gui-y: '850' charm: kubernetes-worker constraints: cores=2 mem=8G root-disk=16G expose: true num_units: 3 options: channel: 1.25/stable resources: cni-amd64: 0 cni-arm64: 0 cni-s390x: 0 kube-proxy: 0 kubectl: 0 kubelet: 0
In the above, there’s only one option for the channel. However, this can be changed with the fragment of the overlay as follows:
containerd: options: https_proxy: https://proxy.example.com kubernetes-worker: options: snap_proxy: https://snap-proxy.example.com
Besides these, numerous customization options are available in Charmed Kubernetes.
Charmed Kubernetes management and operations
Juju’s Charmed operators take control of the cluster lifecycle by packaging common maintenance functions and operations into repeatable and reusable code. These packages can be used across clusters and containers in a single or multi-cloud environment and eliminate the need for manual YAML file configuration.
With Charms, clusters can be scaled up or torn down, and services and microservices can be added or deleted with just a few commands. The tool also enables you to configure files at the lowest levels if required, making it flexible and customizable.
Charmed Kubernetes offers a Kubernetes dashboard to monitor all activities comprehensively.
The modeling tool also enables straightforward upgrading through four steps:
- Check the current status of Charmed Kubernetes.
- Set the target version after choosing the channel for the Charms.
- Upgrade all master nodes across clusters.
- Upgrade all worker nodes across clusters.
Use cases and examples of Charmed Kubernetes
Explosion of microservices
As enterprises grow, the services and microservices they provide increase, and the number of customer requests they handle increases too. In such scenarios, Charmed Kubernetes offers numerous models to add/delete services and scale the overall environment to manage the demand. Engineers can choose these models and deploy them onto the Kubernetes environment across clouds and clusters with relative ease.
Misconfigurations of YAML files
Misconfiguration of YAML files is one of the major reasons for security incidents on clusters. With Charmed Kubernetes, Engineers will not need to manually configure files as the modeling tools adhere to best practices from benchmarks such as CIS and ensure the environment is as locked and invulnerable as possible. Further testing of compliance can be done by the Kubescape Charm (available on Charm Hub), which also provides remediation advice.