Skip to content

Latest commit

 

History

16 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

scs-openstack-iac

Automated routines and code to setup a Cluster Stack on top of SovereignCloudStack (SCS); supported by Ansible and OpenTofu.

The current components and tools that are setting up the SCS Cluster Stack are:

  • clusterctl
  • helm
  • kind
  • kubectl

The container engine is Docker.

Credentials and Permissions

Should you be exclusively using the web interface of your cloud provider, please navigate to /identity/application_credentials/create and generate the application credentials from there.

A bit more information about application credentials used by clouds.yaml?

The code on this repository will assume you have your credentials available and have the following environment variables set with the proper values:

- OS_APPLICATION_CREDENTIAL_ID
- OS_APPLICATION_CREDENTIAL_SECRET

Other variables are also required to be set! Please read the detailed information below for 'Environment Variables' and set them.

Cluster API Images for OpenStack

Before proceeding any further, ensure you have the supported images available. Here we mean the images to be used by the nodes provisioned by the cluster. Should you need to build images yourself please follow the official documentation here:

Official Providers

The code on this repository requires that you define the name for your cloud provider setting the OS_CLOUD environment variable. Here's the current list of supported providers:

  • plusserver
  • scaleup

Should you have a custom provider not listed above and your OS_CLOUD has a different value other than those listed above, please define the following variables before:

  • OS_AUTH_URL
  • OS_EXTERNAL_NETWORK_ID

Defining OS_CLOUD with the name of the official providers sets the other variables by default; that's the current state of the art at the moment.

Management Cluster

By default kind is being used behind the setup of the management cluster here. Should you are willing to have k3s please run "setup-k3s" as your 'setup' target instead.

NOTE: setting up K3S as management cluster is currently a work in progress!!1

  • K3S Role Git Module

This repository relies on a submodule to configure a custom setup with K3S so, please check those remotes before proceeding. Here's how:

$ git submodule update --init

Official Documentations

Here's a list of some of documentations we based this work on:

Environment Variables

To setup the local environment that will be used by the Cluster Stack, a few variables must be set (and exported).

The variables will be read by Ansible and are, in short, related to the setup of OpenStack's client credentials. Here is a list of them:

  • OS_APPLICATION_CREDENTIAL_ID
  • OS_APPLICATION_CREDENTIAL_SECRET
  • OS_AUTH_URL
  • OS_CLOUD
  • OS_INTERFACE
  • OS_REGION_NAME

Set the value using your local environment variables before applying this role.

Deployment and Setup

Besides make, you would also need to have the following applications on your end:

  • Ansible
  • OpenStack Client
  • OpenTofu
  • Bootstrapping (Initializing OpenTofu Providers)
$ make

That will not just initialize the providers but also check and validate what is served by the code under the opentofu/ directory.

  • Applying and Deploying the Infrastructure
$ export OS_CLOUD=foo
$ make <provider>
  • Installing and Setting up Cluster Stack*
$ export OS_CLOUD=foo
$ make setup

One-liner? make && make <provider> OS_CLOUD=foo && sleep 145 && make setup OS_CLOUD=foo

  • Destroying the Infrastructure*
$ export OS_CLOUD=foo
$ make <provider>-destroy

Be aware that this will exclusively destroy only the infrastructure created by OpenTofu; you would still need to delete all resources managed by the Cluster Stack. Try kubectl delete cluster -R <your-cluster-name>.

Releases

Packages

Contributors

Languages