Skip to content

Commit

Permalink
add a quickstart command to simplify everything
Browse files Browse the repository at this point in the history
  • Loading branch information
dmolik committed Aug 7, 2024
1 parent 6c7295c commit 02fb0fc
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 7 deletions.
7 changes: 6 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ $(LOCALBIN):
mkdir -p $(LOCALBIN)

## Tool Binaries
KUBECTL ?= kubectl
KUBECTL ?= $(shell which kubectl)
KUSTOMIZE ?= $(LOCALBIN)/kustomize-$(KUSTOMIZE_VERSION)
CONTROLLER_GEN ?= $(LOCALBIN)/controller-gen-$(CONTROLLER_TOOLS_VERSION)
ENVTEST ?= $(LOCALBIN)/setup-envtest-$(ENVTEST_VERSION)
Expand All @@ -194,6 +194,11 @@ minikube: ## Spool up a local minikube cluster for development
PROMETHEUS=$(PROMETHEUS) \
scripts/minikube.sh

.PHONY: quickstart
quickstart: minikube ## Install the operator into the minikube cluster and deploy the sample CR use the TLS and PROMETHEUS variables to enable those features
$Q$(KUBECTL) apply -f https://raw.githubusercontent.com/hyperspike/valkey-operator/main/dist/install.yaml
$Q(if [ ! -z $$TLS ] ; then TLS_VALUE=true ; else TLS_VALUE=false ; fi ; if [ ! -z $$PROMETHEUS ] ; then PROMETHEUS_VALUE=true ; else PROMETHEUS_VALUE=false ; fi ; sed -e "s/@TLS@/$$TLS_VALUE/" -e "s/@PROMETHEUS@/$$PROMETHEUS_VALUE/" valkey.yml.tpl | $(KUBECTL) apply -f - )

tunnel: ## turn on minikube's tunnel to test ingress and get UI access
$Q$(MINIKUBE) tunnel -p north

Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ See the following link for more information on avialable Custom Resource Options

Deploy kubernetes locally using minikube, and install the controller:
```sh
make minikube
kubectl apply -f https://raw.githubusercontent.com/hyperspike/valkey-operator/main/dist/install.yaml
make quickstart
```

Create a ValkeyCluster
and optionally, turn on TLS and Prometheus:
```sh
kubectl apply -f https://raw.githubusercontent.com/hyperspike/valkey-operator/main/valkey.yaml
make quickstart TLS=1 PROMETHEUS=1
```


### To Uninstall

```sh
Expand Down
4 changes: 2 additions & 2 deletions valkey.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ metadata:
name: keyval
spec:
volumePermissions: true
#prometheus: true
#tls: true
prometheus: false
tls: false
certIssuer: selfsigned
prometheusLabels:
prometheus: "1"
14 changes: 14 additions & 0 deletions valkey.yml.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
apiVersion: hyperspike.io/v1
kind: Valkey
metadata:
labels:
app.kubernetes.io/name: valkey-operator
app.kubernetes.io/managed-by: kustomize
name: keyval
spec:
volumePermissions: true
prometheus: @PROMETHEUS@
tls: @TLS@
certIssuer: selfsigned
prometheusLabels:
prometheus: "1"

0 comments on commit 02fb0fc

Please sign in to comment.