Skip to content

Commit

Permalink
Feature/rook ceph storage additions (#3064)
Browse files Browse the repository at this point in the history
* rook/ceph: add default values in epiphany configuration
  • Loading branch information
cicharka committed Apr 11, 2022
1 parent 6d5f583 commit 17c49af
Show file tree
Hide file tree
Showing 3 changed files with 447 additions and 24 deletions.
30 changes: 9 additions & 21 deletions ansible/playbooks/roles/rook/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,48 +21,36 @@
- "{{ rook_helm_chart_file_name }}"
- "{{ rook_helm_cluster_chart_file_name }}"

- name: Create custom configuration for operator Helm chart file (operator-custom-chart-values.yml)
when: specification.operator_chart_values is defined
- name: Fail when configuration for operator and cluster chart are not defined
fail:
msg: "You need to configure operator_chart_values and cluster_chart_values when rook is enabled"
when:
- specification.operator_chart_values is not defined or
specification.cluster_chart_values is not defined

- name: Create configuration for operator Helm chart file (operator-custom-chart-values.yml)
copy:
content: "{{ specification.operator_chart_values }}"
dest: "{{ download_directory }}/operator-custom-chart-values.yml"
mode: preserve

- name: Create custom configuration for cluster Helm chart file (cluster-custom-chart-values.yml)
when: specification.cluster_chart_values is defined
- name: Create configuration for cluster Helm chart file (cluster-custom-chart-values.yml)
copy:
content: "{{ specification.cluster_chart_values }}"
dest: "{{ download_directory }}/cluster-custom-chart-values.yml"
mode: preserve

- name: Install Rook operator using Helm chart with values from operator-custom-chart-values.yml
when: specification.operator_chart_values is defined
command: |
helm -n {{ specification.rook_namespace }} upgrade --install \
-f {{ download_directory }}/operator-custom-chart-values.yml \
{{ rook_helm_chart_name }} \
{{ download_directory }}/{{ rook_helm_chart_file_name }} --create-namespace
- name: Install Rook operator using Helm chart with default values
when: not specification.operator_chart_values is defined
command: |
helm -n {{ specification.rook_namespace }} upgrade --install \
{{ rook_helm_chart_name }} \
{{ download_directory }}/{{ rook_helm_chart_file_name }} --create-namespace
- name: Create Rook cluster with values from cluster-custom-chart-values.yml
when: specification.cluster_chart_values is defined
command: |
helm -n {{ specification.rook_namespace }} upgrade --install \
--set operatorNamespace={{ specification.rook_namespace }} \
-f {{ download_directory }}/cluster-custom-chart-values.yml \
{{ rook_helm_cluster_chart_name }} \
{{ download_directory }}/{{ rook_helm_cluster_chart_file_name }} --create-namespace
- name: Create Rook cluster with default values
when: not specification.cluster_chart_values is defined
command: |
helm -n {{ specification.rook_namespace }} upgrade --install \
--set operatorNamespace={{ specification.rook_namespace }} \
{{ rook_helm_cluster_chart_name }} \
{{ download_directory }}/{{ rook_helm_cluster_chart_file_name }} --create-namespace
5 changes: 4 additions & 1 deletion docs/home/howto/kubernetes/PERSISTENT_STORAGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,9 @@ specification:
rook_namespace: your-rook-namespace
```

The key `specification.enabled` must be set to true to install Rook/Ceph component. This will install Rook/Ceph with default values. To override default values provided by Rook you need to add to `configuration/rook` keys:
The key `specification.enabled` must be set to true to install Rook/Ceph component. Epiphany configuration file provides set of
parameters that are used for Rook/Ceph installation with default values. To override default values provided by Rook you need
to adjust `configuration/rook` keys:
- `specification.operator_chart_values` - to override Rook Operator Helm Chart default values
- `specification.cluster_chart_values` - to override Rook Cluster Helm Chart default values

Expand All @@ -121,6 +123,7 @@ specification:
...
```
Values nested below the `operator_chart_values` and `cluster_chart_values` keys are respectively Helm Chart values for Rook Operator and Rook Ceph Cluster.
It is important to ensure that configuration of operator and chart values matches configuration of your cluster.

More information about Helm Chart values may be found:
- [Helm Operator](https://github.com/rook/rook/blob/master/Documentation/helm-operator.md)
Expand Down
Loading

0 comments on commit 17c49af

Please sign in to comment.