Skip to content

Commit

Permalink
Merge pull request #191 from epiphany-platform/releases/v0.2.2
Browse files Browse the repository at this point in the history
Release v0.2.2
  • Loading branch information
toszo authored Mar 29, 2019
2 parents 2eee19f + 0c4dc0f commit b209d9a
Show file tree
Hide file tree
Showing 15 changed files with 200 additions and 28 deletions.
16 changes: 16 additions & 0 deletions CHANGELOG-0.2.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
# Changelog 0.2

## [0.2.2] 2019-03-29

### Added

- Documentation for manual upgrade Kubernetes from 1.13.0 to 1.13.1 [link](./docs/home/HOWTO.md#how-to-upgrade-kubernetes-cluster-from-1130-to-1131)

### Changed

- Kubernetes version 1.13.1 #178
- Docker version for RedHat to 18.06

### Fixed

- Workaround issue where [Kubelet depends on kubernetes-cni 0.6.0](https://github.com/kubernetes/kubernetes/issues/75683) #177
- Fix Kafka url #183

## [0.2.1] 2019-03-07

### Fixed
Expand Down
11 changes: 9 additions & 2 deletions core/core/src/ansible/roles/docker/tasks/RedHat.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
---
- name: Add Docker-CE stable repo
yum_repository:
name: docker-ce-stable
description: Docker CE Stable Repo
baseurl: https://download.docker.com/linux/centos/7/$basearch/stable
gpgkey: https://download.docker.com/linux/centos/gpg
gpgcheck: yes

- name: Install Docker
yum:
name: docker
name: docker-ce-18.06.3.ce-3.el7
state: present
update_cache: yes
when: ansible_os_family == "RedHat"
8 changes: 0 additions & 8 deletions core/core/src/ansible/roles/docker/tasks/configure-docker.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,4 @@
---
- name: Unset log driver if defined in /etc/sysconfig/docker
replace: # remove --log-driver=driver-name to configure log-driver in daemon.json
path: /etc/sysconfig/docker
regexp: '^(OPTIONS=.*?)(?:--log-driver=[\w|-]+\s*|\s+--log-driver=[\w|-]+)(.*)$'
replace: '\1\2'
notify: Restart Docker
when: ansible_os_family == "RedHat"

- name: Copy configuration file (daemon.json)
template:
src: daemon.json.j2
Expand Down
4 changes: 2 additions & 2 deletions core/core/src/ansible/roles/kafka/tasks/setup-kafka.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
stat:
path: "/tmp/kafka_{{ kafka_var.scala.version }}-{{ kafka_var.version }}.tgz"
register: kafka_check

- name: Fetch Kafka binary package
get_url:
url: "http://apache.mirrors.tds.net/kafka/{{ kafka_var.version }}/kafka_{{ kafka_var.scala.version }}-{{ kafka_var.version }}.tgz"
url: "https://archive.apache.org/dist/kafka/{{ kafka_var.version }}/kafka_{{ kafka_var.scala.version }}-{{ kafka_var.version }}.tgz"
dest: "/tmp/kafka_{{ kafka_var.scala.version }}-{{ kafka_var.version }}.tgz"
when: not kafka_check.stat.exists

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,21 @@
- samba-common
when: kubernetes.storage.enable == True

- name: Install RedHat family packages
- name: Install Kubernetes packages for RedHat family
yum:
name:
- kubernetes-cni-0.6.0-0 # todo remove it in future release
- kubelet-{{kubernetes.version}}
- kubectl-{{kubernetes.version}}
- kubeadm-{{kubernetes.version}}
update_cache: yes
state: present
when: ansible_os_family == "RedHat"

- name: Install Debian family packages
- name: Install Kubernetes packages for Debian family
apt:
name:
- kubernetes-cni=0.6.0-00 # todo remove it in future release
- kubelet={{kubernetes.version}}-00
- kubectl={{kubernetes.version}}-00
- kubeadm={{kubernetes.version}}-00
Expand Down
2 changes: 1 addition & 1 deletion core/core/src/templates/common/manifest.yaml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ nodes:
{%- endfor %}

kubernetes:
version: 1.13.0 #latest
version: 1.13.1
storage:
enable: {{ core.kubernetes.storage.enable }}
type: {{ core.kubernetes.storage.type }}
Expand Down
4 changes: 2 additions & 2 deletions core/data/azure/infrastructure/epiphany-bld-apps/data.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
title: Epiphany Apps Infrastructure...

kind: datafile
version: 0.2.0
version: 0.2.2

# NOTE: Any data values that are empty put "" or the value None will be used in the templates for those attributes.

Expand Down Expand Up @@ -1128,7 +1128,7 @@ core:


kubernetes:
version: 1.13.0
version: 1.13.1
# image_registry_secrets:
# - name: regcred
# server_url: your-registry-url
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Simplified datafile that you can use together with template (see README.md in this folder).
# Change values according to your needs, start with generating ssh keys and placing them in the directory "keys_directory". Do not forget to update "keys_directory" as well.
kind: simplified-datafile
version: 0.2.0
version: 0.2.2
environment_name: Playground
azure:
subscription_name: YOUR-SUBSCRIPTION-NAME
Expand Down
6 changes: 3 additions & 3 deletions core/data/azure/infrastructure/epiphany-template/data.yaml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
title: Epiphany ({{ azure.image_offer }}) {{ environment_name }}

kind: datafile
version: 0.2.0
version: 0.2.2

# NOTE: Any data values that are empty put "" or the value None will be used in the templates for those attributes.

Expand All @@ -27,7 +27,7 @@ core:

build:
# IMPORTANT - will be appended to release name and output folder and part of the template names
version: &version 0.1.21
version: &version 0.2.2
# Type of build environment
environment: &env development
# Name of the given release. Version will be appended
Expand Down Expand Up @@ -1167,7 +1167,7 @@ core:
{% endif %}

kubernetes:
version: 1.13.0
version: 1.13.1
# image_registry_secrets:
# - name: regcred
# server_url: your-registry-url
Expand Down
2 changes: 1 addition & 1 deletion core/data/metal/epiphany-lab/data.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ nodes:
private: 192.168.1.66

kubernetes:
version: 1.13.0
version: 1.13.1
storage:
enable: False

Expand Down
2 changes: 1 addition & 1 deletion core/data/metal/single-machine/data.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ nodes:
private: 192.168.1.2

kubernetes:
version: 1.13.0
version: 1.13.1
#image_registry_secrets:
# - name: regcred
# server_url: your-registry-url
Expand Down
2 changes: 1 addition & 1 deletion core/data/vmware/epiphany-lab/data.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ nodes:
private: 192.168.1.66

kubernetes:
version: 1.13.0
version: 1.13.1
storage:
enable: False

Expand Down
2 changes: 1 addition & 1 deletion core/manifest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# This data is for the core of Epiphany and not the data for a given environment.

name: Epiphany
version: 0.2.0
version: 0.2.2

# Set the proxy info up if your environment requires it. This is sometimes the case for on-premise builds/installs
proxy:
Expand Down
2 changes: 1 addition & 1 deletion core/version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,5 @@ set -e
unset EPIPHANY_VERSION
unset EPIPHANY_VERSION_NAME

export EPIPHANY_VERSION="0.2.0"
export EPIPHANY_VERSION="0.2.2"
export EPIPHANY_VERSION_NAME="Epiphany"
159 changes: 157 additions & 2 deletions docs/home/HOWTO.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@
- [How to run chaos on Epiphany Kubernetes cluster and monitor it with Grafana](#how-to-run-chaos-on-epiphany-kubernetes-cluster-and-monitor-it-with-grafana)
- [How to tunnel Kubernetes dashboard from remote kubectl to your PC](#how-to-tunnel-kubernetes-dashboard-from-remote-kubectl-to-your-pc)
- [How to setup Azure VM as docker machine for development](#how-to-setup-azure-vm-as-docker-machine-for-development)
- [How to upgrade Kubernetes cluster](#how-to-upgrade-kubernete-cluster)
- [How to upgrade Kubernetes cluster](#how-to-upgrade-kubernetes-cluster)
- [How to upgrade Kubernetes cluster from 1.13.0 to 1.13.1](#how-to-upgrade-kubernetes-cluster-from-1130-to-1131)
- [How to authenticate to Azure AD app](#how-to-authenticate-to-azure-ad-app)
- [How to expose service through HA Proxy load balancer](#how-to-expose-service-lb)
- Security
Expand Down Expand Up @@ -786,14 +787,168 @@ Upgrade procedure might be different for each Kubernetes version. Upgrade shall
Each version can be upgraded in a bit different way, to find information how to upgrade your version of Kubernetes please use this [guide](https://kubernetes.io/docs/reference/setup-tools/kubeadm/kubeadm-upgrade/#kubeadm-upgrade-guidance).
Epiphany use kubeadm to boostrap a cluster and same tool shall be used to upgrade it.
Epiphany uses kubeadm to boostrap a cluster and the same tool is also used to upgrade it.
Upgrading Kubernetes cluster with running applications shall be done step by step. To prevent your applications downtime you should use at least **two Kubernetes worker nodes** and at least **two instances of each of your service**.
Start cluster upgrade with upgrading master node. Detailed instructions how to upgrade each node, including master, are described in guide linked above. When Kubernetes master is down it does not affect running applications, at this time only control plane is not operating. **Your services will be running but will not be recreated nor scaled when control plane is down.**
Once master upgrade finished successfully, you shall start upgrading nodes - **one by one**. Kubernetes master will notice when worker node is down and it will instatiate services on existing operating node, that is why it is essential to have more than one worker node in cluster to minimize applications downtime.
## How to upgrade Kubernetes cluster from 1.13.0 to 1.13.1
Detailed instruction can be found in [Kubernetes upgrade to 1.13 documentation](https://kubernetes.io/docs/tasks/administer-cluster/kubeadm/kubeadm-upgrade-1-13/)
### Ubuntu Server
#### Upgrade Master
```bash
# RUN ON MASTER
1. sudo kubeadm version # should show v1.13.0
2. sudo kubeadm upgrade plan v1.13.1
3. apt update
4. apt-cache policy kubeadm
5. sudo apt-mark unhold kubeadm && \
sudo apt-get update && sudo apt-get install -y kubeadm=1.13.1-00 && \
sudo apt-mark hold kubeadm
6. sudo kubeadm version # should show v1.13.1
7. sudo kubeadm upgrade plan v1.13.1
8. sudo kubeadm upgrade apply v1.13.1
9. sudo apt-mark unhold kubelet && \
sudo apt-get update && sudo apt-get install -y kubelet=1.13.1-00 && \
sudo apt-mark hold kubelet
```
#### Upgrade Worker Nodes
Commands below should be run in context of each node in the cluster. Variable `$NODE` represents node name (node names can be retrieved by command `kubectl get nodes` on master)
Worker nodes will be upgraded one by one - it will prevent application downtime.
```bash
# RUN ON WORKER NODE - $NODE
1. sudo apt-mark unhold kubectl && \
sudo apt-get update && sudo apt-get install -y kubectl=1.13.1-00 && \
sudo apt-mark hold kubectl
# RUN ON MASTER
2. kubectl drain $NODE --ignore-daemonsets
# RUN ON WORKER NODE - $NODE
3. sudo kubeadm upgrade node config --kubelet-version v1.13.1
4. sudo apt-get update
5. sudo apt-get install -y kubelet=1.13.1-00 kubeadm=1.13.1-00
6. sudo systemctl restart kubelet
7. sudo systemctl status kubelet # should be running
# RUN ON MASTER
8. kubectl uncordon $NODE
9. # go to 1. for next node
# RUN ON MASTER
10. kubectl get nodes # should return nodes in status "Ready" and version 1.13.1
```
### RHEL
#### Upgrade Docker version
Upgrading Kubernetes to 1.13.1 on RHEL requires Docker upgrade. Newer Docker packages exist in docker-ce repository but you can use newer Docker-ee if you need. Verified Docker versions for Kubernetes are: 1.11.1, 1.12.1, 1.13.1, 17.03, 17.06, 17.09, 18.06. [Go to K8s docs](https://github.com/kubernetes/kubernetes/blob/master/CHANGELOG-1.13.md#external-dependencies)
```bash
# Remove previous docker version
1 sudo yum remove docker \
docker-common \
container-selinux \
docker-selinux \
docker-engine
2. sudo rm -rf /var/lib/docker
3. sudo rm -rf /run/docker
4. sudo rm -rf /var/run/docker
5. sudo rm -rf /etc/docker
# Add docker-ce repository
6. sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
7. sudo yum makecache fast
8. sudo yum -y install docker-ce-18.06.3.ce-3.el7
```
#### Upgrade Master
```bash
# RUN ON MASTER
1. sudo kubeadm version # should show v1.13.0
2. sudo kubeadm upgrade plan v1.13.1
3. sudo yum install -y kubeadm-1.13.1-0 --disableexcludes=kubernetes
4. sudo kubeadm version # should show v1.13.1
5. sudo kubeadm upgrade plan v1.13.1
6. sudo kubeadm upgrade apply v1.13.1
7. sudo yum install -y kubelet-1.13.1-0 --disableexcludes=kubernetes
```
#### Upgrade Worker Nodes
Commands below should be run in context of each node in the cluster. Variable `$NODE` represents node name (node names can be retrieved by command `kubectl get nodes` on master)
Worker nodes will be upgraded one by one - it will prevent application downtime.
```bash
# RUN ON WORKER NODE - $NODE
1. yum install -y kubectl-1.13.1-0 --disableexcludes=kubernetes
# RUN ON MASTER
2. kubectl drain $NODE --ignore-daemonsets
# RUN ON WORKER NODE - $NODE
3. # Upgrade Docker version using instruction from above
4. sudo kubeadm upgrade node config --kubelet-version v1.13.1
5. sudo yum install -y kubelet-1.13.1-0 kubeadm-1.13.1-0 --disableexcludes=kubernetes
6. sudo systemctl restart kubelet
7. sudo systemctl status kubelet # should be running
# RUN ON MASTER
8. kubectl uncordon $NODE
9. # go to 1. for next node
# RUN ON MASTER
10. kubectl get nodes # should return nodes in status "Ready" and version 1.13.1
```
## How to upgrade Kafka cluster
### Kafka upgrade
Expand Down

0 comments on commit b209d9a

Please sign in to comment.