Skip to content

Commit

Permalink
examples: move common files to separate folder
Browse files Browse the repository at this point in the history
  • Loading branch information
zimnx committed Nov 23, 2020
1 parent 8f0ee82 commit ae2365d
Show file tree
Hide file tree
Showing 59 changed files with 26 additions and 67,737 deletions.
3 changes: 1 addition & 2 deletions .gitignore
Expand Up @@ -24,8 +24,7 @@ dist/
*.swo
*~

examples/gke/grafana/values.yaml
examples/generic/grafana/values.yaml
examples/common/grafana/values.yaml

# additions for docs
/docs/_build
Expand Down
16 changes: 5 additions & 11 deletions Makefile
Expand Up @@ -36,13 +36,11 @@ install: manifests cert-manager
# Uninstall CRDs from a cluster
uninstall: manifests
kustomize build config/operator/crd | kubectl delete -f -
kubectl delete -f examples/generic/cert-manager.yaml
kubectl delete -f examples/common/cert-manager.yaml

cert-manager:
cat config/operator/certmanager/cert-manager.yaml > examples/generic/cert-manager.yaml
cat config/operator/certmanager/cert-manager.yaml > examples/gke/cert-manager.yaml
cat config/operator/certmanager/cert-manager.yaml > examples/eks/cert-manager.yaml
kubectl apply -f examples/generic/cert-manager.yaml
cat config/operator/certmanager/cert-manager.yaml > examples/common/cert-manager.yaml
kubectl apply -f examples/common/cert-manager.yaml
kubectl -n cert-manager wait --for=condition=ready pod -l app=cert-manager --timeout=60s
kubectl -n cert-manager wait --for=condition=ready pod -l app=cainjector --timeout=60s
kubectl -n cert-manager wait --for=condition=ready pod -l app=webhook --timeout=60s
Expand All @@ -59,12 +57,8 @@ manifests:
webhook output:webhook:artifacts:config=config/operator/webhook

controller-gen $(CRD_OPTIONS) paths="./pkg/controllers/manager" rbac:roleName=manager-role output:rbac:artifacts:config=config/manager/rbac
kustomize build config/operator/default > examples/generic/operator.yaml
kustomize build config/operator/default > examples/gke/operator.yaml
kustomize build config/operator/default > examples/eks/operator.yaml
kustomize build config/manager/default > examples/generic/manager.yaml
kustomize build config/manager/default > examples/gke/manager.yaml
kustomize build config/manager/default > examples/eks/manager.yaml
kustomize build config/operator/default > examples/common/operator.yaml
kustomize build config/manager/default > examples/common/manager.yaml

# Run go fmt against code
fmt:
Expand Down
2 changes: 1 addition & 1 deletion docs/source/eks.md
Expand Up @@ -96,7 +96,7 @@ Script requires several dependencies:

We deploy the local volume provisioner, which will discover their mount points and make them available as PersistentVolumes.
```
helm install local-provisioner examples/eks/provisioner
helm install local-provisioner examples/common/provisioner
```

### Installing the Scylla Operator and Scylla
Expand Down
17 changes: 8 additions & 9 deletions docs/source/generic.md
Expand Up @@ -33,7 +33,7 @@ eval $(minikube docker-env)
First deploy Cert Manager, you can either follow [upsteam instructions](https://cert-manager.io/docs/installation/kubernetes/) or use following command:

```console
kubectl apply -f examples/generic/cert-manager.yaml
kubectl apply -f examples/common/cert-manager.yaml
```
This will install Cert Manager with self signed certificate.

Expand All @@ -48,7 +48,7 @@ kubectl wait -n cert-manager --for=condition=ready pod -l app=cert-manager --tim
Deploy the Scylla Operator using the following commands:

```console
kubectl apply -f examples/generic/operator.yaml
kubectl apply -f examples/common/operator.yaml
```

This will install the operator StatefulSet in namespace scylla-operator-system.
Expand Down Expand Up @@ -274,31 +274,29 @@ After a restart the operator will use the security token when it interacts with

Both Prometheus and Grafana were configured with specific rules for Scylla Operator.
Both of them will be available under the `monitoring` namespace.
Customization can be done in `examples/generic/prometheus/values.yaml` and `examples/generic/grafana/values.yaml`.
Customization can be done in `examples/common/prometheus/values.yaml` and `examples/common/grafana/values.yaml`.

1. Create the monitoring namespace
```console
kubectl create namespace monitoring
```
2. Install Prometheus
```console
helm upgrade --install scylla-prom --namespace monitoring stable/prometheus -f examples/generic/prometheus/values.yaml
helm upgrade --install scylla-prom --namespace monitoring stable/prometheus -f examples/common/prometheus/values.yaml
```
If you want to tweak the prometheus properties, for example it's assigned memory, you can override it by adding a command line argument like this: `--set server.resources.limits.memory=4Gi`

3. Install Grafana
First you need to prepare the dashboards to make them available in Grafana.
You can do this by running the following command in the `examples` directory:
```console
./dashboards.sh -t generic
./dashboards.sh
```
If you are deploying to `GKE` the replace the argument with `gke` instead of `generic`.

__NB__: Keep in mind that this is a test setup. For production use, check grafana and prometheus helm chart page for advanced deployment instructions.

Now the dashboards can be created along with the grafana plugin like this:
```console
helm upgrade --install scylla-graf --namespace monitoring stable/grafana -f examples/generic/grafana/values.yaml
helm upgrade --install scylla-graf --namespace monitoring stable/grafana -f examples/common/grafana/values.yaml
```
To access Grafana locally, run:
Expand Down Expand Up @@ -391,7 +389,8 @@ To clean up all resources associated with this walk-through, you can run the com
```console
kubectl delete -f examples/generic/cluster.yaml
kubectl delete -f examples/generic/operator.yaml
kubectl delete -f examples/common/operator.yaml
kubectl delete -f examples/common/cert-manager.yaml
```
## Troubleshooting
Expand Down
4 changes: 2 additions & 2 deletions docs/source/gke.md
Expand Up @@ -127,7 +127,7 @@ kubectl apply -f examples/gke/raid-daemonset.yaml

After combining the local SSDs into RAID0 arrays, we deploy the local volume provisioner, which will discover their mount points and make them available as PersistentVolumes.
```
helm install local-provisioner examples/gke/provisioner
helm install local-provisioner examples/common/provisioner
```

#### Install `cpu-policy` Daemonset
Expand All @@ -142,7 +142,7 @@ kubectl apply -f examples/gke/cpu-policy-daemonset.yaml
You can either follow [upsteam instructions](https://cert-manager.io/docs/installation/kubernetes/) or use following command:

```console
kubectl apply -f examples/gke/cert-manager.yaml
kubectl apply -f examples/common/cert-manager.yaml
```

This will install Cert Manager with self signed certificate.
Expand Down
4 changes: 2 additions & 2 deletions docs/source/manager.md
Expand Up @@ -44,7 +44,7 @@ Controller also supports task updates and unscheduling.
Deploy the Scylla Manager using the following commands:

```console
kubectl apply -f examples/generic/manager.yaml
kubectl apply -f examples/common/manager.yaml
```

This will install the Scylla Manager in the `scylla-manager-system` namespace.
Expand Down Expand Up @@ -211,7 +211,7 @@ To clean up all resources associated with Scylla Manager, you can run the comman
**NOTE:** this will destroy your Scylla Manager database and delete all of its associated data.

```console
kubectl delete -f examples/generic/manager.yaml
kubectl delete -f examples/common/manager.yaml
```

## Troubleshooting
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
30 changes: 1 addition & 29 deletions examples/dashboards.sh
@@ -1,34 +1,6 @@
#!/usr/bin/env bash

PARAMS=""

while (( "$#" )); do
case "$1" in
-t|--target)
if [ -n "$2" ] && [ ${2:0:1} != "-" ]; then
TARGET=$2
shift 2
else
echo "Error: Argument for $1 is missing" >&2
exit 1
fi
;;
-*|--*=) # unsupported flags
echo "Error: Unsupported flag $1" >&2
exit 1
;;
*) # preserve positional arguments
PARAMS="$PARAMS $1"
shift
;;
esac
done

if [[ "x${TARGET}" == "x" ]]
then
echo "-t/--target (gke,generic,eks) is mandatory"
exit
fi
TARGET="common"

cp ${TARGET}/grafana/values.yaml.in ${TARGET}/grafana/values.yaml

Expand Down
6 changes: 3 additions & 3 deletions examples/eks/eks.sh
Expand Up @@ -88,15 +88,15 @@ sleep 60

# Install local volume provisioner
echo "Installing local volume provisioner..."
helm install local-provisioner provisioner
helm install local-provisioner ../common/provisioner
echo "Your disks are ready to use."

echo "Starting the cert manger..."
kubectl apply -f cert-manager.yaml
kubectl apply -f ../common/cert-manager.yaml
kubectl -n cert-manager wait --for=condition=ready pod -l app=webhook --timeout=60s

echo "Starting the scylla operator..."
kubectl apply -f operator.yaml
kubectl apply -f ../common/operator.yaml
kubectl -n scylla-operator-system wait --for=condition=ready pod -l control-plane=controller-manager --timeout=60s

echo "Starting the scylla cluster..."
Expand Down

0 comments on commit ae2365d

Please sign in to comment.