Kubernetes distributes containers across several machines and restarts them after a failure; such a group of machines is called a cluster. Under Kubernetes clusters (in the left navigation, directly below Servers) you manage clusters once for the whole organization. In a project’s Hosting step you can then pick a cluster alongside Docker servers and webspaces.
Cloud account credentials do not live here; they live under Cloud accounts. Manage credentials in the top right of the cluster screen takes you there.
Create a cluster
MainPath creates a managed cluster in the selected cloud account, including networking, nodes, and optional databases.
- First add credentials for AWS, Azure, Google Cloud, or Open Telekom Cloud under Cloud accounts. How to create the keys is described under AWS, Azure, Google Cloud, and Open Telekom Cloud.
- Open Kubernetes clusters and click Create cluster.
- Choose the provider, cloud account, name, region, Kubernetes version, node size, and node count.
MainPath creates the cluster in your account. It then appears in the cluster list and as a resource on the cloud account.
Import a cluster
If you already have a cluster outside MainPath, import the access file (kubeconfig) that tools such as kubectl also use.
- Open Kubernetes clusters and click Import cluster.
- Paste the kubeconfig and save.
MainPath checks the file and stores it encrypted. Imported clusters can host applications, but they cannot provision a managed cloud database. That needs a cluster created by MainPath or a classic Docker server.
Hosting and database
In the project composer under Hosting you choose Kubernetes cluster, Docker server, or (homepage-only projects) Webspace. Production, development, and dynamic environments share the same cluster, like a webspace.
You enable a relational database on the backend only after hosting is set to a classic server or a cluster created in a cloud account. You then pick engine, instance size, and storage for that provider. Without that hosting choice MainPath shows a notice instead of turning the database on.