Revolutionize your Kubernetes development with Acorn

thumbernail kubernetes

Voici la traduction anglaise technique du texte, en conservant la syntaxe Markdown :

Revolutionize your Kubernetes Development with Acorn

Developing on Kubernetes can be a complex and tedious experience. If you too are struggling with compatibility and deployment issues, it's time to discover Acorn, a revolutionary tool that will make your life easier. In this article, we'll explore how Acorn can transform your Kubernetes development process into a smooth and consistent experience.

Docker vs Kubernetes Environments

When Kubernetes is your target, it is critical to have a development environment as close as possible to your production target. This reduces risks of compatibility issues when deploying to Kubernetes. But how to achieve this? Here are some key points to consider:

Local Stack

  • PCs need to be robust in terms of resources.
  • The local stack must include an ingress controller, a certificate manager, a fake DNS resolver and storage for RWO, ROX, RWX, RWOP.
  • Provisioning the local stack must be fast.

Remote Stack

  • How to easily deploy local assets to the remote cluster?
  • Ensure optimal isolation, standardization and security.

Helm for Developers?

Using Helm for deployment can be challenging for many developers.

Here are some questions to consider:

  • How to simplify environment configuration?
  • How to use the same chart for development and integration?
  • How to allow developers to expose their local file systems in the local or remote cluster?
  • How to avoid developers having to master Helm, Kubernetes, Go templating and other tools?
  • How to deploy development environments that consume managed services?

The Solution: Acorn

If you know Rancher, you'll feel right at home with Acorn.

Acorn Labs, the company behind Acorn, offers an innovative solution to simplify Kubernetes deployment.

Here are some key takeaways:

Acorn is a "packaging" and "deployment" framework just like Helm, but with fundamental differences.

It allows you to "package" and deploy all components of an application in a single artifact in OCI format.

Acorn uses an Acornfile to describe the application.

Unlike Helm, Acorn is development-oriented, making it easier for developers to use. Acorn uses a simple notation called AML (Acorn Markup Language) for definitions.
It offers a range of operations, such as
acorn install, acorn login, acorn run, acorn stop, acorn start, acorn rm...

Important yet Simple Concepts

Acorn introduces several important yet easy to understand concepts:

  • Args: Customization of application behavior.
  • Services: Application components or features.
  • Acorns: Self-contained units of functionality.
  • Containers: Isolated environments for code and dependencies.
  • Jobs: One-off tasks or processes.
  • Routers: Incoming request handling.
  • Volumes: Persistent storage for data.
  • Secrets: Sensitively stored information.
  • LocalData: Application specific data.

Usage Examples

prerequisite: have acorn installed on a kubernetes cluster: https://docs.acorn.io/installation/installing

Discover concrete Acorn usage examples:

Example #1 - Simple Deployment

We will take as an example this demo application described here: https://kubernetes.io/docs/tutorials/stateless-application/guestbook/

clone the repo: https://github.com/kubernetes/examples/tree/master/guestbook

Add at the root an Acornfile containing:

containers:
{
  "redis-leader": {
    image: "docker.io/redis:6.0.5"
    ports: "6379/tcp"
  }
  "redis-follower": {
    image: "gcr.io/google_samples/gb-redis-follower:v2"
    ports: "6379/tcp"
  }
  php: {
    //image: "docker.io/herveleclerc/frontend:v5"
    build: {
        context: "./php-redis"
        dockerfile: "./php-redis/Dockerfile"
    }
    ports: publish: "80/http"
    if args.dev {
            dirs: "/var/www/html": "./php-redis"
    }
  }
}

To launch this example simply run:

# demo002 is the application name
acorn run -n demo002
# https://php-demo002-212061ec.um4piu.oss-acorn.io

This command will:

  • Builder the php image
  • Start the redis-leader and redis-follower services based on images from different public registries
  • Launch the php service
  • Publish this service on an automatic ingress

To stop the application

acorn stop demo002

To remove the application

acorn rm -fa demo002

Watch this video to see all the steps.

Example #2 - Dev Mode

Stop the application and restart it with:

acorn dev -b

Watch this video to see what you can do in development (dev) mode

Example #3 - Using Services

Using managed services in the cloud (Redis, PostgreSQL).

Creating "Provisioners" on Aiven

A blog post will cover these actions!

Watch the following video to see the power of acorn and the ease of consuming external (cloud) services

# Build
acorn build -t docker.io/herveleclerc/redis-cloud-server:1.0.6 -t docker.io/herveleclerc/redis-cloud-server:latest

# Push
acorn push docker.io/herveleclerc/redis-cloud-server:1.0.6 && acorn push docker.io/herveleclerc/redis-cloud-server:latest

In the red frame you can see the use of services that will be created on the Aiven CSP.
We simply call an "Acorn" image that will provision the service, service metadata will be available in the form @{service.[service-name].[variable-name]}

The application in the magenta frame is configured via environment variables fed by the service variables.

This mode of operation is really very powerful and flexible.

In Summary / Conclusions

In summary, Acorn offers a simple solution with a low learning curve for Kubernetes development. It simplifies the use of PAAS/SAAS services and allows you to create OCI format applications. If you are looking to make your Kubernetes development more efficient and smoother, Acorn is the tool for you.

Feel free to explore Acorn Labs (acorn.io) to learn more about this revolution in Kubernetes development.

Découvrez les technologies d'alter way