Skip to content

Commit

Permalink
Remove Log Search API and Prometheus (#1512)
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel Valdivia <18384552+dvaldivia@users.noreply.github.com>
  • Loading branch information
dvaldivia committed Mar 16, 2023
1 parent f1eb0ed commit 6701b4f
Show file tree
Hide file tree
Showing 114 changed files with 1,706 additions and 22,884 deletions.
133 changes: 1 addition & 132 deletions .github/workflows/kubernetes-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,32 +91,6 @@ jobs:
- name: Go Test
run: |
make gotest
logsearch:
runs-on: ${{ matrix.os }}
needs:
- lint
- vulnerable-dependencies-checks
- govet
- shellcheck
strategy:
matrix:
go-version: [ 1.20.x ]
os: [ ubuntu-latest ]

steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}
- uses: actions/cache@v3
name: Logsearch API Binary Cache
with:
path: |
./logsearchapi-bin
key: ${{ runner.os }}-logsearchbinary-${{ github.run_id }}
- name: Logsearch Binary
run: |
make logsearchapi
operator:
runs-on: ${{ matrix.os }}
needs:
Expand Down Expand Up @@ -146,7 +120,6 @@ jobs:
test-tenant:
runs-on: ${{ matrix.os }}
needs:
- logsearch
- operator
strategy:
matrix:
Expand All @@ -164,19 +137,12 @@ jobs:
path: |
./minio-operator
key: ${{ runner.os }}-binary-${{ github.run_id }}
- uses: actions/cache@v3
name: Logsearch API Binary Cache
with:
path: |
./logsearchapi-bin
key: ${{ runner.os }}-logsearchbinary-${{ github.run_id }}
- name: Prometheus test on Kind
- name: Deploy Tenant
run: |
"${GITHUB_WORKSPACE}/testing/deploy-tenant.sh"
test-tenant-upgrade:
runs-on: ${{ matrix.os }}
needs:
- logsearch
- operator
strategy:
matrix:
Expand All @@ -194,81 +160,12 @@ jobs:
path: |
./minio-operator
key: ${{ runner.os }}-binary-${{ github.run_id }}
- uses: actions/cache@v3
name: Logsearch API Binary Cache
with:
path: |
./logsearchapi-bin
key: ${{ runner.os }}-logsearchbinary-${{ github.run_id }}
- name: Tenant upgrade test on Kind
run: |
"${GITHUB_WORKSPACE}/testing/deploy-tenant-upgrade.sh"
test-prometheus:
runs-on: ${{ matrix.os }}
needs:
- logsearch
- operator
strategy:
matrix:
go-version: [ 1.20.x ]
os: [ ubuntu-latest ]

steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}
- uses: actions/cache@v3
name: Operator Binary Cache
with:
path: |
./minio-operator
key: ${{ runner.os }}-binary-${{ github.run_id }}
- uses: actions/cache@v3
name: Logsearch API Binary Cache
with:
path: |
./logsearchapi-bin
key: ${{ runner.os }}-logsearchbinary-${{ github.run_id }}
- name: Prometheus test on Kind
run: |
"${GITHUB_WORKSPACE}/testing/check-prometheus.sh"
test-logs:
runs-on: ${{ matrix.os }}
needs:
- logsearch
- operator
strategy:
matrix:
go-version: [ 1.20.x ]
os: [ ubuntu-latest ]

steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}
- uses: actions/cache@v3
name: Operator Binary Cache
with:
path: |
./minio-operator
key: ${{ runner.os }}-binary-${{ github.run_id }}
- uses: actions/cache@v3
name: Logsearch API Binary Cache
with:
path: |
./logsearchapi-bin
key: ${{ runner.os }}-logsearchbinary-${{ github.run_id }}
- name: Prometheus test on Kind
run: |
"${GITHUB_WORKSPACE}/testing/check-logs.sh"
test-kes:
runs-on: ${{ matrix.os }}
needs:
- logsearch
- operator
strategy:
matrix:
Expand All @@ -286,20 +183,13 @@ jobs:
path: |
./minio-operator
key: ${{ runner.os }}-binary-${{ github.run_id }}
- uses: actions/cache@v3
name: Logsearch API Binary Cache
with:
path: |
./logsearchapi-bin
key: ${{ runner.os }}-logsearchbinary-${{ github.run_id }}
- name: Tenant KES
run: |
"${GITHUB_WORKSPACE}/testing/console-tenant+kes.sh"
test-policy-binding:
runs-on: ${{ matrix.os }}
needs:
- logsearch
- operator
strategy:
matrix:
Expand All @@ -316,12 +206,6 @@ jobs:
path: |
./minio-operator
key: ${{ runner.os }}-binary-${{ github.run_id }}
- uses: actions/cache@v3
name: Logsearch API Binary Cache
with:
path: |
./logsearchapi-bin
key: ${{ runner.os }}-logsearchbinary-${{ github.run_id }}
- name: Test PolicyBinding CRD and sts call on kind
run: |
"${GITHUB_WORKSPACE}/testing/test-policy-binding.sh"
Expand All @@ -330,7 +214,6 @@ jobs:
# The type of runner that the job will run on
runs-on: ${{ matrix.os }}
needs:
- logsearch
- operator
strategy:
matrix:
Expand All @@ -350,13 +233,6 @@ jobs:
path: |
./minio-operator
key: ${{ runner.os }}-binary-${{ github.run_id }}
- uses: actions/cache@v3
name: Logsearch API Binary Cache
with:
path: |
./logsearchapi-bin
key: ${{ runner.os }}-logsearchbinary-${{ github.run_id }}

# Runs a set of commands using the runners shell
- name: Deploy a MinIO Tenant on Kind
run: |
Expand All @@ -368,7 +244,6 @@ jobs:
# The type of runner that the job will run on
runs-on: ${{ matrix.os }}
needs:
- logsearch
- operator
strategy:
matrix:
Expand All @@ -388,12 +263,6 @@ jobs:
path: |
./minio-operator
key: ${{ runner.os }}-binary-${{ github.run_id }}
- uses: actions/cache@v3
name: Logsearch API Binary Cache
with:
path: |
./logsearchapi-bin
key: ${{ runner.os }}-logsearchbinary-${{ github.run_id }}

# Runs a set of commands using the runners shell
- name: Deploy a MinIO Tenant on Kind
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ui.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ jobs:
go tool cover -func=all.out | grep total > tmp2
result=`cat tmp2 | awk 'END {print $3}'`
result=${result%\%}
threshold=63.2
threshold=61.2
echo "Result:"
echo "$result%"
if (( $(echo "$result >= $threshold" |bc -l) )); then
Expand Down
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ kubectl-minio/kubectl-minio
*.minisig
*.zip
kubectl-minio/crds
logsearchapi/logsearchapi
logsearchapi-bin
*.log
.vscode
minio.yaml
Expand Down
19 changes: 0 additions & 19 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,25 +60,6 @@ builds:
hooks:
post: ./package.sh {{ .Path }}

- id: logsearchapi
dir: logsearchapi
binary: logsearchapi-bin
goos:
- linux
goarch:
- arm64
- amd64
- ppc64le
- s390x
env:
- CGO_ENABLED=0
ldflags:
- -s -w -X main.version={{.Tag}}
flags:
- -trimpath
hooks:
post: ./package.sh {{ .Path }}

archives:
- allow_different_binary_count: true
format: binary
Expand Down
1 change: 0 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,5 @@ RUN \
microdnf install curl ca-certificates shadow-utils --nodocs

COPY minio-operator /minio-operator
COPY logsearchapi-bin /logsearchapi

ENTRYPOINT ["/minio-operator"]
15 changes: 2 additions & 13 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ KUSTOMIZE_CRDS=$(KUSTOMIZE_HOME)/base/crds/

PLUGIN_HOME=kubectl-minio

LOGSEARCHAPI=logsearchapi

all: build

getdeps:
Expand All @@ -38,10 +36,10 @@ binary:

operator: assets binary

docker: operator logsearchapi
docker: operator
@docker build --no-cache -t $(TAG) .

build: regen-crd verify plugin logsearchapi operator docker
build: regen-crd verify plugin operator docker

install: all

Expand Down Expand Up @@ -84,15 +82,6 @@ plugin: regen-crd
GO111MODULE=on ${GOPATH}/bin/golangci-lint cache clean && \
GO111MODULE=on ${GOPATH}/bin/golangci-lint run --timeout=5m --config ../.golangci.yml)

.PHONY: logsearchapi
logsearchapi: getdeps
@echo "Building 'logsearchapi' binary"
@(cd $(LOGSEARCHAPI); \
go vet ./... && \
go test -race ./... && \
GO111MODULE=on ${GOPATH}/bin/golangci-lint cache clean && \
GO111MODULE=on ${GOPATH}/bin/golangci-lint run --timeout=5m --config ../.golangci.yml && \
CGO_ENABLED=0 GOOS=linux go build --ldflags "-s -w" -trimpath -o ../logsearchapi-bin )

generate-code:
@./k8s/update-codegen.sh
Expand Down
43 changes: 42 additions & 1 deletion UPGRADE.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,44 @@ Upgrades

In this document we will try to document relevant upgrade notes for the MinIO Operator.

v5.0.0
---

Automatic Tenant migrations only start from tenants previously migrated to `v4.2.0` or newer, users coming from older
version are recommended to upgrade to `v4.5.8` before upgrading to `v5.0.0`.

The `Operator UI` is now bundled on the same container as operator.

The `.spec.S3` field was removed in favor of `.spec.features`.

Field `.spec.credsSecret` was removed in favor of `.spec.configuration`, this secret should hold all the environment
variables for the MinIO deployment that contain sensitive information and should not be shown on `.spec.env`.

Both `Log Search API` (`.spec.log`) and `Prometheus` (`.spec.prometheus`) deployments were removed, however they will be
left running as stand-alone
deployments/statefulset with no connection to the Tenant CR itself, this means that if the Tenant CR is deleted, this
will not cascade to these deployments.

> ⚠️ It is recommended to create a yaml file to manage these deployments subsequently.
To back up these deployments:

```shell
export TENANT_NAME=myminio
export NAMESPACE=mynamespace
kubectl -n $NAMESPACE get secret $TENANT_NAME-log-secret -o yaml > $TENANT_NAME-log-secret.yaml
kubectl -n $NAMESPACE get cm $TENANT_NAME-prometheus-config-map -o yaml > $TENANT_NAME-prometheus-config-map.yaml
kubectl -n $NAMESPACE get sts $TENANT_NAME-prometheus -o yaml > $TENANT_NAME-prometheus.yaml
kubectl -n $NAMESPACE get sts $TENANT_NAME-log -o yaml > $TENANT_NAME-log.yaml
kubectl -n $NAMESPACE get deployment $TENANT_NAME-log-search-api -o yaml > $TENANT_NAME-log-search-api.yaml
kubectl -n $NAMESPACE get svc $TENANT_NAME-log-hl-svc -o yaml > $TENANT_NAME-log-hl-svc.yaml
kubectl -n $NAMESPACE get svc $TENANT_NAME-log-search-api -o yaml > $TENANT_NAME-log-search-api.yaml
kubectl -n $NAMESPACE get svc $TENANT_NAME-prometheus-hl-svc -o yaml > $TENANT_NAME-prometheus-hl-svc.yaml
```

After exporting these objects, we recommend you remove `.metadata.ownerReferences` for all these.


v4.4.5
---

Expand All @@ -13,7 +51,10 @@ minio/operator image or your private registry image.

v4.3.9 - v4.4.0
---
Support for Prometheus ServiceMonitor is removed. Using ServiceMonitor to configure prometheus endpoints will lead to duplicate metrics. The alternate approach is to use Prometheus [AdditionalScrapeConfigs] https://github.com/prometheus-operator/prometheus-operator/blob/main/Documentation/additional-scrape-config.md. This can be enabled by setting `prometheusOperator: true` on the tenant.
Support for Prometheus ServiceMonitor is removed. Using ServiceMonitor to configure prometheus endpoints will lead to
duplicate metrics. The alternate approach is to use
Prometheus [AdditionalScrapeConfigs] https://github.com/prometheus-operator/prometheus-operator/blob/main/Documentation/additional-scrape-config.md.
This can be enabled by setting `prometheusOperator: true` on the tenant.
Once this is configured, MinIO Operator will create the additional configuration for the tenant.
If the prometheus is running on a particular namespace, `PROMETHEUS_NAMESPACE` can be set accordingly.

Expand Down
2 changes: 0 additions & 2 deletions api/configure_operator.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,7 @@ func configureAPI(api *operations.OperatorAPI) http.Handler {
registerOperatorSubnetHandlers(api)
registerYAMLHandlers(api)
registerEventHandlers(api)
registerTenantLogsHandlers(api)
registerEncryptionHandlers(api)
registerMonitoringHandlers(api)
registerIDPHandlers(api)
registerUsersHandlers(api)
registerDomainHandlers(api)
Expand Down
Loading

0 comments on commit 6701b4f

Please sign in to comment.