forked from gluster/gcs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
deploy: Deploy glusterd2-cluster as individual StatefulSets
Using single-replica StatefulSets for each glusterd2 pod instead of a single DaemonSet, allows setting up of and use of pre-known hostnames as the listen address for glusterd2. The StatefulSets are pinned to individual nodes. Also, the glusterd2 pods are now deployed with 'emptyDir' volumes for /var/lib/glusterd2 which allows persistence of peerid. With the above 2 changes, glusterd2 pods survive pod restarts. Fixes gluster#10, gluster#11 Signed-off-by: Kaushal M <kshlmster@gmail.com>
- Loading branch information
Showing
10 changed files
with
183 additions
and
87 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
## This file is included as a loop from the add-devices playbook | ||
--- | ||
- name: Add device | Set facts | ||
set_fact: | ||
peer_id: "{{ peer.id }}" | ||
kube_hostname: "{{ peer.name.split('-')[0]}}" | ||
|
||
- name: Add device | Register devices for {{ kube_hostname }} | ||
uri: | ||
url: "{{ gd2_client_endpoint }}/v1/devices/{{ peer_id }}" | ||
method: POST | ||
body: "{ \"device\": \"{{ disk }}\"}" | ||
body_format: json | ||
loop: "{{ hostvars[kube_hostname].gcs_disks }}" | ||
loop_control: | ||
loop_var: disk |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
## This file is included as a loop from the deploy-gcs playbook | ||
--- | ||
- name: GCS Pre | Manifests | Create GD2 manifests for {{ gcs_node }} | Set fact kube_hostname | ||
set_fact: | ||
kube_hostname: "{{ gcs_node }}" | ||
|
||
- name: GCS Pre | Manifests | Create GD2 manifests for {{ gcs_node }} | Create gcs-gd2-{{ gcs_node }}.yml | ||
template: | ||
src: "gcs-manifests/gcs-gd2.yml.j2" | ||
dest: "{{ manifests_dir }}/gcs-gd2-{{ gcs_node }}.yml" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
## This file is included as a loop from the deploy-gcs playbook | ||
--- | ||
- name: GCS | GD2 Cluster | Set fact kube_hostname | ||
set_fact: | ||
kube_hostname: "{{ gcs_node }}" | ||
|
||
- name: GCS | GD2 Cluster | Deploy glusterd2 on {{ gcs_node }} | ||
kube: | ||
kubectl: "{{ kubectl }}" | ||
file: "{{ manifests_dir }}/gcs-gd2-{{ gcs_node }}.yml" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
--- | ||
# Headless service for GD2 Stateful sets | ||
kind: Service | ||
apiVersion: v1 | ||
metadata: | ||
name: glusterd2 | ||
namespace: {{ gcs_namespace }} | ||
labels: | ||
gcs: glusterd2-service | ||
spec: | ||
clusterIP: None | ||
selector: | ||
gcs: glusterd2 | ||
gcs/glusterd2: app | ||
ports: | ||
- name: clientport | ||
protocol: TCP | ||
port: 24007 | ||
targetPort: 24007 | ||
- name: peerport | ||
protocol: TCP | ||
port: 24008 | ||
targetPort: 24008 | ||
|
||
--- | ||
# Client service for the CSI driver | ||
kind: Service | ||
apiVersion: v1 | ||
metadata: | ||
name: glusterd2-client | ||
namespace: {{ gcs_namespace }} | ||
labels: | ||
gcs: glusterd2-service | ||
spec: | ||
selector: | ||
gcs: glusterd2 | ||
gcs/glusterd2: app | ||
ports: | ||
- name: clientport | ||
protocol: TCP | ||
port: 24007 | ||
targetPort: 24007 | ||
|
||
--- | ||
# Nodeport service for access to GD2 from outside the cluster | ||
# TODO: Do not enable by default | ||
kind: Service | ||
apiVersion: v1 | ||
metadata: | ||
name: glusterd2-client-nodeport | ||
namespace: {{ gcs_namespace }} | ||
labels: | ||
gcs: glusterd2-service | ||
spec: | ||
selector: | ||
gcs: glusterd2 | ||
gcs/glusterd2: app | ||
ports: | ||
- name: clientport | ||
protocol: TCP | ||
port: 24007 | ||
targetPort: 24007 | ||
nodePort: 31007 | ||
type: NodePort |
Oops, something went wrong.