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

[operator] Refining deployed s3 secret hack scripts #5374

Merged
merged 1 commit into from
Feb 15, 2022
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
9 changes: 0 additions & 9 deletions operator/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -183,15 +183,6 @@ olm-deploy: olm-deploy-bundle olm-deploy-operator $(OPERATOR_SDK)
$(OPERATOR_SDK) run bundle -n $(CLUSTER_LOGGING_NS) --install-mode OwnNamespace $(BUNDLE_IMG)
endif

# Build and push the secret for the S3 storage
.PHONY: olm-deploy-example-storage-secret
olm-deploy-example-storage-secret:
hack/deploy-example-secret.sh $(CLUSTER_LOGGING_NS)

.PHONY: olm-deploy-example
olm-deploy-example: olm-deploy olm-deploy-example-storage-secret ## Deploy example LokiStack custom resource
kubectl -n $(CLUSTER_LOGGING_NS) create -f hack/lokistack_dev.yaml

.PHONY: olm-undeploy
olm-undeploy: $(OPERATOR_SDK) ## Cleanup deployments of the operator bundle and the operator via OLM on an OpenShift cluster selected via KUBECONFIG.
$(OPERATOR_SDK) cleanup loki-operator
Expand Down
10 changes: 4 additions & 6 deletions operator/docs/hack_loki_operator.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Loki Operator is the Kubernetes Operator for [Loki](https://grafana.com/docs/lok
```console
kubectl get pods
```

You should see `controller-manager-xxxx` and `minio-xxxx` pods running.

* Now create a LokiStack instance to get the various components of Loki up and running:
Expand Down Expand Up @@ -104,17 +104,15 @@ It will undeploy controller from the configured Kubernetes cluster in [~/.kube/c
* Now you need to create a storage secret for the operator. This can be done using:

```console
make olm-deploy-example-storage-secret
./hack/deploy-aws-storage-secret.sh <BUCKET_NAME>
```

OR
This secret will be available in `openshift-logging` namespace. You can check the `hack/deploy-aws-storage-secret.sh` file to check the content of the secret. By default, the script will pull credential information using the `aws` cli. However, these values can be overwritten. For example:

```console
./hack/deploy-example-secret.sh openshift-logging
REGION=us-west-1 ./hack/deploy-aws-storage-secret.sh <BUCKET_NAME>
```

This secret will be available in openshift-logging namespace. You can check the `hack/deploy-example-secret.sh` file to check the content of the secret.

* Now you need to create a gateway secret [3] for the operator. This can be done using:

```code
Expand Down
19 changes: 19 additions & 0 deletions operator/hack/deploy-aws-storage-secret.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash

set -eou pipefail

BUCKET_NAME=$1

NAMESPACE=${NAMESPACE:-openshift-logging}

REGION=${REGION:-$(aws configure get region)}
ACCESS_KEY_ID=${ACCESS_KEY_ID:-$(aws configure get aws_access_key_id)}
SECRET_ACCESS_KEY=${SECRET_ACCESS_KEY:-$(aws configure get aws_secret_access_key)}

kubectl --ignore-not-found=true -n "${NAMESPACE}" delete secret test
kubectl -n "${NAMESPACE}" create secret generic test \
--from-literal=region="$(echo -n "${REGION}")" \
--from-literal=bucketnames="$(echo -n "${BUCKET_NAME}")" \
--from-literal=access_key_id="$(echo -n "${ACCESS_KEY_ID}")" \
--from-literal=access_key_secret="$(echo -n "${SECRET_ACCESS_KEY}")" \
--from-literal=endpoint="$(echo -n "https://s3.${REGION}.amazonaws.com")"
35 changes: 0 additions & 35 deletions operator/hack/deploy-example-secret.sh

This file was deleted.