Skip to content
This repository was archived by the owner on Nov 20, 2021. It is now read-only.

Repository files navigation

Due to changes in the priorities, this project is currently not being supported. The project is archived as of 11/17/21 and will be available in a read-only state. Please note, since archival, the project is not maintained or reviewed.

machine-api

The Machine API is a declarative way of managing infrastructure resources using Kubernetes in-cluster resources (CRDs). It was originally forked from Cluster API without cluster-level resource management, and an ability to operate on existing cluster resources (i.e. machines). This repo is the "core" of the Machine API and is installed in each cluster that will use the Machine API. The infrastructure providers, such as machine-api-provider-docker or machine-api-provider-aws, are only installed on clusters where that provider will be used to manage infrastructure. The machine-api-provider-docker, or mapd, is a special infrastructure provider in that it is abstracting local docker using cinder instead of a cloud-provider. The idea here is this enables developing Machine API providers easily by exposing the same declarative interface locally.

Getting started

Create a new cinder cluster, enabling the machine-api to be installed:

$ cinder create cluster -c - <<EOTapiVersion: cinder.crit.sh/v1alpha1kind: ClusterConfigurationfeatureGates: MachineAPI: trueEOT

Check out the nodes running:

$ kubectl get no
NAME STATUS ROLES AGE VERSION
cinder Ready master 30s v1.18.5

Create a simple worker configuration by applying the following CRD:

apiVersion: machine.crit.sh/v1alpha1kind: Configmetadata:
name: worker-configspec:
config: | apiVersion: crit.sh/v1alpha2 kind: WorkerConfiguration clusterName: cinder

To create a new worker machine using the above worker configuration, now apply a new Machine and DockerMachine:

apiVersion: machine.crit.sh/v1alpha1kind: Machinemetadata:
name: worker-1spec:
configRef:
name: worker-configinfrastructureRef:
apiVersion: infrastructure.crit.sh/v1alpha1kind: DockerMachinename: worker-1
---
apiVersion: infrastructure.crit.sh/v1alpha1kind: DockerMachinemetadata:
name: worker-1spec:
clusterName: cindercontainerName: cinder-worker-1image: docker.io/criticalstack/cinder:v1.0.3

The Machine is the abstract that is used to represent the idea of a virtual machine, and the DockerMachine is the provider-specific implementation of the virtual machine that is used to specify any provider-specific configuration. For example, docker uses container images (vs. something like AWS that uses AMIs), so it allows configuration of a container image in it's CRD.

List of infrastructure providers

Contributing

Any contributors must accept and sign the CLA.

This project has adopted the Capital One Open Source Code of conduct.

About

A declarative API for managing cloud infrastructure

Topics

Resources

Stars

6 stars

Watchers

2 watching

Forks

Releases

Packages

Contributors

Languages