Skip to content

Commit 32fce89

Browse files
author
AC
committed
overhaul
1 parent 3b0f0fe commit 32fce89

File tree

9 files changed

+122
-49
lines changed

9 files changed

+122
-49
lines changed

README.adoc

Lines changed: 18 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,33 @@
77

88
== Requirements
99

10-
* Install Python 3 and PIP
11-
* `sudo dnf install python python-pip`
10+
[.lead]
11+
Requirements to use this project.
12+
13+
* Install Python 3
14+
* Install Python PIP
15+
* Install _Helm_
16+
17+
18+
Install Python 3 and PIP...
19+
20+
[source,bash]
21+
----
22+
sudo dnf install python python-pip
23+
----
1224

1325
Create a Python Virtual Environment.
1426

1527
[source,bash]
1628
----
17-
python3.11 -m venv /z/_tmp/venv_python_311
29+
python3.11 -m venv /z/venv_python_311
1830
----
1931

2032
Enter the Python Virtual Environment.
2133

2234
[source,bash]
2335
----
24-
source /z/_tmp/venv_python311/bin/activate
36+
source /z/venv_python311/bin/activate
2537
----
2638

2739
Install the Python requirements.
@@ -38,28 +50,7 @@ Install the Ansible requirements.
3850
ansible-galaxy collection install -r requirements.yml
3951
----
4052

41-
== Generic resources
42-
43-
:leveloffset: +1
44-
45-
include::awx/README.adoc[]
46-
47-
:leveloffset: -1
53+
== Other considerations
4854

49-
=== Storate Classes
55+
Check the link:./_local_config/README.adoc[`_local_config`] information.
5056

51-
==== Local Storate Class
52-
53-
Create.
54-
55-
[source,bash]
56-
----
57-
$ kubectl apply -f misc/k8s/05-storageclass-local.yaml
58-
----
59-
60-
Delete.
61-
62-
[source,bash]
63-
----
64-
$ kubectl delete -f misc/k8s/05-storageclass-local.yaml
65-
----

kubernetes/README.adoc

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,11 @@
55
:description: This document describes the implementation of different applications.
66
:source-highlighter: highlight.js
77

8-
== Storate Classes
8+
== Storage
9+
10+
* link:./storage/ceph[Ceph]
11+
* link:./storage/host_path[TODO: Host Path]
12+
* link:./storage/iscsi[TODO: iSCSI]
913

1014
=== Local
1115
Create.

kubernetes/storage/ceph/README.adoc

Lines changed: 75 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,33 @@
55
:description: Ceph Storage on Kubernetes
66
:source-highlighter: highlight.js
77

8-
== Intruduction
8+
== Introduction
99

1010
[.lead]
1111
This section describes deploying Ceph storage on Kubernetes.
1212

13+
== Requirements
14+
15+
[.lead]
16+
Requirements to use this section.
17+
18+
* Add the https://ceph.github.io/csi-charts Helm repository
19+
20+
Add the https://ceph.github.io/csi-charts helm repository.
21+
22+
[sourec,bash]
23+
----
24+
helm repo add ceph-csi https://ceph.github.io/csi-charts
25+
----
26+
27+
...and update the _Helm_ repository.
28+
29+
[source,bash]
30+
----
31+
helm repo update
32+
----
33+
34+
1335
== Create Ceph Pool
1436

1537
Create Ceph pool for Kubernetes & client key
@@ -21,6 +43,55 @@ ansible-playbook kubernetes/storage/ceph/ansible/60-proxmox-create-cephfs-pool.y
2143
-e proxmox_host=${PROXMOX_HOST}
2244
----
2345

46+
== Ansible Inventory
47+
48+
.05-storage.yaml
49+
[source,yaml]
50+
----
51+
storage:
52+
children:
53+
ceph_01:
54+
children:
55+
ceph_01_mon:
56+
hosts:
57+
host01:
58+
ceph_monitor_host: "10.10.10.11:6789"
59+
host02:
60+
ceph_monitor_host: "10.10.10.12:6789"
61+
host03:
62+
ceph_monitor_host: "10.10.10.13:6789"
63+
ceph_osd:
64+
hosts:
65+
pve05:
66+
pve06:
67+
pve07:
68+
vars:
69+
ceph_cluster_id: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
70+
----
71+
72+
.15-kubernetes.yaml
73+
[source,yaml]
74+
----
75+
kubernetes:
76+
children:
77+
k8s_cluster_xxxx:
78+
children:
79+
k8s_control_plane:
80+
hosts:
81+
k8s-cp-1:
82+
vars:
83+
k8s_role: control-plane
84+
hw:
85+
ram: 16384 # In MiB
86+
vcpu: 4
87+
storage: 150 # In GiB
88+
vars:
89+
ceph_cluster: ceph_01
90+
ceph_monitor_group: ceph_01_mon
91+
ceph_pool_name: cephfs_data
92+
ceph_fs: cephfs
93+
----
94+
2495
== Collect information
2596

2697
Define environment variables.
@@ -35,12 +106,7 @@ PROXMOX_HOST=<2>
35106

36107
== Using Ceph
37108

38-
Add the https://ceph.github.io/csi-charts helm repository.
39-
40-
[sourec,bash]
41-
----
42-
helm repo add ceph-csi https://ceph.github.io/csi-charts
43-
----
109+
Install _cephfs_.
44110

45111
[sourec,bash]
46112
----
@@ -49,6 +115,8 @@ ansible-playbook kubernetes/storage/ceph/ansible/05-setup-ceph-csi-cephfs.yaml \
49115
-e ceph_admin_key=${CEPH_ADM_KEY}
50116
----
51117

118+
Uninstall _cephfs_.
119+
52120
[sourec,bash]
53121
----
54122
ansible-playbook kubernetes/storage/ceph/ansible/09-remove-ceph-csi-cephfs.yaml \

kubernetes/storage/ceph/ansible/05-setup-ceph-csi-cephfs.yaml

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,6 @@
44
gather_facts: "{{ gathering_host_info | default('true') | bool == true }}"
55

66
tasks:
7-
# - name: "Check if PVC information"
8-
# ansible.builtin.debug:
9-
# msg:
10-
# # - "{{ groups }}"
11-
# # - "{{ groups['k8s_cluster_k8s'] }} "
12-
# - "{{ hostvars[groups['k8s_cluster_k8s'][0]] }} "
13-
# - "{{ hostvars[groups['k8s_cluster_k8s'][0]]['ceph_monitor_group'] }}"
14-
# - "{{ groups[hostvars[groups['k8s_cluster_k8s'][0]]['ceph_monitor_group']] }} "
15-
# - "{{ hostvars['pve05']['ceph_monitor_host'] }}"
16-
# - "clusterID: {{ hostvars[groups['k8s_cluster_k8s'][0]]['ceph_cluster'] }}"
17-
# - "clusterID: {{ hostvars[groups[hostvars[groups['k8s_cluster_k8s'][0]]['ceph_cluster']][0]]['ceph_cluster_id'] }}"
18-
# - "pool: {{ hostvars[groups['k8s_cluster_k8s'][0]]['ceph_pool_name'] }}"
19-
207
- name: Create a k8s namespace
218
kubernetes.core.k8s:
229
name: "{{ ceph_ns }}"

kubernetes/storage/ceph/ansible/templates/helm-ceph-csi-cephfs.yaml.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ storageClass:
338338
# pool: <cephfs-data-pool>
339339
# For eg:
340340
# pool: "replicapool"
341-
pool: "{{ hostvars[groups['k8s_cluster_k8s'][0]]['ceph_pool_name'] }}"
341+
# pool: "{{ hostvars[groups['k8s_cluster_k8s'][0]]['ceph_pool_name'] }}"
342342
# (optional) Comma separated string of Ceph-fuse mount options.
343343
# For eg:
344344
# fuseMountOptions: debug

kubernetes/storage/storageclass/05-storageclass-local.yaml renamed to kubernetes/storage/host_path/05-storageclass-local.yaml

File renamed without changes.

kubernetes/storage/storageclass/05-storageclass-manual-iscsi.yaml renamed to kubernetes/storage/iscsi/05-storageclass-manual-iscsi.yaml

File renamed without changes.

kubernetes/storage/storageclass/05-storageclass-iscsi.yaml renamed to kubernetes/storage/iscsi/conf/05-storageclass-iscsi.yaml

File renamed without changes.

proxmox/ceph/README.adoc

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
= Ceph on Proxmox
2+
:author: A. Costa
3+
:email: <ac (at) trikorasolutions (dot) com>
4+
// :Date: 20210222
5+
:Revision: 1
6+
:toc: left
7+
:toc-title: Table of Contents
8+
:icons: font
9+
:description: Ceph on Proxmox
10+
:source-highlighter: highlight.js
11+
12+
13+
== Add Monitor
14+
15+
[source,bash]
16+
----
17+
pveceph createmon --mon-address <ip_address><1>
18+
----
19+
<1> The IP Address is required when the host contains multiple NIC.
20+
21+
== References
22+
23+
* https://docs.fedoraproject.org/en-US/fedora-server/virtualization/vm-install-diskimg-proxmox/

0 commit comments

Comments
 (0)