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

Update versions and fix KES Test #1457

Merged
merged 3 commits into from
Feb 28, 2023
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
6 changes: 3 additions & 3 deletions .github/workflows/goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ jobs:
steps:
-
name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
-
name: Set up Go
uses: actions/setup-go@v2
uses: actions/setup-go@v3
with:
go-version: 1.19.x
go-version: 1.20.x
-
# Add support for more platforms with QEMU (optional)
# https://github.com/docker/setup-qemu-action
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/helm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
go-version: [ 1.19.x ]
go-version: [ 1.20.x ]
os: [ ubuntu-latest ]

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go-version }}

Expand All @@ -45,14 +45,14 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
go-version: [ 1.19.x ]
go-version: [ 1.20.x ]
os: [ ubuntu-latest ]

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go-version }}

Expand Down
72 changes: 36 additions & 36 deletions .github/workflows/kubernetes-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
go-version: [ 1.19.x ]
go-version: [ 1.20.x ]
os: [ ubuntu-latest ]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go-version }}
- name: Get Dependedencies
Expand All @@ -26,12 +26,12 @@ jobs:
- getdeps
strategy:
matrix:
go-version: [ 1.19.x ]
go-version: [ 1.20.x ]
os: [ ubuntu-latest ]

steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go-version }}
- name: Lint
Expand All @@ -43,12 +43,12 @@ jobs:
- getdeps
strategy:
matrix:
go-version: [ 1.19.x ]
go-version: [ 1.20.x ]
os: [ ubuntu-latest ]

steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go-version }}
- name: govet
Expand All @@ -60,12 +60,12 @@ jobs:
- getdeps
strategy:
matrix:
go-version: [ 1.19.x ]
go-version: [ 1.20.x ]
os: [ ubuntu-latest ]

steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go-version }}
- name: Go Test
Expand All @@ -77,12 +77,12 @@ jobs:
- getdeps
strategy:
matrix:
go-version: [ 1.19.x ]
go-version: [ 1.20.x ]
os: [ ubuntu-latest ]

steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go-version }}
- name: Logsearch Binary
Expand All @@ -94,12 +94,12 @@ jobs:
- getdeps
strategy:
matrix:
go-version: [ 1.19.x ]
go-version: [ 1.20.x ]
os: [ ubuntu-latest ]

steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go-version }}
- name: Operator Binary
Expand All @@ -112,12 +112,12 @@ jobs:
- operator
strategy:
matrix:
go-version: [ 1.19.x ]
go-version: [ 1.20.x ]
os: [ ubuntu-latest ]

steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go-version }}
- name: Docker Container
Expand All @@ -136,12 +136,12 @@ jobs:
- govet
strategy:
matrix:
go-version: [ 1.19.x ]
go-version: [ 1.20.x ]
os: [ ubuntu-latest ]

steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go-version }}
- name: Prometheus test on Kind
Expand All @@ -158,12 +158,12 @@ jobs:
- govet
strategy:
matrix:
go-version: [ 1.19.x ]
go-version: [ 1.20.x ]
os: [ ubuntu-latest ]

steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go-version }}
- name: Tenant upgrade test on Kind
Expand All @@ -180,12 +180,12 @@ jobs:
- govet
strategy:
matrix:
go-version: [ 1.19.x ]
go-version: [ 1.20.x ]
os: [ ubuntu-latest ]

steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go-version }}

Expand All @@ -204,12 +204,12 @@ jobs:
- govet
strategy:
matrix:
go-version: [ 1.19.x ]
go-version: [ 1.20.x ]
os: [ ubuntu-latest ]

steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go-version }}

Expand All @@ -228,12 +228,12 @@ jobs:
- govet
strategy:
matrix:
go-version: [ 1.19.x ]
go-version: [ 1.20.x ]
os: [ ubuntu-latest ]

steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go-version }}

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/shellcheck.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
name: Shellcheck
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: actions/setup-go@v3

- name: Run ShellCheck
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/vulncheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
go-version: [ 1.19 ]
go-version: [ 1.20.x ]
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v3
Expand Down
2 changes: 1 addition & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ linters-settings:
locale: US

run:
go: '1.19'
go: '1.20'

linters:
disable-all: true
Expand Down
2 changes: 1 addition & 1 deletion .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ before:
hooks:
- make clean
- go generate ./...
- go mod tidy -compat=1.19
- go mod tidy -compat=1.20
- go mod download

builds:
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ getdeps:
@echo "Checking dependencies"
@mkdir -p ${GOPATH}/bin
@echo "Installing golangci-lint" && \
go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.49.0 && \
go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest && \
echo "Installing govulncheck" && \
go install golang.org/x/vuln/cmd/govulncheck@latest

Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/minio/operator

go 1.19
go 1.20

require (
github.com/blang/semver/v4 v4.0.0
Expand Down
2 changes: 1 addition & 1 deletion kubectl-minio/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/minio/kubectl-minio

go 1.19
go 1.20

replace github.com/minio/operator => ../

Expand Down
2 changes: 1 addition & 1 deletion logsearchapi/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/minio/operator/logsearchapi

go 1.19
go 1.20

require (
github.com/georgysavva/scany v1.2.1
Expand Down
6 changes: 0 additions & 6 deletions testing/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,6 @@ function install_operator() {
value=minio-operator
fi

echo "Scaling down MinIO Operator Deployment"
try kubectl -n minio-operator scale deployment minio-operator --replicas=1

# Reusing the wait for both, Kustomize and Helm
echo "Waiting for k8s api"
sleep 10
Expand Down Expand Up @@ -128,9 +125,6 @@ function install_operator_version() {
# Initialize the MinIO Kubernetes Operator
kubectl minio init

echo "Scaling down MinIO Operator Deployment"
try kubectl -n minio-operator scale deployment minio-operator --replicas=1
cniackz marked this conversation as resolved.
Show resolved Hide resolved

# Verify installation of the plugin
echo "Installed operator release: $(kubectl minio version)"

Expand Down
34 changes: 14 additions & 20 deletions testing/console-tenant+kes.sh
Original file line number Diff line number Diff line change
Expand Up @@ -109,29 +109,23 @@ function test_kes_tenant() {
return 1
fi

COOKIE=$(curl 'http://localhost:9090/api/v1/login/operator' -X POST \
-H 'Content-Type: application/json' \
--data-raw '{"jwt":"'$SA_TOKEN'"}' -i | grep "Set-Cookie: token=" | sed -e "s/Set-Cookie: token=//g" | awk -F ';' '{print $1}')
echo "COOKIE: ${COOKIE}"

echo "Creating Tenant"
CREDENTIALS=$(curl 'http://localhost:9090/api/v1/tenants' \
-X POST \
-H 'Content-Type: application/json' \
-H 'Cookie: token='$COOKIE'' \
--data-raw '{"name":"kes-tenant","namespace":"default","access_key":"","secret_key":"","access_keys":[],"secret_keys":[],"enable_tls":true,"enable_console":true,"enable_prometheus":true,"service_name":"","image":"","expose_minio":true,"expose_console":true,"pools":[{"name":"pool-0","servers":4,"volumes_per_server":1,"volume_configuration":{"size":26843545600,"storage_class_name":"standard"},"securityContext":null,"affinity":{"podAntiAffinity":{"requiredDuringSchedulingIgnoredDuringExecution":[{"labelSelector":{"matchExpressions":[{"key":"v1.min.io/tenant","operator":"In","values":["kes-tenant"]},{"key":"v1.min.io/pool","operator":"In","values":["pool-0"]}]},"topologyKey":"kubernetes.io/hostname"}]}}}],"erasureCodingParity":2,"logSearchConfiguration":{"image":"minio/operator:dev","postgres_image":"","postgres_init_image":""},"prometheusConfiguration":{"image":"","sidecar_image":"","init_image":""},"tls":{"minio":[],"ca_certificates":[],"console_ca_certificates":[]},"encryption":{"replicas":"1","securityContext":{"runAsUser":"1000","runAsGroup":"1000","fsGroup":"1000","runAsNonRoot":true},"image":"","vault":{"endpoint":"http://vault.default.svc.cluster.local:8200","engine":"","namespace":"","prefix":"my-minio","approle":{"engine":"","id":"'$ROLE_ID'","secret":"'$SECRET_ID'","retry":0},"tls":{},"status":{"ping":0}}},"idp":{"keys":[{"access_key":"console","secret_key":"console123"}]}}')
echo "CREDENTIALS: ${CREDENTIALS}"

echo "Check Tenant Status in default name space for kes-tenant:"
check_tenant_status default kes-tenant
echo "Creating Tenant"
sed -i -e 's/ROLE_ID/'"$ROLE_ID"'/g' "${SCRIPT_DIR}/kes-config.yaml"
sed -i -e 's/SECRET_ID/'"$SECRET_ID"'/g' "${SCRIPT_DIR}/kes-config.yaml"
cp "${SCRIPT_DIR}/kes-config.yaml" "${SCRIPT_DIR}/../examples/kustomization/tenant-kes-encryption/kes-configuration-secret.yaml"
yq e -i '.spec.kes.image = "minio/kes:v0.22.3"' "${SCRIPT_DIR}/../examples/kustomization/tenant-kes-encryption/tenant.yaml"
kubectl apply -k "${SCRIPT_DIR}/../examples/kustomization/tenant-kes-encryption"

echo "Port Forwarding tenant"
try kubectl port-forward $(kubectl get pods -l v1.min.io/tenant=kes-tenant | grep -v NAME | awk '{print $1}' | head -1) 9000 &
echo "Check Tenant Status in tenant-kms-encrypted name space for storage-kms-encrypted:"
check_tenant_status tenant-kms-encrypted storage-kms-encrypted

TENANT_CONFIG_SECRET=$(kubectl -n default get tenants.minio.min.io kes-tenant -o jsonpath="{.spec.configuration.name}")
USER=$(kubectl -n default get secrets "$TENANT_CONFIG_SECRET" -o go-template='{{index .data "config.env"|base64decode }}' | grep 'export MINIO_ROOT_USER="' | sed -e 's/export MINIO_ROOT_USER="//g' | sed -e 's/"//g')
PASSWORD=$(kubectl -n default get secrets "$TENANT_CONFIG_SECRET" -o go-template='{{index .data "config.env"|base64decode }}' | grep 'export MINIO_ROOT_PASSWORD="' | sed -e 's/export MINIO_ROOT_PASSWORD="//g' | sed -e 's/"//g')
echo "Port Forwarding tenant"
try kubectl port-forward $(kubectl get pods -l v1.min.io/tenant=storage-kms-encrypted -n tenant-kms-encrypted | grep -v NAME | awk '{print $1}' | head -1) 9000 -n tenant-kms-encrypted &

TENANT_CONFIG_SECRET=$(kubectl -n tenant-kms-encrypted get tenants.minio.min.io storage-kms-encrypted -o jsonpath="{.spec.configuration.name}")
# kes-tenant-env-configuration
USER=$(kubectl -n tenant-kms-encrypted get secrets "$TENANT_CONFIG_SECRET" -o go-template='{{index .data "config.env"|base64decode }}' | grep 'export MINIO_ROOT_USER="' | sed -e 's/export MINIO_ROOT_USER="//g' | sed -e 's/"//g')
PASSWORD=$(kubectl -n tenant-kms-encrypted get secrets "$TENANT_CONFIG_SECRET" -o go-template='{{index .data "config.env"|base64decode }}' | grep 'export MINIO_ROOT_PASSWORD="' | sed -e 's/export MINIO_ROOT_PASSWORD="//g' | sed -e 's/"//g')

totalwait=0
until (mc config host add kestest https://localhost:9000 $USER $PASSWORD --insecure); do
Expand Down
Loading