forked from openstack/openstack-helm-infra
-
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.
- Loading branch information
Showing
19 changed files
with
354 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
pod: | ||
replicas: | ||
data: 1 | ||
storage: | ||
data: | ||
requests: | ||
storage: 1Gi | ||
storage_class: local-storage | ||
master: | ||
requests: | ||
storage: 1Gi | ||
storage_class: local-storage | ||
manifests: | ||
cron_curator: false | ||
cron_verify_repositories: false | ||
job_snapshot_repository: false | ||
job_elasticsearch_templates: false | ||
job_s3_user: false | ||
job_s3_bucket: false | ||
helm_tests: false |
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,20 @@ | ||
# Copyright 2020 The Openstack-Helm Authors. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http:https://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
apiVersion: v1 | ||
description: OpenStack-Helm Local Storage | ||
name: local-storage | ||
version: 0.1.0 | ||
maintainers: | ||
- name: OpenStack-Helm Authors |
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,18 @@ | ||
# Copyright 2020 The Openstack-Helm Authors. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http:https://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
dependencies: | ||
- name: helm-toolkit | ||
repository: http:https://localhost:8879/charts | ||
version: 0.1.0 |
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,44 @@ | ||
{{/* | ||
Copyright 2020 The Openstack-Helm Authors. | ||
|
||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
|
||
http:https://www.apache.org/licenses/LICENSE-2.0 | ||
|
||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/}} | ||
|
||
{{- if .Values.manifests.persistent_volumes }} | ||
{{- $envAll := . }} | ||
{{- range .Values.conf.persistent_volumes }} | ||
--- | ||
apiVersion: v1 | ||
kind: PersistentVolume | ||
metadata: | ||
name: {{ .name }} | ||
labels: | ||
{{ tuple $envAll "local-storage" $envAll.Release.Name | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 4 }} | ||
spec: | ||
capacity: | ||
storage: {{ .storage_capacity }} | ||
accessModes: {{ .access_modes }} | ||
persistentVolumeReclaimPolicy: {{ .reclaim_policy }} | ||
storageClassName: {{ $envAll.Release.Name }} | ||
local: | ||
path: {{ .local_path }} | ||
nodeAffinity: | ||
required: | ||
nodeSelectorTerms: | ||
- matchExpressions: | ||
- key: {{ $envAll.Values.labels.node_affinity.node_selector_key }} | ||
operator: In | ||
values: | ||
- {{ $envAll.Values.labels.node_affinity.node_selector_value }} | ||
{{- end }} | ||
{{- end }} |
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,28 @@ | ||
{{/* | ||
Copyright 2020 The Openstack-Helm Authors. | ||
|
||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
|
||
http:https://www.apache.org/licenses/LICENSE-2.0 | ||
|
||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/}} | ||
|
||
{{- if .Values.manifests.storage_class }} | ||
{{- $envAll := . }} | ||
--- | ||
apiVersion: storage.k8s.io/v1 | ||
kind: StorageClass | ||
metadata: | ||
name: {{ .Release.Name }} | ||
labels: | ||
{{ tuple $envAll "local-storage" $envAll.Release.Name | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 4 }} | ||
provisioner: kubernetes.io/no-provisioner | ||
volumeBindingMode: WaitForFirstConsumer | ||
{{- end }} |
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,41 @@ | ||
# Copyright 2020 The Openstack-Helm Authors. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http:https://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
labels: | ||
node_affinity: | ||
node_selector_key: openstack-control-plane | ||
node_selector_value: enabled | ||
|
||
conf: | ||
persistent_volumes: | ||
# For each mount path, one PV should be created. | ||
# If there are two mount paths for local storage are available on two nodes, | ||
# then two PVs details should be defined. Example: | ||
# - name: local-pv-1 (name of the Persistent Volume 1) | ||
# reclaimpolicy: Retain (Reclaim Policy for the PV local-pv-1) | ||
# storage_capacity: "100Gi" (Storage capacity of the PV local-pv-1) | ||
# access_modes: [ "ReadWriteOnce" ] (Access mode for the PV local-pv-1) | ||
# local_path: /mnt/disk/vol1 (Mount path of the local disk, local-pv-1 will be created on) | ||
# - name: local-pv-2 (name of the Persistent Volume 2) | ||
# reclaimpolicy: Retain (Reclaim Policy for the PV local-pv-2) | ||
# storage_capacity: "100Gi" (Storage capacity of the PV local-pv-2) | ||
# access_modes: [ "ReadWriteOnce" ] (Access mode for the PV local-pv-2) | ||
# local_path: /mnt/disk/vol2 (Mount path of the local disk, local-pv-2 will be created on) | ||
# Similarly if three nodes each have disk mount path /var/lib/kubernetes | ||
# which will be acting as local storage for each node, then Persistentvolumes | ||
# should be updated with three entries. | ||
|
||
manifests: | ||
storage_class: true | ||
persistent_volumes: true |
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,35 @@ | ||
conf: | ||
persistent_volumes: | ||
- name: local-persistent-volume-0 | ||
reclaim_policy: Delete | ||
storage_capacity: "1Gi" | ||
access_modes: [ "ReadWriteOnce" ] | ||
local_path: /srv/local-volume-0 | ||
- name: local-persistent-volume-1 | ||
reclaim_policy: Delete | ||
storage_capacity: "1Gi" | ||
access_modes: [ "ReadWriteOnce" ] | ||
local_path: /srv/local-volume-1 | ||
- name: local-persistent-volume-2 | ||
reclaim_policy: Delete | ||
storage_capacity: "1Gi" | ||
access_modes: [ "ReadWriteOnce" ] | ||
local_path: /srv/local-volume-2 | ||
- name: local-persistent-volume-3 | ||
reclaim_policy: Delete | ||
storage_capacity: "1Gi" | ||
access_modes: [ "ReadWriteOnce" ] | ||
local_path: /srv/local-volume-3 | ||
- name: local-persistent-volume-4 | ||
reclaim_policy: Delete | ||
storage_capacity: "1Gi" | ||
access_modes: [ "ReadWriteOnce" ] | ||
local_path: /srv/local-volume-4 | ||
- name: local-persistent-volume-5 | ||
reclaim_policy: Delete | ||
storage_capacity: "1Gi" | ||
access_modes: [ "ReadWriteOnce" ] | ||
local_path: /srv/local-volume-5 | ||
manifests: | ||
storage_class: true | ||
persistent_volumes: true |
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,9 @@ | ||
pod: | ||
replicas: | ||
server: 1 | ||
volume: | ||
size: 1Gi | ||
class_name: local-storage | ||
monitoring: | ||
prometheus: | ||
enabled: false |
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,7 @@ | ||
pod: | ||
replicas: | ||
prometheus: 1 | ||
storage: | ||
requests: | ||
storage: 1Gi | ||
storage_class: local-storage |
1 change: 1 addition & 0 deletions
1
tools/deployment/osh-infra-local-storage/000-install-packages.sh
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 @@ | ||
../common/000-install-packages.sh |
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 @@ | ||
../common/005-deploy-k8s.sh |
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 @@ | ||
../osh-infra-monitoring/020-ingress.sh |
43 changes: 43 additions & 0 deletions
43
tools/deployment/osh-infra-local-storage/020-local-storage.sh
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,43 @@ | ||
#!/bin/bash | ||
|
||
# Copyright 2020 The Openstack-Helm Authors. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); you may | ||
# not use this file except in compliance with the License. You may obtain | ||
# a copy of the License at | ||
# | ||
# http:https://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
# License for the specific language governing permissions and limitations | ||
# under the License. | ||
|
||
set -xe | ||
|
||
for i in {0..5}; do | ||
sudo mkdir /srv/local-volume-$i; | ||
done | ||
|
||
#NOTE: Lint and package chart | ||
make local-storage | ||
|
||
#NOTE: Deploy command | ||
: ${OSH_INFRA_EXTRA_HELM_ARGS:=""} | ||
: ${OSH_INFRA_EXTRA_HELM_ARGS_LOCAL_STORAGE:="$(./tools/deployment/common/get-values-overrides.sh local-storage)"} | ||
|
||
helm upgrade --install local-storage ./local-storage \ | ||
--namespace=osh-infra \ | ||
${OSH_INFRA_EXTRA_HELM_ARGS} \ | ||
${OSH_INFRA_EXTRA_HELM_ARGS_LOCAL_STORAGE} | ||
|
||
#NOTE: Wait for deploy | ||
./tools/deployment/common/wait-for-pods.sh osh-infra | ||
|
||
#NOTE: Validate Deployment info | ||
helm status local-storage | ||
|
||
# Simple object validation | ||
kubectl describe sc local-storage | ||
kubectl get pv |
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 @@ | ||
../osh-infra-monitoring/045-mariadb.sh |
37 changes: 37 additions & 0 deletions
37
tools/deployment/osh-infra-local-storage/040-prometheus.sh
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,37 @@ | ||
#!/bin/bash | ||
|
||
# Copyright 2020 The Openstack-Helm Authors. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); you may | ||
# not use this file except in compliance with the License. You may obtain | ||
# a copy of the License at | ||
# | ||
# http:https://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
# License for the specific language governing permissions and limitations | ||
# under the License. | ||
|
||
set -xe | ||
|
||
#NOTE: Lint and package chart | ||
make prometheus | ||
|
||
#NOTE: Deploy command | ||
: ${OSH_INFRA_EXTRA_HELM_ARGS:=""} | ||
: ${OSH_INFRA_EXTRA_HELM_ARGS_PROMETHEUS:="$(./tools/deployment/common/get-values-overrides.sh prometheus)"} | ||
|
||
helm upgrade --install prometheus ./prometheus \ | ||
--namespace=osh-infra \ | ||
${OSH_INFRA_EXTRA_HELM_ARGS} \ | ||
${OSH_INFRA_EXTRA_HELM_ARGS_PROMETHEUS} | ||
|
||
#NOTE: Wait for deploy | ||
./tools/deployment/common/wait-for-pods.sh osh-infra | ||
|
||
#NOTE: Validate Deployment info | ||
helm status prometheus | ||
|
||
helm test prometheus |
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 @@ | ||
../osh-infra-logging/050-elasticsearch.sh |
20 changes: 20 additions & 0 deletions
20
tools/deployment/osh-infra-local-storage/060-volume-info.sh
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,20 @@ | ||
#!/bin/bash | ||
|
||
# Copyright 2020 The Openstack-Helm Authors. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); you may | ||
# not use this file except in compliance with the License. You may obtain | ||
# a copy of the License at | ||
# | ||
# http:https://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
# License for the specific language governing permissions and limitations | ||
# under the License. | ||
|
||
set -xe | ||
|
||
# Verifying persistent volumes | ||
kubectl get pv |
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