Cloud & Storage Providers
Overview
In this chapter we will discuss the cloud providers and the storage providers supported by Spinnaker. By the end of this chapter, you should be able to:
Set up a spinnaker on cloud providers
Set up a spinnaker on storage providers
Set up a spinnaker on cloud providers
Spinnaker and its capabilities are primarily built on top of the Cloud Providers that are supported. You must enable one of the supported providers in order for Spinnaker to perform.
The supported providers are:
App Engine
Amazon Web Services
Azure
Cloud Foundry
DC/OS
Google
Compute Engine
Kubernetes
Oracle
In this chapter we will learn about setting up Kubernetes cloud provider and s3 storage provider.
Prerequisites for Setting up Spinnaker
Experimental kubernetes cluster
Kubectl binary and kubeconfig file to access kubernetes cluster
Minio deployment
Halyard deployment
Kubernetes cluster Installation in Ubuntu 18.04
Docker is a prerequisite for kubernetes installation. Follow the instructions below to install docker.
Docker Installation
Use the following command to update existing packages.
Install a few prerequisite packages to allow apt to use HTTPS packages.
Add GPG key for official docker repository to the system.
Add docker repository to APT sources.
Update the package database from the newly added repo:
Make sure you install from the Docker repo rather than the default Ubuntu repo.
It will list all of the Docker versions that are available as below.
Use the following command to Install Docker.
Run the following command to see whether Docker is installed or not.
You will see output like below.
Install single node Kubernetes cluster
Follow the steps below to install the single node kubernetes cluster:
Use the following commands to update and upgrade the package list.
Add kubernetes package key.
Run the following command as root user, add kubernetes repository by creating kubernetes repository source list file.
Use vi editor or any other editor to add the following line to the above file.
Update the package list and install the packages to run kubernetes.
Initiate the pod network which is required to communicate. There are several pod networks that can be used. For example, we are using flannel.
You must pass bridged Ipv4 traffic to the iptables chain, this is required for CNI plugins to work. Run the below command.
Run the following command to pass pod network and initialize the same using kubeadm.
After running the above command as root, you should see the below output.
We will run the above commands in the screenshot.
Run the below command to apply the flannel cluster.
The following is the output.
The warnings in the screenshot above will not restrict the pods to come up. Follow the steps below to avoid the warnings.
Run the below command to check pods.
The following is the output.
Check the node as well, as this is a single node kubernetes cluster, and the node will be a master node by default. Run the below command to check the node.
The status in the above screenshot may show as notReady, because the cluster does not schedule pods in the master node by default for security reasons. In that case, run the following command and taint the nodes, which usually resolves the issue.
Setup Kubernetes cloud
You must import/create the attached halyard deployment yaml and minio deployment yaml after setting up the Kubernetes cluster environment. Follow the steps below to get started.
Confirm the kubeconfig file is placed in the ~/.hal folder as config, this will be used to access the kubernetes cluster. Refer to the image below.
Run the following command after you have downloaded/created the deployment yamls mentioned above.
In the above screenshot we have used the command to create a namespace called ‘spinnaker’. Verify that the namespace is created by using # kubectl get namespace as shown below.
Set the config context. Run the following command to check the current-context.
The following is the output:
Use the below command to set this as the current context.
Use the following commands to apply the minio and halyard deployment.
The following is the output.
Use the following command to confirm the deployment.
Use the following command to check the pods for the above deployment.
To make the same kubernetes cluster as the target cloud provider, copy the kubeconfig file to the halyard pod and run the following command.
For example, if you have a namespace say ‘spinnaker’ and a halyard pod named ‘spin-halyard-76557f97d9-5lxp7’, the command will look like below.
Check the tmp folder after logging into halyard pod; the steps to logging into halyard pod are listed below.
Spinnaker configuration using hal commands
Follow the instructions below to configure Spinnaker services using hal commands provided by halyard service.
Run the below command to log in to the halyard pod.
Run the below command to check the configuration.
The following screen appears, displaying the available Spinnaker versions for deployment.
Execute below hal commands to select the Spinnaker version.
Edit Storage providers
You need to edit the storage providers. In this example, we are using s3 as the storage provider. To do so, follow the steps below:
Run the following command.
When prompted for secret-access-key, provide "testingtest". These details are also available in minio-deployment.yml. Also –bucket name is specified as lftestbucket, --bucket: The name of a storage bucket that your specified account has access to. If you don't specify a name, it will be chosen at random. Halyard will create a bucket for you if you specify a globally unique bucket name that doesn't exist yet.
Run the following command.
Run the following command to enable s3 compatible storage. The earlier warnings about deployment failure will be corrected once the storage is edited, as shown in the screenshot below.
Minio doesn’t support versioning objects. Run the below command to disable it in Spinnaker.
Configure target cloud provider, i.e kubernetes and enable the same using the next two commands.
Run the below command to configure the Spinnaker deployment mode.
For Example: hal config deploy edit --type Distributed --account-name k8s-v2-spin --location linuxfoundation.
Configure target cloud provider, i.e kubernetes and enable the same using the next two commandsThe namespace 'linuxfoundation' is the one we created earlier by using the below command.
Run the below command to kick start spinnaker services.
The following appears when the deployment is successful.
Run the below command to kick start spinnaker services.
Note: You will notice pods are coming up on various spinnaker services. It will take some time for all pods to be in running state.
Expose deck and gate endpoints locally to access spinnaker.
Now check spinnaker UI on browser.
Sharing minio-deployment.yml and halyard-deployment.yml details below.
minio-deployment.yml:
halyard-deployment.yml:
Last updated