https://github.com/sadok-f/k8s-2
https://github.com/sadok-f/k8s-2
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/sadok-f/k8s-2
- Owner: sadok-f
- Created: 2019-04-30T08:25:47.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2019-04-30T08:58:18.000Z (about 6 years ago)
- Last Synced: 2025-02-01T13:26:25.368Z (4 months ago)
- Size: 4.88 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# k8s
## Tutorial Objective:
- [x] Create a Kubernetes cluster
- [x] Install Helm
- [x] Deploy spinnaker
- [ ] Deploy istio
- [ ] Demonstrate the deployment of an example application (micro-services) with automatic canary analysis
- [ ] Configuration of request routing in Istio.## Create a Kubernetes cluster
Following the tutorial from @kelseyhightower [Kubernetes The Hard Way](https://github.com/kelseyhightower/kubernetes-the-hard-way).
In order to setup GCE as cloud provider for the final cluster, this changes need to be done:
- In the 3rd step (Provisioning Compute Resources), change the instance type for the workers from `n1-standard-1` to `n1-standard-2`
- Add `--cloud-provider=gce` for the services kube-apiserver (/etc/systemd/system/kube-apiserver.service),kube-controller-manager (/etc/systemd/system/kube-controller-manager.service) and kubelet (/etc/systemd/system/kubelet.service)
- Add `--hostname-override=worker-X` for each kubelet service in the workers (replace X by the number of the worker such as 0, 1, 2)
- Add a standard `StorageClass` ressource to the cluster with `provisioner: kubernetes.io/gce-pd`:
```
cat < 3d15h v1.12.0
worker-1 Ready 3d15h v1.12.0
worker-2 Ready 3d15h v1.12.0
```## Install Helm
Install Helm in local MacOs
```
brew install kubernetes-helm
```Create the necessary roles for Helm
```
kubectl create clusterrolebinding user-admin-binding --clusterrole=cluster-admin --user=$(gcloud config get-value account)kubectl create serviceaccount tiller --namespace kube-system
kubectl create clusterrolebinding tiller-admin-binding --clusterrole=cluster-admin --serviceaccount=kube-system:tiller
kubectl create clusterrolebinding --clusterrole=cluster-admin --serviceaccount=default:default spinnaker-admin
```Initialize Helm
```
helm init --service-account=tiller --upgradehelm repo update
```## Install Spinnaker
```
export PROJECT=$(gcloud info --format='value(config.project)')export BUCKET=$PROJECT-spinnaker-config
gsutil mb -c regional -l europe-west3 gs://$BUCKET
export SA_JSON=$(cat spinnaker-sa.json)
export PROJECT=$(gcloud info --format='value(config.project)')
export BUCKET=$PROJECT-spinnaker-config
cat > spinnaker-config.yaml <