Skip to content

Commit

Permalink
remove need for specific selector on labels, add current State (#114)
Browse files Browse the repository at this point in the history
  • Loading branch information
dvaldivia committed May 20, 2020
1 parent 10400d8 commit 60eca6e
Show file tree
Hide file tree
Showing 34 changed files with 536 additions and 432 deletions.
18 changes: 7 additions & 11 deletions examples/minioinstance.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,11 @@ metadata:
# scheduler:
# name: my-custom-scheduler
spec:
selector:
matchLabels:
app: minio # Should match spec.metadata.labels
## Add metadata to the all pods created by the StatefulSet
metadata:
labels:
app: minio # Should match spec.selector.matchLabels
## Optionally pass labels to be applied to the statefulset pods
#labels:
# app: minio
annotations:
prometheus.io/path: /minio/prometheus/metrics
prometheus.io/port: "9000"
Expand Down Expand Up @@ -114,12 +112,10 @@ spec:
replicas: 2
mcsSecret:
name: minio-mcs-secret
selector:
matchLabels:
app: mcs # Should match spec.mcs.metadata.labels
metadata:
labels:
app: mcs # Should match spec.mcs.selector.matchLabels
## Optionally metadata can be attached to the mcs pod
# metadata:
# labels:
# extra: labels
## Add environment variables to be set in MinIO container (https://github.com/minio/minio/tree/master/docs/config)
env:
- name: MINIO_BROWSER
Expand Down
42 changes: 39 additions & 3 deletions minio-operator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,52 @@ spec:
type: integer
minimum: 1
maximum: 32
image:
type: string
serviceName:
type: string
volumesPerServer:
type: integer
mountPath:
type: string
podManagementPolicy:
type: string
enum: [Parallel,OrderedReady]
default: Parallel
requestAutoCert:
type: boolean
default: false
version:
type: string
mountpath:
type: string
subpath:
type: string
mcs:
type: object
properties:
image:
type: string
replicas:
type: integer
default: 2
mcsSecret:
type: object
properties:
name:
type: string
status:
type: object
properties:
currentState:
type: string
subresources:
# status enables the status subresource.
status: {}
additionalPrinterColumns:
- name: Replicas
type: integer
jsonPath: ".spec.replicas"
- name: Current State
type: string
jsonPath: ".status.currentState"
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
Expand Down
2 changes: 1 addition & 1 deletion pkg/apis/operator.min.io/v1/names.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,5 +127,5 @@ func (mi *MinIOInstance) MCSDeploymentName() string {

// MCSCIServiceName returns the name for MCS Cluster IP Service
func (mi *MinIOInstance) MCSCIServiceName() string {
return mi.Name + MCSName + "-service"
return mi.Name + MCSName
}
3 changes: 2 additions & 1 deletion pkg/apis/operator.min.io/v1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,8 @@ type MinIOInstanceSpec struct {

// MinIOInstanceStatus is the status for a MinIOInstance resource
type MinIOInstanceStatus struct {
AvailableReplicas int32 `json:"availableReplicas"`
CurrentState string `json:"currentState"`
AvailableReplicas int32 `json:"availableReplicas"`
}

// CertificateConfig is a specification for certificate contents
Expand Down
30 changes: 15 additions & 15 deletions pkg/apis/operator.min.io/v1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 15 additions & 15 deletions pkg/client/clientset/versioned/clientset.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 15 additions & 15 deletions pkg/client/clientset/versioned/doc.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 15 additions & 15 deletions pkg/client/clientset/versioned/fake/clientset_generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 15 additions & 15 deletions pkg/client/clientset/versioned/fake/doc.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 16 additions & 16 deletions pkg/client/clientset/versioned/fake/register.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 15 additions & 15 deletions pkg/client/clientset/versioned/scheme/doc.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 15 additions & 15 deletions pkg/client/clientset/versioned/scheme/register.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 60eca6e

Please sign in to comment.