Skip to content

Commit

Permalink
All steps translated and tested from gcp to Azure
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanfioravanti committed Sep 8, 2017
1 parent 4ca7c45 commit 538bb81
Show file tree
Hide file tree
Showing 15 changed files with 519 additions and 486 deletions.
15 changes: 10 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# Kubernetes The Hard Way
# Kubernetes The Hard Way on Azure

This tutorial walks you through setting up Kubernetes the hard way. This guide is not for people looking for a fully automated command to bring up a Kubernetes cluster. If that's you then check out [Google Container Engine](https://cloud.google.com/container-engine), or the [Getting Started Guides](http://kubernetes.io/docs/getting-started-guides/).
This tutorial is designed for [Microsoft Azure](https://azure.microsoft.com) and [Azure CLI 2.0](https://github.com/azure/azure-cli).
It is a fork of the great [Kubernets The Hard Way](https://github.com/kelseyhightower/kubernetes-the-hard-way) from [Kesley Hightower](https://twitter.com/kelseyhightower) that describes same steps using [Google Cloud Platform](https://cloud.google.com).

Azure part is based on the superb translation done by [Jonathan Carter - @lostintangent](https://twitter.com/LostInTangent) in this [fork](https://github.com/lostintangent/kubernetes-the-hard-way). He is the real man behind the Azure "translation".

This tutorial walks you through setting up Kubernetes the hard way. This guide is not for people looking for a fully automated command to bring up a Kubernetes cluster. If that's you then check out [Azure Container Services](https://azure.microsoft.com/en-us/services/container-service), or the [Getting Started Guides](http://kubernetes.io/docs/getting-started-guides).

Kubernetes The Hard Way is optimized for learning, which means taking the long route to ensure you understand each task required to bootstrap a Kubernetes cluster.

Expand All @@ -14,14 +19,14 @@ The target audience for this tutorial is someone planning to support a productio

Kubernetes The Hard Way guides you through bootstrapping a highly available Kubernetes cluster with end-to-end encryption between components and RBAC authentication.

* [Kubernetes](https://github.com/kubernetes/kubernetes) 1.7.4
* [Kubernetes](https://github.com/kubernetes/kubernetes) 1.7.5
* [CRI-O Container Runtime](https://github.com/kubernetes-incubator/cri-o) v1.0.0-beta.0
* [CNI Container Networking](https://github.com/containernetworking/cni) v0.6.0
* [etcd](https://github.com/coreos/etcd) 3.2.6
* [etcd](https://github.com/coreos/etcd) 3.2.7

## Labs

This tutorial assumes you have access to the [Google Cloud Platform](https://cloud.google.com). While GCP is used for basic infrastructure requirements the lessons learned in this tutorial can be applied to other platforms.
This tutorial assumes you have access to the [Microsoft Azure](https://azure.microsoft.com). While Azure is used for basic infrastructure requirements the lessons learned in this tutorial can be applied to other platforms.

* [Prerequisites](docs/01-prerequisites.md)
* [Installing the Client Tools](docs/02-client-tools.md)
Expand Down
38 changes: 15 additions & 23 deletions docs/01-prerequisites.md
Original file line number Diff line number Diff line change
@@ -1,41 +1,33 @@
# Prerequisites

## Google Cloud Platform
## Microsoft Azure

This tutorial leverages the [Google Cloud Platform](https://cloud.google.com/) to streamline provisioning of the compute infrastructure required to bootstrap a Kubernetes cluster from the ground up. [Sign up](https://cloud.google.com/free/) for $300 in free credits.
This tutorial leverages the [Microsoft Azure](https://azure.microsoft.com) to streamline provisioning of the compute infrastructure required to bootstrap a Kubernetes cluster from the ground up. [Sign up](https://azure.microsoft.com/en-us/free/) for $200 in free credits.

[Estimated cost](https://cloud.google.com/products/calculator/#id=78df6ced-9c50-48f8-a670-bc5003f2ddaa) to run this tutorial: $0.22 per hour ($5.39 per day).
[Estimated cost](https://azure.microsoft.com/en-us/pricing/calculator/) to run this tutorial: $0.4 per hour ($10 per day).

> The compute resources required for this tutorial exceed the Google Cloud Platform free tier.
> The compute resources required for this tutorial will not exceed the Microsoft Azure free tier.
## Google Cloud Platform SDK
## Microsoft Azure Cloud Platform SDK

### Install the Google Cloud SDK
### Install the Microsoft Azure CLI 2.0

Follow the Google Cloud SDK [documentation](https://cloud.google.com/sdk/) to install and configure the `gcloud` command line utility.
Follow the Microsoft Azure CLI 2.0 [documentation](https://github.com/azure/azure-cli#installation) to install and configure the `az` command line utility.

Verify the Google Cloud SDK version is 169.0.0 or higher:
Verify the Microsoft Azure CLI 2.0 version is 2.0.14 or higher:

```shell
az --version
```
gcloud version
```

### Set a Default Compute Region and Zone

This tutorial assumes a default compute region and zone have been configured.
### Create a default Resource Group in a location

Set a default compute region:
The guide assumes you've installed the [Azure CLI 2.0](https://github.com/azure/azure-cli#installation), and will be creating resources in the `westus2` location, within a resource group named `kubernetes`. To create this resource group, simply run the following command:

```
gcloud config set compute/region us-west1
```

Set a default compute zone:

```
gcloud config set compute/zone us-west1-c
```shell
az group create -n kubernetes -l westus2
```

> Use the `gcloud compute zones list` command to view additional regions and zones.
> Use the `az account list-locations` command to view additional locations.
Next: [Installing the Client Tools](02-client-tools.md)
61 changes: 36 additions & 25 deletions docs/02-client-tools.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

In this lab you will install the command line utilities required to complete this tutorial: [cfssl](https://github.com/cloudflare/cfssl), [cfssljson](https://github.com/cloudflare/cfssl), and [kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl).


## Install CFSSL

The `cfssl` and `cfssljson` command line utilities will be used to provision a [PKI Infrastructure](https://en.wikipedia.org/wiki/Public_key_infrastructure) and generate TLS certificates.
Expand All @@ -11,106 +10,118 @@ Download and install `cfssl` and `cfssljson` from the [cfssl repository](https:/

### OS X

```
```shell
wget -q --show-progress --https-only --timestamping \
https://pkg.cfssl.org/R1.2/cfssl_darwin-amd64 \
https://pkg.cfssl.org/R1.2/cfssljson_darwin-amd64
```

```
```shell
chmod +x cfssl_darwin-amd64 cfssljson_darwin-amd64
```

```
```shell
sudo mv cfssl_darwin-amd64 /usr/local/bin/cfssl
```

```
```shell
sudo mv cfssljson_darwin-amd64 /usr/local/bin/cfssljson
```

### Linux

```
```shell
wget -q --show-progress --https-only --timestamping \
https://pkg.cfssl.org/R1.2/cfssl_linux-amd64 \
https://pkg.cfssl.org/R1.2/cfssljson_linux-amd64
```

```
```shell
chmod +x cfssl_linux-amd64 cfssljson_linux-amd64
```

```
```shell
sudo mv cfssl_linux-amd64 /usr/local/bin/cfssl
```

```
```shell
sudo mv cfssljson_linux-amd64 /usr/local/bin/cfssljson
```

### Verification

Verify `cfssl` version 1.2.0 or higher is installed:

```
```shell
cfssl version
```

If this step fails with a runtime error, try installing cfssl following instructions on [CloudFlare's repository](https://github.com/cloudflare/cfssl#installation)

> output
```
```shell
Version: 1.2.0
Revision: dev
Runtime: go1.6
Runtime: go1.9
```

> The cfssljson command line utility does not provide a way to print its version.
```shell
cfssljson -version
```

> output
```shell
Version: 1.2.0
Revision: dev
Runtime: go1.9
```

## Install kubectl

The `kubectl` command line utility is used to interact with the Kubernetes API Server. Download and install `kubectl` from the official release binaries:

### OS X

```
wget https://storage.googleapis.com/kubernetes-release/release/v1.7.4/bin/darwin/amd64/kubectl
```shell
wget https://storage.googleapis.com/kubernetes-release/release/v1.7.5/bin/darwin/amd64/kubectl
```

```
```shell
chmod +x kubectl
```

```
```shell
sudo mv kubectl /usr/local/bin/
```

### Linux

```
wget https://storage.googleapis.com/kubernetes-release/release/v1.7.4/bin/linux/amd64/kubectl
```shell
wget https://storage.googleapis.com/kubernetes-release/release/v1.7.5/bin/linux/amd64/kubectl
```

```
```shell
chmod +x kubectl
```

```
```shell
sudo mv kubectl /usr/local/bin/
```

### Verification

Verify `kubectl` version 1.7.4 or higher is installed:
Verify `kubectl` version 1.7.5 or higher is installed:

```
```shell
kubectl version --client
```

> output
```
Client Version: version.Info{Major:"1", Minor:"7", GitVersion:"v1.7.4", GitCommit:"793658f2d7ca7f064d2bdf606519f9fe1229c381", GitTreeState:"clean", BuildDate:"2017-08-17T08:48:23Z", GoVersion:"go1.8.3", Compiler:"gc", Platform:"darwin/amd64"}
```shell
Client Version: version.Info{Major:"1", Minor:"7", GitVersion:"v1.7.5", GitCommit:"17d7182a7ccbb167074be7a87f0a68bd00d58d97", GitTreeState:"clean", BuildDate:"2017-09-02T18:55:00Z", GoVersion:"go1.9", Compiler:"gc", Platform:"darwin/amd64"}
```

Next: [Provisioning Compute Resources](03-compute-resources.md)
Loading

0 comments on commit 538bb81

Please sign in to comment.