This repository contains two Pulumi templates for deploying Kubernetes clusters using kubeadm via cloud-init. The templates are written using the Pulumi Python SDK and the Pulumi Node.js SDK, respectively.
This repository is Experimental meaning that it's based on untested ideas or techniques and not yet established or finalized or involves a radically new and innovative style! This means that support is best effort (at best!) and we strongly encourage you to NOT use this in production.
Currently, we're stuffing a self-signed CA into the custom data of your Equinix Metal instances. This is a rather serious security risk and we don't encourage using this pattern just yet until we tighten this up.
Before you begin, ensure you have the following installed:
- Pulumi CLI
- Python (for the Python template)
- Node.js (for the Node.js template)
To create a new Pulumi project, you should start by selecting the template that aligns with your preferred programming language:
- Python Template:
pulumi new https://github.com/equinix-labs/pulumi-equinix-kubernetes-cluster/tree/main/python
- Node.js Template:
pulumi new https://github.com/equinix-labs/pulumi-equinix-kubernetes-cluster/tree/main/nodejs
- Activate the virtual environment:
source venv/bin/activate
- Install dependencies:
pip install -r requirements.txt
- Set the required configuration variables. See configuration variables below.
- Set metal credentials:
export METAL_AUTH_TOKEN=<YOUR_METAL_API_TOKEN>
- Deploy the stack:
pulumi up
- Follow the instructions printed in the console to complete the deployment.
- Set the required configuration variables. See configuration variables below.
- Set metal credentials:
export METAL_AUTH_TOKEN=<YOUR_METAL_API_TOKEN>
- Deploy the stack:
pulumi up
- Follow the instructions printed in the console to complete the deployment.
The following table lists the configuration variables for both templates:
Variable | Description | Default Value |
---|---|---|
organization | The Equinix Metal organization ID under which you want to create the project. This variable is optional. If you omit the organization input, the project will be created within the default organization associated with your account. |
N/A |
project | The Equinix Metal project ID. This variable is optional. If not specified, a new project will be created. | N/A |
metro | The deployment metro code. This variable is optional. See metro codes | SV |
sshPrivateKeyPath | Path to a private key of an existing Equinix Metal SSH Key. This variable is optional. If not specified, a new project Equinix Metal SSH Key will be created. | N/A |
kubernetesVersion | The Kubernetes version. This variable is optional. | 1.24.7 |
To add them you can use pulumi config set
command:
pulumi config set metalOrg <METAL_ORG_ID>
Feel free to customize the templates according to your specific requirements. You can modify the cloud-init scripts, adjust the cluster configuration, or add additional resources.
Contributions are welcome! If you find any issues or have suggestions for improvement, please open an issue or submit a pull request.
This project is licensed under the Apache 2.0.