Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add minio operator to fullstack-cluster-setup chart #453

Merged
merged 2 commits into from
Oct 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions charts/fullstack-cluster-setup/Chart.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
dependencies:
- name: operator
repository: https://operator.min.io/
version: 5.0.7
digest: sha256:2f7b3843ce9b2417b2db1a7af249a6c4d097cb13e65d557c0c80a55688e1a172
generated: "2023-10-25T15:14:25.580221+01:00"
7 changes: 7 additions & 0 deletions charts/fullstack-cluster-setup/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,10 @@ version: 0.8.0
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "0.8.0"

dependencies:
- name: operator
alias: minio-operator
version: 5.0.7
repository: https://operator.min.io/
condition: cloud.minio.enable
7 changes: 6 additions & 1 deletion charts/fullstack-cluster-setup/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,9 @@
global:
namespaceOverride: ""
nameOverride: ""
fullnameOverride: ""
fullnameOverride: ""

# cloud configuration
cloud:
minio:
enable: false
40 changes: 19 additions & 21 deletions dev/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ CHART_DIR=$(PWD)/../charts/fullstack-deployment
SCRIPT_NAME=direct-install.sh
TMP_DIR=${SCRIPTS_DIR}/../temp

CLUSTER_SETUP_VALUES_FILE=${TMP_DIR}/cluster-values.yaml
CHART_VALUES_FILES= # extra values

# scripts
Expand Down Expand Up @@ -58,15 +59,19 @@ uninstall-chart:
.PHONY: update-helm-dependencies
update-helm-dependencies:
helm dependency update ../charts/fullstack-deployment
helm dependency update ../charts/fullstack-cluster-setup

.PHONY: init-shared
init-shared:
echo "# values override file for fullstack-cluster-setup" > ${CLUSTER_SETUP_VALUES_FILE}

.PHONY: deploy-shared
deploy-shared: update-helm-dependencies deploy-gateway-api deploy-prometheus-operator deploy-minio-operator-if-required
deploy-shared: init-shared update-helm-dependencies deploy-gateway-api deploy-prometheus-operator enable-minio-operator-if-required
source "${SCRIPTS_DIR}/main.sh" && deploy_shared # run only after gateway-api CRDs are available

.PHONY: destroy-shared
destroy-shared:
-$(MAKE) source "${SCRIPTS_DIR}/main.sh" && destroy_shared
-$(MAKE) undeploy-minio-operator
source "${SCRIPTS_DIR}/main.sh" && destroy_shared
-$(MAKE) destroy-prometheus-operator

.PHONY: deploy-chart
Expand All @@ -77,6 +82,7 @@ deploy-chart:
.PHONY: destroy-chart
destroy-chart:
-$(MAKE) uninstall-chart
-$(MAKE) destroy-shared

.PHONY: deploy-network
deploy-network: deploy-chart
Expand Down Expand Up @@ -193,30 +199,22 @@ destroy-telemetry-stack:
-${MAKE} destroy-grafana-tempo

######################################### MinIO #################################
.PHONY: deploy-minio-operator
deploy-minio-operator:
@echo ">> Deploying minio operator..."; \
helm install --repo https://operator.min.io/ --namespace=minio-operator --create-namespace --version 5.0.7 minio-operator operator && \
echo ">> Waiting for minio operator to be available (timeout 300s)..." && \
kubectl --namespace=minio-operator wait --for=condition=Available --timeout=300s deployment.apps/minio-operator && \
sleep 5
.PHONY: enable-minio-operator
enable-minio-operator:
@echo ">> Enabling minio operator..."; \
echo "cloud:" >> ${CLUSTER_SETUP_VALUES_FILE}; \
deepak-swirlds marked this conversation as resolved.
Show resolved Hide resolved
echo " minio:" >> ${CLUSTER_SETUP_VALUES_FILE}; \
echo " enable: true" >> ${CLUSTER_SETUP_VALUES_FILE};

.PHONY: is-minio-operator-installed
is-minio-operator-installed:
@echo ">> Checking for minio operator..."; \
helm list --namespace=minio-operator | grep minio-operator &> /dev/null && { echo "Found minio operator."; exit 0; }; \
kubectl get pods --all-namespaces | grep minio-operator &> /dev/null && { echo "Found minio operator."; exit 0; }; \
echo "Minio operator not found."; exit 1

.PHONY: deploy-minio-operator-if-required
deploy-minio-operator-if-required:
@$(MAKE) is-minio-operator-installed || $(MAKE) deploy-minio-operator


.PHONY: undeploy-minio-operator
undeploy-minio-operator:
echo ">> Deleting minio operator..." && \
helm delete --namespace=minio-operator minio-operator

.PHONY: enable-minio-operator-if-required
enable-minio-operator-if-required:
@$(MAKE) is-minio-operator-installed || $(MAKE) enable-minio-operator

######################################### Helm Chart Test #################################
.PHONY: helm-test
Expand Down
1 change: 1 addition & 0 deletions dev/scripts/env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ function setup() {
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd)"
readonly SCRIPT_DIR
readonly TMP_DIR="${SCRIPT_DIR}/../temp"
readonly CLUSTER_SETUP_VALUES_FILE="${TMP_DIR}/cluster-values.yaml"
load_env_file

USER="${USER:-changeme}"
Expand Down
2 changes: 1 addition & 1 deletion dev/scripts/main.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ function deploy_fullstack_cluster_setup_chart() {
echo "-----------------------------------------------------------------------------------------------------"
local count=$(helm list --all-namespaces -q | grep -c "fullstack-cluster-setup")
if [[ $count -eq 0 ]]; then
helm install -n "${NAMESPACE}" "fullstack-cluster-setup" "${SETUP_CHART_DIR}"
helm install -n "${NAMESPACE}" "fullstack-cluster-setup" "${SETUP_CHART_DIR}" --values "${CLUSTER_SETUP_VALUES_FILE}"
else
echo "fullstack-cluster-setup chart is already installed"
echo ""
Expand Down
3 changes: 2 additions & 1 deletion dev/temp/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
*.txt
*.xml
*.xml
*.yaml