Skip to content

Commit

Permalink
Merge branch 'minio:master' into resize_pvc
Browse files Browse the repository at this point in the history
  • Loading branch information
jiuker authored Jan 23, 2024
2 parents 3a620d5 + ed454ec commit eae4215
Show file tree
Hide file tree
Showing 54 changed files with 2,804 additions and 199 deletions.
6 changes: 4 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ verify: getdeps govet lint
binary:
@CGO_ENABLED=0 GOOS=linux go build -trimpath --ldflags $(LDFLAGS) -o minio-operator ./cmd/operator

operator: assets binary
operator: binary

docker: operator
@docker buildx build --no-cache --platform linux/amd64,linux/arm64 -t $(TAG) .
@docker buildx build --no-cache --load --platform linux/$(GOARCH) -t $(TAG) .

build: regen-crd verify plugin operator docker

Expand Down Expand Up @@ -69,11 +69,13 @@ regen-crd:
@${GOPATH}/bin/controller-gen crd:maxDescLen=0,generateEmbeddedObjectMeta=true paths="./..." output:crd:artifacts:config=$(KUSTOMIZE_CRDS)
@sed 's#namespace: minio-operator#namespace: {{ .Release.Namespace }}#g' resources/base/crds/minio.min.io_tenants.yaml > $(HELM_TEMPLATES)/minio.min.io_tenants.yaml
@sed 's#namespace: minio-operator#namespace: {{ .Release.Namespace }}#g' resources/base/crds/sts.min.io_policybindings.yaml > $(HELM_TEMPLATES)/sts.min.io_policybindings.yaml
@sed 's#namespace: minio-operator#namespace: {{ .Release.Namespace }}#g' resources/base/crds/job.min.io_miniojobs.yaml > $(HELM_TEMPLATES)/job.min.io_jobs.yaml

regen-crd-docs:
@echo "Installing crd-ref-docs" && GO111MODULE=on go install -v github.com/elastic/crd-ref-docs@latest
@${GOPATH}/bin/crd-ref-docs --source-path=./pkg/apis/minio.min.io/v2 --config=docs/templates/config.yaml --renderer=asciidoctor --output-path=docs/tenant_crd.adoc --templates-dir=docs/templates/asciidoctor/
@${GOPATH}/bin/crd-ref-docs --source-path=./pkg/apis/sts.min.io/v1alpha1 --config=docs/templates/config.yaml --renderer=asciidoctor --output-path=docs/policybinding_crd.adoc --templates-dir=docs/templates/asciidoctor/
@${GOPATH}/bin/crd-ref-docs --source-path=./pkg/apis/job.min.io/v1alpha1 --config=docs/templates/config.yaml --renderer=asciidoctor --output-path=docs/job_crd.adoc --templates-dir=docs/templates/asciidoctor/

plugin: regen-crd
@echo "Building 'kubectl-minio' binary"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -764,4 +764,3 @@ spec:
- image: quay.io/minio/minio@sha256:91866cdaad4cc11d2f86056b234f33f3768a44adc600ea37c225708c83076bc3
name: minio-91866cdaad4cc11d2f86056b234f33f3768a44adc600ea37c225708c83076bc3-annotation
version: 5.0.11
replaces: minio-operator.v5.0.10
Original file line number Diff line number Diff line change
Expand Up @@ -764,4 +764,3 @@ spec:
- image: quay.io/minio/minio@sha256:91866cdaad4cc11d2f86056b234f33f3768a44adc600ea37c225708c83076bc3
name: minio-91866cdaad4cc11d2f86056b234f33f3768a44adc600ea37c225708c83076bc3-annotation
version: 5.0.11
replaces: "null"
Original file line number Diff line number Diff line change
Expand Up @@ -759,11 +759,10 @@ spec:
name: MinIO Inc
url: https://min.io
relatedImages:
- image: quay.io/minio/operator@sha256:3ab501c476f269c4e4fc84017543ff7f6c8209ed474d77de472311472ba2e2ff
name: console
- image: quay.io/minio/operator@sha256:3ab501c476f269c4e4fc84017543ff7f6c8209ed474d77de472311472ba2e2ff
name: minio-operator
- image: quay.io/minio/minio@sha256:91866cdaad4cc11d2f86056b234f33f3768a44adc600ea37c225708c83076bc3
name: minio-91866cdaad4cc11d2f86056b234f33f3768a44adc600ea37c225708c83076bc3-annotation
- image: quay.io/minio/operator@sha256:3ab501c476f269c4e4fc84017543ff7f6c8209ed474d77de472311472ba2e2ff
name: console
version: 5.0.11
replaces: minio-operator-rhmp.v5.0.10
Original file line number Diff line number Diff line change
Expand Up @@ -766,4 +766,3 @@ spec:
- image: quay.io/minio/minio@sha256:91866cdaad4cc11d2f86056b234f33f3768a44adc600ea37c225708c83076bc3
name: minio-91866cdaad4cc11d2f86056b234f33f3768a44adc600ea37c225708c83076bc3-annotation
version: 5.0.11
replaces: minio-operator.v5.0.10
Original file line number Diff line number Diff line change
Expand Up @@ -766,4 +766,3 @@ spec:
- image: quay.io/minio/minio@sha256:91866cdaad4cc11d2f86056b234f33f3768a44adc600ea37c225708c83076bc3
name: minio-91866cdaad4cc11d2f86056b234f33f3768a44adc600ea37c225708c83076bc3-annotation
version: 5.0.11
replaces: "null"
162 changes: 162 additions & 0 deletions docs/job_crd.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,162 @@
// Generated documentation. Please do not edit.
:anchor_prefix: k8s-api

[id="{p}-api-reference"]
== API Reference

:minio-image: https://hub.docker.com/r/minio/minio/tags[minio/minio:RELEASE.2023-11-15T20-43-25Z]
:kes-image: https://hub.docker.com/r/minio/kes/tags[minio/kes:2023-11-10T10-44-28Z]


[id="{anchor_prefix}-job-min-io-v1alpha1"]
=== job.min.io/v1alpha1

Package v1alpha1 - The following parameters are specific to the `job.min.io/v1alpha1` MinIOJob CRD API.

MinIOJob is an automated InfrastructureAsCode integrated with Minio Operator STS to configure MinIO Tenants.



[id="{anchor_prefix}-github-com-minio-operator-pkg-apis-job-min-io-v1alpha1-commandspec"]
==== CommandSpec

CommandSpec (`spec`) defines the configuration of a MinioClient Command.

.Appears In:
****
- xref:{anchor_prefix}-github-com-minio-operator-pkg-apis-job-min-io-v1alpha1-miniojobspec[$$MinIOJobSpec$$]
****

[cols="25a,75a", options="header"]
|===
| Field | Description

|*`op`* __string__
|*Required* +
Operation is the MinioClient Action

|*`name`* __string__
|Name is the Command Name, optional, required if want to reference it with `DependsOn`

|*`args`* __object (keys:string, values:string)__
|Args Arguments to pass to the action

|*`dependsOn`* __string array__
|DependsOn List of named `command` in this MinioJob that have to be scheduled and executed before this command runs

|===


[id="{anchor_prefix}-github-com-minio-operator-pkg-apis-job-min-io-v1alpha1-commandstatus"]
==== CommandStatus

CommandStatus Status of MinioJob command execution

.Appears In:
****
- xref:{anchor_prefix}-github-com-minio-operator-pkg-apis-job-min-io-v1alpha1-miniojobstatus[$$MinIOJobStatus$$]
****

[cols="25a,75a", options="header"]
|===
| Field | Description

|*`name`* __string__
|

|*`result`* __string__
|*Required* +

|*`message`* __string__
|

|===


[id="{anchor_prefix}-github-com-minio-operator-pkg-apis-job-min-io-v1alpha1-miniojob"]
==== MinIOJob

MinIOJob is a top-level type. A client is created for it

.Appears In:
****
- xref:{anchor_prefix}-github-com-minio-operator-pkg-apis-job-min-io-v1alpha1-miniojoblist[$$MinIOJobList$$]
****

[cols="25a,75a", options="header"]
|===
| Field | Description

|*`metadata`* __link:https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.23/#objectmeta-v1-meta[$$ObjectMeta$$]__
|Refer to Kubernetes API documentation for fields of `metadata`.


|*`spec`* __xref:{anchor_prefix}-github-com-minio-operator-pkg-apis-job-min-io-v1alpha1-miniojobspec[$$MinIOJobSpec$$]__
|*Required* +
The root field for the MinIOJob object.

|===




[id="{anchor_prefix}-github-com-minio-operator-pkg-apis-job-min-io-v1alpha1-miniojobspec"]
==== MinIOJobSpec

MinIOJobSpec (`spec`) defines the configuration of a MinIOJob object. +

.Appears In:
****
- xref:{anchor_prefix}-github-com-minio-operator-pkg-apis-job-min-io-v1alpha1-miniojob[$$MinIOJob$$]
****

[cols="25a,75a", options="header"]
|===
| Field | Description

|*`serviceAccountName`* __string__
|*Required* +
Service Account name for the jobs to run

|*`tenant`* __xref:{anchor_prefix}-github-com-minio-operator-pkg-apis-job-min-io-v1alpha1-tenantref[$$TenantRef$$]__
|*Required* +
TenantRef Reference for minio Tenant to eun the jobs against

|*`execution`* __Execution__
|Execution order of the jobs, either `parallel` or `sequential`. Defaults to `parallel` if not provided.

|*`failureStrategy`* __FailureStrategy__
|FailureStrategy is the forward plan in case of the failure of one or more MinioJob pods Either `stopOnFailure` or `continueOnFailure`, defaults to `continueOnFailure`.

|*`commands`* __xref:{anchor_prefix}-github-com-minio-operator-pkg-apis-job-min-io-v1alpha1-commandspec[$$CommandSpec$$] array__
|*Required* +
Commands List of MinioClient commands

|===




[id="{anchor_prefix}-github-com-minio-operator-pkg-apis-job-min-io-v1alpha1-tenantref"]
==== TenantRef

TenantRef Is the reference to the target tenant of the jobs

.Appears In:
****
- xref:{anchor_prefix}-github-com-minio-operator-pkg-apis-job-min-io-v1alpha1-miniojobspec[$$MinIOJobSpec$$]
****

[cols="25a,75a", options="header"]
|===
| Field | Description

|*`name`* __string__
|*Required* +

|*`namespace`* __string__
|*Required* +

|===


2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ require (
github.com/lestrrat-go/blackmagic v1.0.2 // indirect
github.com/lestrrat-go/httpcc v1.0.1 // indirect
github.com/lestrrat-go/iter v1.0.2 // indirect
github.com/lestrrat-go/jwx v1.2.27 // indirect
github.com/lestrrat-go/jwx v1.2.28 // indirect
github.com/lestrrat-go/option v1.0.1 // indirect
github.com/lucasb-eyer/go-colorful v1.2.0 // indirect
github.com/lufia/plan9stats v0.0.0-20231016141302-07b5767bb0ed // indirect
Expand Down
5 changes: 2 additions & 3 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,8 @@ github.com/lestrrat-go/httpcc v1.0.1 h1:ydWCStUeJLkpYyjLDHihupbn2tYmZ7m22BGkcvZZ
github.com/lestrrat-go/httpcc v1.0.1/go.mod h1:qiltp3Mt56+55GPVCbTdM9MlqhvzyuL6W/NMDA8vA5E=
github.com/lestrrat-go/iter v1.0.2 h1:gMXo1q4c2pHmC3dn8LzRhJfP1ceCbgSiT9lUydIzltI=
github.com/lestrrat-go/iter v1.0.2/go.mod h1:Momfcq3AnRlRjI5b5O8/G5/BvpzrhoFTZcn06fEOPt4=
github.com/lestrrat-go/jwx v1.2.27 h1:cvnTnda/YzdyFuWdEAMkI6BsLtItSrASEVCI3C/IUEQ=
github.com/lestrrat-go/jwx v1.2.27/go.mod h1:Stob9LjSqR3lOmNdxF0/TvZo60V3hUGv8Fr7Bwzla3k=
github.com/lestrrat-go/jwx v1.2.28 h1:uadI6o0WpOVrBSf498tRXZIwPpEtLnR9CvqPFXeI5sA=
github.com/lestrrat-go/jwx v1.2.28/go.mod h1:nF+91HEMh/MYFVwKPl5HHsBGMPscqbQb+8IDQdIazP8=
github.com/lestrrat-go/option v1.0.0/go.mod h1:5ZHFbivi4xwXxhxY9XHDe2FHo6/Z7WWmtT7T5nBBp3I=
github.com/lestrrat-go/option v1.0.1 h1:oAzP2fvZGQKWkvHa1/SAcFolBEca1oN+mQ7eooNBEYU=
github.com/lestrrat-go/option v1.0.1/go.mod h1:5ZHFbivi4xwXxhxY9XHDe2FHo6/Z7WWmtT7T5nBBp3I=
Expand Down Expand Up @@ -414,7 +414,6 @@ golang.org/x/crypto v0.0.0-20210220033148-5ea612d1eb83/go.mod h1:jdWPYTVW3xRLrWP
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
golang.org/x/crypto v0.0.0-20211209193657-4570a0811e8b/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
golang.org/x/crypto v0.16.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4=
golang.org/x/crypto v0.17.0 h1:r8bRNjWL3GshPW3gkd+RpvzWrZAwPS49OmTGZ/uhM4k=
golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4=
golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e h1:+WEEuIdZHnUeJJmEUjyYC2gfUMj69yZXw17EnHg/otA=
Expand Down
112 changes: 112 additions & 0 deletions helm/operator/templates/job.min.io_jobs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.11.1
creationTimestamp: null
name: miniojobs.job.min.io
spec:
group: job.min.io
names:
kind: MinIOJob
listKind: MinIOJobList
plural: miniojobs
shortNames:
- miniojob
singular: miniojob
scope: Namespaced
versions:
- additionalPrinterColumns:
- jsonPath: .spec.tenant.name
name: Tenant
type: string
- jsonPath: .spec.status.phase
name: Phase
type: string
name: v1alpha1
schema:
openAPIV3Schema:
properties:
apiVersion:
type: string
kind:
type: string
metadata:
type: object
spec:
properties:
commands:
items:
properties:
args:
additionalProperties:
type: string
type: object
dependsOn:
items:
type: string
type: array
name:
type: string
op:
type: string
required:
- op
type: object
type: array
execution:
default: parallel
enum:
- parallel
- sequential
type: string
failureStrategy:
default: continueOnFailure
enum:
- continueOnFailure
- stopOnFailure
type: string
serviceAccountName:
type: string
tenant:
properties:
name:
type: string
namespace:
type: string
required:
- name
- namespace
type: object
required:
- commands
- serviceAccountName
- tenant
type: object
status:
properties:
commands:
items:
properties:
message:
type: string
name:
type: string
result:
type: string
required:
- result
type: object
type: array
phase:
type: string
required:
- commands
- phase
type: object
type: object
served: true
storage: true
subresources:
status: {}
16 changes: 16 additions & 0 deletions helm/tenant/templates/api-ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,20 @@ spec:
{{- else }}
name: http-minio
{{- end }}
{{- if .Values.tenant.features.bucketDNS }}
- host: "*.{{ .Values.ingress.api.host }}"
http:
paths:
- path: {{ .Values.ingress.api.path }}
pathType: {{ .Values.ingress.api.pathType }}
backend:
service:
name: minio
port:
{{- if or .Values.tenant.certificate.requestAutoCert (not (empty .Values.tenant.certificate.externalCertSecret)) }}
name: https-minio
{{- else }}
name: http-minio
{{- end }}
{{- end }}
{{- end }}
2 changes: 1 addition & 1 deletion k8s/update-codegen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ chmod +x ${CODEGEN_PKG}/generate-internal-groups.sh
cd ${SCRIPT_ROOT}
${CODEGEN_PKG}/generate-groups.sh "all" \
$ROOT_PKG/pkg/client $ROOT_PKG/pkg/apis \
"minio.min.io:v2 sts.min.io:v1alpha1" \
"minio.min.io:v2 sts.min.io:v1alpha1 job.min.io:v1alpha1" \
--output-base "${TEMP_DIR}" \
--go-header-file "k8s/boilerplate.go.txt"

Expand Down
Loading

0 comments on commit eae4215

Please sign in to comment.