Skip to content

Commit

Permalink
Move Logsearchapi binary to Operator Container Image
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 Feb 1, 2022
1 parent afb70fa commit 3eb5eff
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 79 deletions.
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,6 @@ RUN \
microdnf install curl ca-certificates shadow-utils --nodocs

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

CMD ["/minio-operator"]
5 changes: 2 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ operator:
@CGO_ENABLED=0 GOOS=linux go build -trimpath --ldflags $(LDFLAGS) -o minio-operator
@docker build -t $(TAG) .

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

install: all

Expand Down Expand Up @@ -85,8 +85,7 @@ logsearchapi:
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)_amd64 && \
docker buildx build --output=type=docker --platform linux/amd64 -t $(LOGSEARCHAPI_TAG) .)
CGO_ENABLED=0 GOOS=linux go build --ldflags "-s -w" -trimpath -o logsearchapi)

getconsoleuiyaml:
@echo "Getting the latest Console UI"
Expand Down
20 changes: 17 additions & 3 deletions UPGRADE.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,20 @@ Upgrades

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

v4.4.5
---

The Operator and Logsearch API container have been merged, no new `minio/logsearchapi` images will be built, if your
tenant has a specific MinIO Image specified in `.spec.log.image` you need to update it to use either the upstream `
minio/operator image or your private registry image.


v4.2.3 - v4.2.4
---
In this version we started running the MinIO pods as `non-root` to increase security in the MinIO deployment, however this has the implication that older tenants that were not sepcifying a [securityContext](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/) on a per-pool basis may suddenly stop starting due to file-ownership problems.
In this version we started running the MinIO pods as `non-root` to increase security in the MinIO deployment, however
this has the implication that older tenants that were not sepcifying
a [securityContext](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/) on a per-pool basis may
suddenly stop starting due to file-ownership problems.

This problem may be identified on the MinIO logs by seeing a log line like:

Expand All @@ -14,7 +25,8 @@ Unable to read 'format.json' from https://production-storage-pool-0-1.production
.local:9000/export3: file access denied
```

The solution for an existing tenant is to add a `securityContext` to each pool in the Tenant's `.spec.pools[*].securityContext` field with the following imlpicit default:
The solution for an existing tenant is to add a `securityContext` to each pool in the
Tenant's `.spec.pools[*].securityContext` field with the following imlpicit default:

```
securityContext:
Expand All @@ -24,5 +36,7 @@ securityContext:
runAsUser: 0
```

This scenario is automatically handled by the operator, however if the tenant is updated from a pre-stored source (i.e: a yaml file) which is missing the added `securityContext` this problem may arise again, so update your stored yamls respectively.
This scenario is automatically handled by the operator, however if the tenant is updated from a pre-stored source (i.e:
a yaml file) which is missing the added `securityContext` this problem may arise again, so update your stored yamls
respectively.

19 changes: 0 additions & 19 deletions logsearchapi/Dockerfile

This file was deleted.

53 changes: 0 additions & 53 deletions logsearchapi/docker-buildx.sh

This file was deleted.

2 changes: 1 addition & 1 deletion pkg/apis/minio.min.io/v2/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ const PrometheusHLSvcNameSuffix = "-prometheus-hl-svc"
// Log related constants

// DefaultLogSearchAPIImage specifies the latest logsearchapi container image
const DefaultLogSearchAPIImage = "minio/logsearchapi:v4.4.4"
const DefaultLogSearchAPIImage = "minio/operator:v4.4.4"

// LogPgImage specifies the latest Postgres container image
const LogPgImage = "library/postgres:13"
Expand Down
3 changes: 3 additions & 0 deletions pkg/resources/deployments/log-search-api.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,9 @@ func logSearchAPIContainer(t *miniov2.Tenant) corev1.Container {
container := corev1.Container{
Name: miniov2.LogSearchAPIContainerName,
Image: logSearchAPIImage,
Command: []string{
"/logsearchapi",
},
Ports: []corev1.ContainerPort{
{
ContainerPort: miniov2.LogSearchAPIPort,
Expand Down

0 comments on commit 3eb5eff

Please sign in to comment.