You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* add package json file
* Update statefulSet lab
* EBS-CSI-DRIVER is now installed using HELM
* using IRSA for the driver
* update the number of mysql pods due to t3 machines instead of m5
* update pictures
* Cosmetic changes based on linter
* Except for statefulset, move from downloading YAML file to create them
inline
* delete all unused files
Co-authored-by: Frederic Medery <[email protected]>
Copy file name to clipboardexpand all lines: content/beginner/170_statefulset/_index.md
+2-1
Original file line number
Diff line number
Diff line change
@@ -10,9 +10,10 @@ tags:
10
10
# Stateful containers using StatefulSets
11
11
12
12
[StatefulSet](https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/) manages the deployment and scaling of a set of Pods, and provides guarantees about the ordering and uniqueness of these Pods, suitable for applications that require one or more of the following.
13
+
13
14
* Stable, unique network identifiers
14
15
* Stable, persistent storage
15
16
* Ordered, graceful deployment and scaling
16
17
* Ordered, automated rolling updates
17
18
18
-
In this Chapter, we will review how to deploy MySQL database using `StatefulSet` and `Amazon Elastic Block Store` (EBS) as [PersistentVolume](https://kubernetes.io/docs/concepts/storage/persistent-volumes/). The example is a MySQL single leader topology with multiple followers running asynchronous replication.
19
+
In this Chapter, we will review how to deploy MySQL database using `StatefulSet` and `Amazon Elastic Block Store` (EBS) as [PersistentVolume](https://kubernetes.io/docs/concepts/storage/persistent-volumes/). The example is a MySQL single leader topology with a follower running asynchronous replication.
Copy file name to clipboardexpand all lines: content/beginner/170_statefulset/configmap.md
+20-21
Original file line number
Diff line number
Diff line change
@@ -4,32 +4,26 @@ date: 2018-08-07T08:30:11-07:00
4
4
weight: 10
5
5
---
6
6
7
-
#### Introduction
8
-
[ConfigMap](https://kubernetes.io/docs/tasks/configure-pod-container/configure-pod-configmap/) allow you to decouple configuration artifacts and secrets from image content to keep containerized applications portable. Using ConfigMap, you can independently control MySQL configuration.
7
+
## Introduction
8
+
9
+
[ConfigMap](https://kubernetes.io/docs/tasks/configure-pod-container/configure-pod-configmap/) allow you to decouple configuration artifacts and secrets from image content to keep containerized applications portable. Using ConfigMap, you can independently control MySQL configuration.
10
+
11
+
## Create the mysql Namespace
9
12
10
-
#### Create the mysql Namespace
11
13
We will create a new `Namespace` called `mysql` that will host all the components.
14
+
12
15
```sh
13
16
kubectl create namespace mysql
14
17
```
15
18
16
-
#### Create ConfigMap
17
-
Run the following commands to download the `ConfigMap`.
Run the following commands to download the `ConfigMap`.
23
22
24
-
Check the configuration of mysql-configmap.yml file.
25
23
```sh
26
-
cat ~/environment/templates/mysql-configmap.yml
27
-
```
24
+
cd${HOME}/environment/ebs_statefulset
28
25
29
-
The `ConfigMap` stores master.cnf, slave.cnf and passes them when initializing leader and follower pods defined in StatefulSet:
30
-
***master.cnf** is for the MySQL leader pod which has binary log option (log-bin) to provides a record of the data changes to be sent to follower servers.
31
-
***slave.cnf** is for follower pods which have super-read-only option.
The `ConfigMap` stores `master.cnf`, `slave.cnf` and passes them when initializing leader and follower pods defined in StatefulSet:
47
+
48
+
***master.cnf** is for the MySQL leader pod which has binary log option (log-bin) to provides a record of the data changes to be sent to follower servers.
49
+
***slave.cnf** is for follower pods which have super-read-only option.
Copy file name to clipboardexpand all lines: content/beginner/170_statefulset/ebs_csi_driver.md
+62-33
Original file line number
Diff line number
Diff line change
@@ -4,79 +4,108 @@ title: "Amazon EBS CSI Driver"
4
4
date: 2020-02-23T13:57:00-08:00
5
5
weight: 4
6
6
---
7
+
## About Container Storage Interface (CSI)
8
+
9
+
[The Container Storage Interface](https://github.com/container-storage-interface/spec/blob/master/spec.md) (CSI) is a standard for exposing arbitrary block and file storage systems to containerized workloads on Container Orchestration Systems (COs) like Kubernetes.
10
+
11
+
Using CSI third-party storage providers can write and deploy plugins exposing new storage systems in Kubernetes without ever having to touch the core Kubernetes code.
7
12
8
13
## About the Amazon EBS CSI Driver
9
14
10
-
On Amazon EKS, the open-source [EBS Container Storage Interface (CSI)
11
-
driver](https://github.com/kubernetes-sigs/aws-ebs-csi-driver) is used to manage
12
-
the attachment of Amazon EBS block storage volumes to Kubernetes Pods.
15
+
The [Amazon Elastic Block Store (Amazon EBS) Container Storage Interface (CSI) driver](https://github.com/kubernetes-sigs/aws-ebs-csi-driver) provides a CSI interface that allows Amazon Elastic Kubernetes Service (Amazon EKS) clusters to manage the lifecycle of Amazon EBS volumes for persistent volumes.
16
+
17
+
This topic shows you how to deploy the Amazon EBS CSI Driver to your Amazon EKS cluster and verify that it works.
13
18
14
19
## Configure IAM Policy
15
20
16
-
The CSI driver is deployed as set of Kubernetes Pods. These Pods must have
17
-
permission to perform EBS API operations, such as creating and deleting volumes,
18
-
and attaching volumes to the EC2 worker nodes that comprise the cluster.
21
+
The CSI driver is deployed as set of Kubernetes Pods. These Pods must have permission to perform EBS API operations, such as creating and deleting volumes, and attaching volumes to the EC2 worker nodes that comprise the cluster.
19
22
20
23
First, let's download the policy JSON document, and create an IAM Policy from it:
export EBS_CSI_POLICY_ARN=$(aws --region ${AWS_REGION} iam list-policies --query 'Policies[?PolicyName==`'$EBS_CSI_POLICY_NAME'`].Arn' --output text)
35
42
```
36
43
37
44
## Configure IAM Role for Service Account
38
45
39
-
Next, we'll ask `eksctl`to create an IAM Role that contains the IAM Policy we
40
-
created, and associate it with a Kubernetes Service Account called
41
-
`ebs-csi-controller-irsa` that will be used by the CSI Driver:
46
+
You can associate an IAM role with a Kubernetes service account. This service account can then provide AWS permissions to the containers in any pod that uses that service account. With this feature, you no longer need to provide extended permissions to the Amazon EKS node IAM role so that pods on that node can call AWS APIs.
47
+
48
+
We'll ask `eksctl` to create an IAM Role that contains the IAM Policy we just created, and associate it with a Kubernetes Service Account called `ebs-csi-controller-irsa` that will be used by the CSI Driver:
0 commit comments