Kubernetes

Let's look at our k8s_cluster.yaml file:

apiVersion: kops/v1alpha2
kind: Cluster
metadata:
creationTimestamp: 2018-05-01T12:11:24Z
name: $NAME
spec:
api:
loadBalancer:
type: Public
authorization:
rbac: {}
channel: stable
cloudProvider: aws
configBase: $KOPS_STATE_STORE/$NAME
etcdClusters:
- etcdMembers:
- instanceGroup: master-$ZONE
name: b
name: main
- etcdMembers:
- instanceGroup: master-$ZONE
name: b
name: events
iam:
allowContainerRegistry: true
legacy: false
kubernetesApiAccess:
- 0.0.0.0/0
kubernetesVersion: 1.9.3
masterInternalName: api.internal.$NAME
masterPublicName: api.hodlgo.$NAME
networkCIDR: 172.20.0.0/16
networking:
kubenet: {}
nonMasqueradeCIDR: 100.64.0.0/10
sshAccess:
- 0.0.0.0/0
subnets:
- cidr: 172.20.32.0/19
name: $ZONE
type: Public
zone: $ZONE
topology:
dns:
type: Public
masters: public
nodes: public

Let's look at our k8s_master.yaml file:

apiVersion: kops/v1alpha2
kind: InstanceGroup
metadata:
creationTimestamp: 2018-05-01T12:11:25Z
labels:
kops.k8s.io/cluster: $NAME
name: master-$ZONE
spec:
image: kope.io/k8s-1.8-debian-jessie-amd64-hvm-ebs-2018-02-08
machineType: $MASTERTYPE
maxSize: 1
minSize: 1
nodeLabels:
kops.k8s.io/instancegroup: master-$ZONE
role: Master
subnets:
- $ZONE

Let's look at our k8s_nodes.yaml file:

apiVersion: kops/v1alpha2
kind: InstanceGroup
metadata:
creationTimestamp: 2018-05-01T12:11:25Z
labels:
kops.k8s.io/cluster: $NAME
name: nodes-$ZONE
spec:
image: kope.io/k8s-1.8-debian-jessie-amd64-hvm-ebs-2018-02-08
machineType: $SLAVETYPE
maxSize: $SLAVES
minSize: $SLAVES
nodeLabels:
kops.k8s.io/instancegroup: nodes-$ZONE
role: Node
subnets:
- $ZONE

These templates will be fed into Kubernetes in order to spin up our cluster. The tool we will use to deploy the cluster and associated AWS resources is KOPS. At the time of writing the current version of this tool is 1.12.1, and all deployments have been tested with this version; earlier versions may have compatibility issues.

First, we need to install KOPS. As with all our previous examples, these steps also apply to macOS. We use the Homebrew tool to manage dependencies and keep the installation localized and sane:

#brew install kops
==> Installing dependencies for kops: kubernetes-cli
==> Installing kops dependency: kubernetes-cli
==> Downloading https://homebrew.bintray.com/bottles/kubernetes-cli-1.14.2.mojave.bottle.tar.gz
==> Downloading from https://akamai.bintray.com/85/858eadf77396e1acd13ddcd2dd0309a5eb0b51d15da275b491
######################################################################## 100.0%
==> Pouring kubernetes-cli-1.14.2.mojave.bottle.tar.gz
==> Installing kops
==> Downloading https://homebrew.bintray.com/bottles/kops-1.12.1.mojave.bottle.tar.gz
==> Downloading from https://akamai.bintray.com/86/862c5f6648646840c75172e2f9f701cb590b04df03c38716b5
######################################################################## 100.0%
==> Pouring kops-1.12.1.mojave.bottle.tar.gz
==> Caveats
Bash completion has been installed to:
/usr/local/etc/bash_completion.d

zsh completions have been installed to:
/usr/local/share/zsh/site-functions
==> Summary
/usr/local/Cellar/kops/1.12.1: 5 files, 139.2MB
==> Caveats
==> kubernetes-cli
Bash completion has been installed to:
/usr/local/etc/bash_completion.d

zsh completions have been installed to:
/usr/local/share/zsh/site-functions
==> kops
Bash completion has been installed to:
/usr/local/etc/bash_completion.d

zsh completions have been installed to:
/usr/local/share/zsh/site-functions

We can see that KOPS has been installed, along with kubectl, which is the default K8s cluster-management tool that interacts directly with the API. Note that Homebrew often spits out warning-type messages regarding command completion, and it is safe to ignore these; however, if you get an error regarding the configuration of symlinks, follow the instructions to resolve conflicts with any existing local installation of kubectl.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.119.253.31