Migrate from Azure Kubernetes Service to CK8s on Safespring

This document outlines the steps that should be taken to migrate from Azure Kubernetes Service.

This text is automatically translated for your convenience. You can read the text in:

.

Migration to Compliant Kubernetes

This document outlines the steps to migrate from Azure Kubernetes Service.

There are many reasons to undertake such a migration. Ensuring Swedish and European legal jurisdiction for GDPR compliance, access to expert support in Swedish, and keeping data safely within Sweden are a few of them. The strong security focus within Compliant Kubernetes is another.

A migration plan necessarily includes an inventory phase, identification of dependencies and how these can be replaced, planning of the work, and tests to ensure functionality. After that, the migration can begin and be verified using the acceptance tests. Continuous documentation and follow-up ensure that important lessons are not lost.

Once the migration is completed, system administration and monitoring in a new environment await. The tools for this are also presented in the document, as well as how they work together to provide a complete solution focused on security and smooth agile development processes.

Background

Cloud services have revolutionized how many companies work today.

The flexibility of being able to buy, as a service, features that previously did not exist or were hard to build in-house has given many companies renewed innovation capacity and simplified processes. Collaboration features and centralized handling of data and documents have solved the problem of “which is the latest version of the document.” IT and development departments can enable new features with a few clicks to support complex or entirely new processes.

The majority of cloud platforms used by companies today are American. These providers have grown into huge giants with immense innovation power and are a big reason why we now work in entirely new ways within organizations. The problem is that EU and US legal frameworks are not compatible regarding how personal data should be handled. In the EU, GDPR and other information security laws are grounded in the EU constitution, which gives individuals substantial control over their data. In the US, the starting point is laws that give US authorities broad capabilities to access user data to uphold national security.

These differing foundations create a clash that is not easy to resolve legally. For more information on this topic, we recommend Safespring’s white paper on Schrems II, which describes the latest developments following the EU Court of Justice’s invalidation of Privacy Shield, the agreement that use of US cloud services within the EU has relied upon in recent years.

What remains is a number of companies and organizations that, with a foundation of cloud services, have adopted a new way of working without a legal basis to use them. It’s a difficult position because reverting is not easy, while organizations must comply with the law.

The opportunity to become independent

Frameworks have been developed to remove dependencies on the underlying cloud provider. One such framework is Kubernetes, an orchestration platform for container technology with standardized interfaces for deploying and maintaining applications. Kubernetes provides a foundational layer upon which applications can be managed through standardized definitions. To summarize the technical aspects: Kubernetes helps organizations manage applications and services in a standardized way with high reliability. Since systems and their dependencies are defined as code, it is possible to leverage the knowledge available on the internet and easily deploy complex systems that can replace services provided by established cloud vendors. In other words, it becomes simpler to run in-house the services your organization has become dependent on.

More and more applications are also emerging that replace user-facing services such as Office 365, OneDrive, or Dropbox. If your organization uses Kubernetes to run applications and services, deploying and maintaining these applications becomes manageable.

Safespring is a cloud service provider with data centers in Sweden, which makes legal conflicts with US laws a non-issue. Together with our partner Elastisys, we have developed a joint offering: Compliant Kubernetes, or CK8s. It is a managed service that provides organizations with the foundation needed to achieve independence from the underlying cloud provider. If a company already uses Kubernetes with its current cloud provider, migration becomes easier because all the code describing the systems and services can be reused.

This white paper describes what a migration from Microsoft Azure Kubernetes Service (AKS) looks like, assuming the organization already runs Kubernetes in Azure. Many of the steps also apply to organizations not currently using Azure Kubernetes Service. Assuming Kubernetes continues to be the lingua franca for operating containerized applications, the advantages of running it within the organization are clear. All the work invested in migrating to a standardized platform can be reused if the organization later wants to move its infrastructure elsewhere, since the same infrastructure definitions can be used as long as the target platform is also Kubernetes. This creates flexibility and independence that are otherwise hard to achieve.

The advantages of Open Source

A major reason many use cloud services is the availability of useful add-on services that reduce time-to-market. However, as much as these services shorten production time, they increase dependency on cloud providers’ ecosystems. An alternative way to reduce production time for your services while decreasing vendor lock-in is to implement systems outside your core delivery using open source. Both approaches let you focus on your application and leave supporting systems aside, but the open source path reduces dependency instead of increasing it.

Open source is built on collaboration, and by engaging with the projects you use (primarily by contributing back bug fixes and improvements), your contributions are reviewed for greater assurance and security. Others using the projects do the same, creating a continuously updated codebase reviewed by many, without license costs. Since many use these projects, there is also a wealth of ready-made code and solutions for deploying and maintaining systems just a few searches away.

Compliant Kubernetes

Compliant Kubernetes (CK8s) is a CNCF (Cloud Native Computing Foundation) certified Kubernetes distribution, freely available both as open source and as a fully managed service on Safespring. The open source solution suits organizations that prefer to operate Kubernetes and the surrounding tech stack themselves, but want to benefit from a security-hardened Kubernetes distribution specifically tailored for regulated industries, while avoiding maintenance and relying on quarterly updates of the Kubernetes packaging and related projects. The open source variant is also a great complement to a managed service for those who need to deliver their software across a combination of their own data centers, on customer premises, and in public clouds, and want to do so seamlessly with full regulatory compliance. For customers who want it, our partner Elastisys provides both 8/17 and 24/7 support.

CK8s as open source

Prerequisites

To run applications in Compliant Kubernetes, the following prerequisites apply:

Check which version of Kubernetes is currently running in Azure Kubernetes Service (AKS). To avoid surprises, it is important to run the same version in Compliant Kubernetes.

Migration plan

This section covers the steps that should be taken before the actual migration.

Inventory of systems running in the organization Every migration project starts with an inventory of the services and systems running within the organization. Even if what runs in Azure Kubernetes Service (AKS) today is only a subset, there may be dependencies on other systems.

Examples of systems that can create dependencies include:

Inventory how secure communication between systems is handled. There are two typical choices:

If a VPN is used, a new VPN tunnel will need to be set up between the internal environment and Safespring’s environment. This can be done in advance so that communication is up when systems are moved. During the migration phase, an additional VPN tunnel may also need to be set up between Azure and Safespring’s environment if systems are to be moved one at a time.

If the second option is used, things become simpler since you only need to point the communication to Safespring’s environment by changing a DNS record. It may be worth considering this option even if a VPN tunnel is used today, because all types of migrations become easier if applications handle secure communication themselves.

Inventory of services

Inventory dependencies for the services running in Azure.

Establish a dependency matrix

A controlled migration requires full knowledge of the dependencies between systems. This shows the order in which systems are migrated and which are more central than others. Dependencies can sometimes creep in at unexpected places, so a careful review of how Azure services are configured and which services are used in custom-built systems will pay off when it’s time to migrate.

Hidden dependencies are usually found around central systems, such as identity management (Azure AD), message buses, and/or databases.

It is also important to inventory whether custom-built systems have dependencies in the form of development libraries. If a library tailored for Azure has been used, it needs to be replaced with something agnostic to the underlying platform. This may create a need for adaptations in the application itself.

Services to be replaced

There are many built-in systems that have an equivalent built with open source. On page 10 there is a collection of about 20. In this step, you also define a list of tests to determine what constitutes a successful migration.

Azure services as Open Source

We have gathered the most common services in Azure Kubernetes Service and listed their open source equivalents. See the full list at the end of this text. You can easily scroll down by clicking the button below.


See the list

Planning and prioritization

After completing a dependency analysis, you can plan how systems should be migrated. The migration will often involve some form of maintenance window when services are down, so it is important to plan everything to be done and in what order. Inputs to this step also come from the test and assurance phase.

Testing and assurance

The first thing to test is the services themselves running on the new platform. When that works, the target state is clear, and then you test migration to the test environment to understand which steps are needed for a successful migration.

After this, load tests that mirror production load as closely as possible should be performed. Naturally, the closer the tests come to production load, the lower the risk of surprises when the migration is carried out.

Migration

If the tests have been carried out, the migration itself will not be difficult.

During a migration, unexpected events can occur that could not be foreseen. Typical issues include the test database not being identical to the production database, which can lead to unexpected effects. Other common problems are that a different set of keys and secrets were used in production than in test, which may need to be updated if services do not fully use a centralized secret manager (e.g., HashiCorp Vault).

Load balancer

To ensure high availability for production workloads, a load balancer solution will need to be set up. Safespring can provide a solution where you get access to two or more virtual machines that can balance the load across specific instances running on the platform. The service itself involves a few manual steps during setup but is easy to manage once in operation. The choice of software for load balancing is up to you, but the most popular options are HAProxy or Traefik. You can also install MetalLB to get a system that provides a Kubernetes-delivered and -compatible service offering dynamic load-balancing functionality.

Follow-up

After the migration is completed, run the tests from the list that defines a successful migration. Unit tests created to test the systems before and after migration should be run to ensure all functionality works as intended. In cases where deviations occur, review them to determine whether additional changes are needed before go-live.

Documentation

Documentation should be maintained throughout the process, but a separate step is also needed to compile what has been produced. In addition to documentation of how things are set up and how systems interact, it is also important to include lessons learned.

After the migration

Operating and monitoring your applications after the migration ensures you remain in control afterwards.

Operations and monitoring

Applications in Compliant Kubernetes are monitored in two ways:

  1. Metrics and monitoring data are stored in Prometheus and visualized in Grafana.
  2. Application logs are stored in an Elasticsearch cluster and visualized and processed in Kibana.

These software tools enjoy strong support from the global DevOps community and are generally seen as best practice for these tasks in Kubernetes contexts.

Many software systems expose metrics in Prometheus-specific format precisely because the system is so entrenched in the community. Adapters exist for various contexts, making data collection smooth. For example, Java applications exposing data via Java Management Extensions (JMX) can have their data automatically imported into Prometheus. Grafana allows system administrators to create dashboards via Prometheus’s query language, PromQL, thereby obtaining a graphical overview of both the infrastructure’s state (such as disk space, network traffic, and CPU usage) and key values for application performance (such as the number of logged-in users or active database transactions).

In this way, engineers can keep track of the “four golden signals” of monitoring:

Application logs are automatically retrieved from containers, and their content is made searchable in Kibana via tagged metadata. Administrators can quickly determine which node in the Compliant Kubernetes cluster a given log entry came from and perform root cause analysis to troubleshoot effectively. If the log data consistently follows a certain structure, or is even in a hierarchical format such as JSON, this structure can be turned into proper fields in Elasticsearch, further simplifying data processing.

Continuous Integration and Deployment

To enable an agile way of working, many organizations rely on systems that automatically build, test, and deploy software in a Continuous Integration and Deployment (CI/CD) process, preferably immediately upon code check-in to a version control system. Azure offers Azure DevOps Pipelines as a complete solution. Other popular options include GitLab, CircleCI, ArgoCD, Octopus Deploy, TeamCity, and Jenkins, where organizations administer at least some of these themselves.

Since systems for building and deploying software in a CI/CD process are typically not dependent on users’ personal data, it is likely possible, even under GDPR, to continue using the systems your organization already has. Organizations that, therefore, have processes and considerable expertise in a certain set of products or services may wish to stay with them.

Neither Safespring nor Compliant Kubernetes dictates a specific CI/CD solution; both can be made compatible with all of them. For security reasons, Compliant Kubernetes recommends storing build artifacts, container images, in the container image registry included with Compliant Kubernetes.

As an officially CNCF-certified Kubernetes distribution, Compliant Kubernetes is fully compatible with all CI/CD systems that support Kubernetes.

Policy as Code

Continuous security and compliance via Policy as Code. Compliant Kubernetes is a Kubernetes distribution with a strong focus on security. Ensuring system security is not a one-time activity but a continuously ongoing process. Compliant Kubernetes supports this process in the following ways:

These aspects of the security process are a concretization of the organization’s policies. Since these policies are configured as code that can be version-controlled and subject to the organization’s code review requirements, it becomes easier to meet compliance demands such as ISO-27001.

Continuous scanning for both known vulnerabilities and behavior that indicates unknown issues also reduces the risk of data breaches. And network traffic limitations that applications themselves cannot modify reduce the risk that any intrusion will have a large impact.

Summary

A migration plan includes an inventory phase, discovering dependencies, planning the work, and tests that ensure functionality.

This document has compiled the steps an organization needs to take to successfully migrate from Microsoft Azure and Azure Kubernetes Service to Safespring and Compliant Kubernetes. There are many reasons to undertake such a migration. Ensuring Swedish and European legal jurisdiction for GDPR compliance, access to expert support in Swedish, and keeping data safely within Sweden are a few of them. The strong security focus within Compliant Kubernetes is another.

A migration plan necessarily includes an inventory phase, identification of dependencies and how these can be replaced, planning of the work, and tests to ensure functionality. After that, the migration can begin and be verified using the acceptance tests. Continuous documentation and follow-up ensure that important lessons are not lost.

Once the migration is completed, system administration and monitoring in a new environment await. The tools for this are also presented in the document, as well as how they work together to provide a complete solution focused on security and smooth agile development processes.

AKS equivalents as Open Source

Service in AzureFunctionOpen SourceManaged by Safespring
Azure Kubernetes Service (AKS)Managed KubernetesCompliant Kubernetes
Azure Virtual MachineVirtual machines where Kubernetes runs (master and worker nodes)N/A
Azure Blob StorageObject storageN/A
Azure Mysql, Azure MariaDB, Azure PostgreSQLDatabasesGalera cluster (for MySQL or MariaDB) with ProxySQL running in Kubernetes or on separate virtual machines
Azure Service BusMessaging for communication between servicesRabbitMQ or NATS running in Kubernetes or on separate virtual machines
Azure MonitorMonitoringPrometheus + Grafana
Azure MonitorLoggingElasticsearch
Azure Container RegistryContainer registryHarbor
N/AIntrusion detectionFalco
Azure Active DirectoryIdentity ProviderDex
Azure AD Domain ServicesManagement of an organization’s users, resources, and their permissionsOpenLDAP
Azure Key VaultCentralized and secure secret managementHashiCorp Vault
Azure Cosmos DB (Table API)Key-value storeTiKV
Azure FunctionsServerless runtimeOpenFaaS / OpenWhisk
Azure Virtual NetworkPrivate networkingCalico
Azure DevOps PipelinesCI/CDJenkins, ArgoCD, and others