diff --git a/Makefile b/Makefile index d17593112..0e52c62da 100644 --- a/Makefile +++ b/Makefile @@ -71,7 +71,7 @@ test-e2e-remote: test-login docker push $(TEST_IMAGE) operator-sdk test local ./test/e2e --operator-namespace default \ --namespaced-manifest ./test/e2e/resources/rbac-operator.yaml \ - --global-manifest deploy/crds/zookeeper.pravega.io_zookeeperclusters.yaml \ + --global-manifest deploy/crds/zookeeper.pravega.io_zookeeperclusters_crd.yaml \ --image $(TEST_IMAGE) --go-test-flags "-v -timeout 0" test-e2e-local: @@ -114,22 +114,3 @@ check-license: update-kube-version: ./scripts/update_kube_version.sh ${KUBE_VERSION} - -manifests: controller-gen - $(CONTROLLER_GEN) crd paths="./..." output:crd:artifacts:config=deploy/crds - $(CONTROLLER_GEN) crd paths="./..." output:crd:artifacts:config=charts/zookeeper-operator/crds - -controller-gen: -ifeq (, $(shell which controller-gen)) - @{ \ - set -e ;\ - CONTROLLER_GEN_TMP_DIR=$$(mktemp -d) ;\ - cd $$CONTROLLER_GEN_TMP_DIR ;\ - go mod init tmp ;\ - go get sigs.k8s.io/controller-tools/cmd/controller-gen@v0.3.0 ;\ - rm -rf $$CONTROLLER_GEN_TMP_DIR ;\ - } -CONTROLLER_GEN=$(GOPATH)/bin/controller-gen -else -CONTROLLER_GEN=$(shell which controller-gen) -endif diff --git a/charts/zookeeper-operator/crds/zookeeper.pravega.io_zookeeperclusters.yaml b/charts/zookeeper-operator/crds/zookeeper.pravega.io_zookeeperclusters_crd.yaml similarity index 95% rename from charts/zookeeper-operator/crds/zookeeper.pravega.io_zookeeperclusters.yaml rename to charts/zookeeper-operator/crds/zookeeper.pravega.io_zookeeperclusters_crd.yaml index dbdc5c37c..852081c71 100644 --- a/charts/zookeeper-operator/crds/zookeeper.pravega.io_zookeeperclusters.yaml +++ b/charts/zookeeper-operator/crds/zookeeper.pravega.io_zookeeperclusters_crd.yaml @@ -8,35 +8,6 @@ metadata: creationTimestamp: null name: zookeeperclusters.zookeeper.pravega.io spec: - additionalPrinterColumns: - - JSONPath: .spec.replicas - description: The number of ZooKeeper servers in the ensemble - name: Replicas - type: integer - - JSONPath: .status.readyReplicas - description: The number of ZooKeeper servers in the ensemble that are in a Ready - state - name: Ready Replicas - type: integer - - JSONPath: .status.currentVersion - description: The current Zookeeper version - name: Version - type: string - - JSONPath: .spec.image.tag - description: The desired Zookeeper version - name: Desired Version - type: string - - JSONPath: .status.internalClientEndpoint - description: Client endpoint internal to cluster network - name: Internal Endpoint - type: string - - JSONPath: .status.externalClientEndpoint - description: Client endpoint external to cluster network via LoadBalancer - name: External Endpoint - type: string - - JSONPath: .metadata.creationTimestamp - name: Age - type: date group: zookeeper.pravega.io names: kind: ZookeeperCluster @@ -97,7 +68,7 @@ spec: type: integer type: object domainName: - description: Domain Name to be used for DNS + description: External host name appended for dns annotation type: string ephemeral: description: Ephemeral is the configuration which helps create ephemeral @@ -137,6 +108,10 @@ spec: pullPolicy: description: PullPolicy describes a policy for if/when to pull a container image + enum: + - Always + - Never + - IfNotPresent type: string repository: type: string @@ -162,6 +137,9 @@ spec: If it's set to Delete, the corresponding PVCs will be deleted by the operator when zookeeper cluster is deleted. The default value is Retain. + enum: + - Delete + - Retain type: string spec: description: PersistentVolumeClaimSpec is the spec to describe PVC @@ -172,6 +150,10 @@ spec: description: 'AccessModes contains the desired access modes the volume should have. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes-1' items: + enum: + - ReadWriteOnce + - ReadOnlyMany + - ReadWriteMany type: string type: array dataSource: @@ -248,6 +230,11 @@ spec: description: operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. + enum: + - In + - NotIn + - Exists + - DoesNotExist type: string values: description: values is an array of string values. @@ -338,6 +325,13 @@ spec: to a set of values. Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt. + enum: + - In + - NotIn + - Exists + - DoesNotExist + - Gt + - Lt type: string values: description: An array of string values. @@ -374,6 +368,13 @@ spec: to a set of values. Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt. + enum: + - In + - NotIn + - Exists + - DoesNotExist + - Gt + - Lt type: string values: description: An array of string values. @@ -439,6 +440,13 @@ spec: to a set of values. Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt. + enum: + - In + - NotIn + - Exists + - DoesNotExist + - Gt + - Lt type: string values: description: An array of string values. @@ -475,6 +483,13 @@ spec: to a set of values. Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt. + enum: + - In + - NotIn + - Exists + - DoesNotExist + - Gt + - Lt type: string values: description: An array of string values. @@ -548,6 +563,11 @@ spec: relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. + enum: + - In + - NotIn + - Exists + - DoesNotExist type: string values: description: values is an array of string @@ -646,6 +666,11 @@ spec: description: operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. + enum: + - In + - NotIn + - Exists + - DoesNotExist type: string values: description: values is an array of string @@ -744,6 +769,11 @@ spec: relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. + enum: + - In + - NotIn + - Exists + - DoesNotExist type: string values: description: values is an array of string @@ -842,6 +872,11 @@ spec: description: operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. + enum: + - In + - NotIn + - Exists + - DoesNotExist type: string values: description: values is an array of string @@ -1170,6 +1205,7 @@ spec: that kubernetes will give for a pod instance to shutdown normally. The default value is 30. format: int64 + minimum: 0 type: integer tolerations: description: Tolerations specifies the pod's tolerations. @@ -1220,6 +1256,8 @@ spec: description: Number of port to expose on the pod's IP address. This must be a valid port number, 0 < x < 65536. format: int32 + minimum: 1 + maximum: 65535 type: integer hostIP: description: What host IP to bind the external port to. @@ -1230,6 +1268,8 @@ spec: is specified, this must match ContainerPort. Most containers do not need this. format: int32 + minimum: 1 + maximum: 65535 type: integer name: description: If specified, this must be an IANA_SVC_NAME and unique @@ -1239,6 +1279,10 @@ spec: protocol: description: Protocol for port. Must be UDP, TCP, or SCTP. Defaults to "TCP". + enum: + - UDP + - TCP + - SCTP type: string required: - containerPort @@ -1250,11 +1294,15 @@ spec: cluster equal to the expected size. \n The valid range of size is from 1 to 7." format: int32 + minimum: 1 type: integer storageType: description: StorageType is used to tell which type of storage we will be using It can take either Ephemeral or persistence Default StorageType is Persistence storage + enum: + - ephemeral + - persistence type: string type: object status: @@ -1303,10 +1351,12 @@ spec: ready: items: type: string + nullable: true type: array unready: items: type: string + nullable: true type: array type: object metaRootCreated: diff --git a/charts/zookeeper/README.md b/charts/zookeeper/README.md index 8166e9ff2..526061564 100644 --- a/charts/zookeeper/README.md +++ b/charts/zookeeper/README.md @@ -42,7 +42,8 @@ The following table lists the configurable parameters of the Zookeeper chart and | `image.repository` | Image repository | `pravega/zookeeper` | | `image.tag` | Image tag | `0.2.8` | | `image.pullPolicy` | Image pull policy | `IfNotPresent` | -| `domainName` | Domain name to be used for DNS | | +| `domainName` | External host name appended for dns annotation | | +| `kubernetesClusterDomain` | Domain of the kubernetes cluster | `cluster.local` | | `labels` | Specifies the labels to be attached | `{}` | | `ports` | Groups the ports for a zookeeper cluster node for easy access | `[]` | | `pod` | Defines the policy to create new pods for the zookeeper cluster | `{}` | diff --git a/charts/zookeeper/templates/zookeeper.yaml b/charts/zookeeper/templates/zookeeper.yaml index 33740b674..7d48e37e9 100644 --- a/charts/zookeeper/templates/zookeeper.yaml +++ b/charts/zookeeper/templates/zookeeper.yaml @@ -11,7 +11,10 @@ spec: repository: {{ .Values.image.repository }} tag: {{ .Values.image.tag }} pullPolicy: {{ .Values.image.pullPolicy }} + {{- if .Values.domainName }} domainName: {{ .Values.domainName }} + {{- end }} + kubernetesClusterDomain: {{ .Values.kubernetesClusterDomain }} labels: {{ toYaml .Values.labels | indent 4 }} ports: diff --git a/charts/zookeeper/values.yaml b/charts/zookeeper/values.yaml index 3d80d7372..f5d8f691a 100644 --- a/charts/zookeeper/values.yaml +++ b/charts/zookeeper/values.yaml @@ -8,6 +8,7 @@ image: domainName: labels: {} ports: [] +kubernetesClusterDomain: "cluster.local" pod: {} # labels: {} diff --git a/deploy/crds/zookeeper.pravega.io_zookeeperclusters.yaml b/deploy/crds/zookeeper.pravega.io_zookeeperclusters_crd.yaml similarity index 95% rename from deploy/crds/zookeeper.pravega.io_zookeeperclusters.yaml rename to deploy/crds/zookeeper.pravega.io_zookeeperclusters_crd.yaml index dbdc5c37c..852081c71 100644 --- a/deploy/crds/zookeeper.pravega.io_zookeeperclusters.yaml +++ b/deploy/crds/zookeeper.pravega.io_zookeeperclusters_crd.yaml @@ -8,35 +8,6 @@ metadata: creationTimestamp: null name: zookeeperclusters.zookeeper.pravega.io spec: - additionalPrinterColumns: - - JSONPath: .spec.replicas - description: The number of ZooKeeper servers in the ensemble - name: Replicas - type: integer - - JSONPath: .status.readyReplicas - description: The number of ZooKeeper servers in the ensemble that are in a Ready - state - name: Ready Replicas - type: integer - - JSONPath: .status.currentVersion - description: The current Zookeeper version - name: Version - type: string - - JSONPath: .spec.image.tag - description: The desired Zookeeper version - name: Desired Version - type: string - - JSONPath: .status.internalClientEndpoint - description: Client endpoint internal to cluster network - name: Internal Endpoint - type: string - - JSONPath: .status.externalClientEndpoint - description: Client endpoint external to cluster network via LoadBalancer - name: External Endpoint - type: string - - JSONPath: .metadata.creationTimestamp - name: Age - type: date group: zookeeper.pravega.io names: kind: ZookeeperCluster @@ -97,7 +68,7 @@ spec: type: integer type: object domainName: - description: Domain Name to be used for DNS + description: External host name appended for dns annotation type: string ephemeral: description: Ephemeral is the configuration which helps create ephemeral @@ -137,6 +108,10 @@ spec: pullPolicy: description: PullPolicy describes a policy for if/when to pull a container image + enum: + - Always + - Never + - IfNotPresent type: string repository: type: string @@ -162,6 +137,9 @@ spec: If it's set to Delete, the corresponding PVCs will be deleted by the operator when zookeeper cluster is deleted. The default value is Retain. + enum: + - Delete + - Retain type: string spec: description: PersistentVolumeClaimSpec is the spec to describe PVC @@ -172,6 +150,10 @@ spec: description: 'AccessModes contains the desired access modes the volume should have. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes-1' items: + enum: + - ReadWriteOnce + - ReadOnlyMany + - ReadWriteMany type: string type: array dataSource: @@ -248,6 +230,11 @@ spec: description: operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. + enum: + - In + - NotIn + - Exists + - DoesNotExist type: string values: description: values is an array of string values. @@ -338,6 +325,13 @@ spec: to a set of values. Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt. + enum: + - In + - NotIn + - Exists + - DoesNotExist + - Gt + - Lt type: string values: description: An array of string values. @@ -374,6 +368,13 @@ spec: to a set of values. Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt. + enum: + - In + - NotIn + - Exists + - DoesNotExist + - Gt + - Lt type: string values: description: An array of string values. @@ -439,6 +440,13 @@ spec: to a set of values. Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt. + enum: + - In + - NotIn + - Exists + - DoesNotExist + - Gt + - Lt type: string values: description: An array of string values. @@ -475,6 +483,13 @@ spec: to a set of values. Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt. + enum: + - In + - NotIn + - Exists + - DoesNotExist + - Gt + - Lt type: string values: description: An array of string values. @@ -548,6 +563,11 @@ spec: relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. + enum: + - In + - NotIn + - Exists + - DoesNotExist type: string values: description: values is an array of string @@ -646,6 +666,11 @@ spec: description: operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. + enum: + - In + - NotIn + - Exists + - DoesNotExist type: string values: description: values is an array of string @@ -744,6 +769,11 @@ spec: relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. + enum: + - In + - NotIn + - Exists + - DoesNotExist type: string values: description: values is an array of string @@ -842,6 +872,11 @@ spec: description: operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. + enum: + - In + - NotIn + - Exists + - DoesNotExist type: string values: description: values is an array of string @@ -1170,6 +1205,7 @@ spec: that kubernetes will give for a pod instance to shutdown normally. The default value is 30. format: int64 + minimum: 0 type: integer tolerations: description: Tolerations specifies the pod's tolerations. @@ -1220,6 +1256,8 @@ spec: description: Number of port to expose on the pod's IP address. This must be a valid port number, 0 < x < 65536. format: int32 + minimum: 1 + maximum: 65535 type: integer hostIP: description: What host IP to bind the external port to. @@ -1230,6 +1268,8 @@ spec: is specified, this must match ContainerPort. Most containers do not need this. format: int32 + minimum: 1 + maximum: 65535 type: integer name: description: If specified, this must be an IANA_SVC_NAME and unique @@ -1239,6 +1279,10 @@ spec: protocol: description: Protocol for port. Must be UDP, TCP, or SCTP. Defaults to "TCP". + enum: + - UDP + - TCP + - SCTP type: string required: - containerPort @@ -1250,11 +1294,15 @@ spec: cluster equal to the expected size. \n The valid range of size is from 1 to 7." format: int32 + minimum: 1 type: integer storageType: description: StorageType is used to tell which type of storage we will be using It can take either Ephemeral or persistence Default StorageType is Persistence storage + enum: + - ephemeral + - persistence type: string type: object status: @@ -1303,10 +1351,12 @@ spec: ready: items: type: string + nullable: true type: array unready: items: type: string + nullable: true type: array type: object metaRootCreated: diff --git a/go.mod b/go.mod index 9be7beb59..15251ae5a 100644 --- a/go.mod +++ b/go.mod @@ -5,11 +5,14 @@ go 1.13 require ( github.com/ghodss/yaml v1.0.1-0.20190212211648-25d852aebe32 github.com/go-logr/logr v0.1.0 + github.com/mdempsky/maligned v0.0.0-20180708014732-6e39bd26a8c8 // indirect + github.com/mibk/dupl v1.0.0 // indirect github.com/onsi/ginkgo v1.12.0 github.com/onsi/gomega v1.9.0 github.com/operator-framework/operator-sdk v0.17.0 github.com/pkg/errors v0.9.1 github.com/samuel/go-zookeeper v0.0.0-20190923202752-2cc03de413da + github.com/stripe/safesql v0.2.0 // indirect golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f // indirect golang.org/x/tools v0.0.0-20200331202046-9d5940d49312 // indirect k8s.io/api v0.17.5 diff --git a/go.sum b/go.sum index d5d559f1e..3c823ace9 100644 --- a/go.sum +++ b/go.sum @@ -476,6 +476,7 @@ github.com/karrick/godirwalk v1.10.12/go.mod h1:RoGL9dQei4vP9ilrpETWE8CLOZ1kiN0L github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= github.com/kisielk/errcheck v1.2.0 h1:reN85Pxc5larApoH1keMBiu2GWtPqXQ1nc9gx+jOU+E= github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= +github.com/kisielk/gotool v1.0.0 h1:AV2c/EiW3KqPNT9ZKl07ehoAGi4C5/01Cfbblndcapg= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.2 h1:DB17ag19krx9CFsz4o3enTrPXyIXCl+2iCXH/aMAp9s= @@ -528,6 +529,10 @@ github.com/mattn/go-sqlite3 v1.10.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsO github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/maxbrunsfeld/counterfeiter/v6 v6.2.2/go.mod h1:eD9eIE7cdwcMi9rYluz88Jz2VyhSmden33/aXg4oVIY= +github.com/mdempsky/maligned v0.0.0-20180708014732-6e39bd26a8c8 h1:zvpKif6gkrh82wAd2JIffdLyCL52N8r+ABwHxdIOvWM= +github.com/mdempsky/maligned v0.0.0-20180708014732-6e39bd26a8c8/go.mod h1:oGVD62YTpMEWw0JqJ2Vl48dzHywJBMlapkfsmhtokOU= +github.com/mibk/dupl v1.0.0 h1:aZc3jqrF9n0tUHwHt/+jsRxA8cRgA0Gdl56M7W7PoqE= +github.com/mibk/dupl v1.0.0/go.mod h1:pCr4pNxxIbFGvtyCOi0c7LVjmV6duhKWV+ex5vh38ME= github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= github.com/miekg/dns v1.1.15/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= github.com/miekg/dns v1.1.22/go.mod h1:bPDLeHnStXmXAq1m/Ch/hvfNHr14JKNPMBo3VZKjuso= @@ -753,6 +758,8 @@ github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXf github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +github.com/stripe/safesql v0.2.0 h1:xiefmCDd8c35PVSGrL2FhBiaKxviXnGziBDOpOejeBE= +github.com/stripe/safesql v0.2.0/go.mod h1:q7b2n0JmzM1mVGfcYpanfVb2j23cXZeWFxcILPn3JV4= github.com/syndtr/gocapability v0.0.0-20170704070218-db04d3cc01c8/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww= github.com/thanos-io/thanos v0.11.0/go.mod h1:N/Yes7J68KqvmY+xM6J5CJqEvWIvKSR5sqGtmuD6wDc= github.com/tidwall/pretty v0.0.0-20180105212114-65a9db5fad51/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= diff --git a/pkg/apis/zookeeper/v1beta1/status.go b/pkg/apis/zookeeper/v1beta1/status.go index a0c8ec013..0917d5ff6 100644 --- a/pkg/apis/zookeeper/v1beta1/status.go +++ b/pkg/apis/zookeeper/v1beta1/status.go @@ -59,7 +59,9 @@ type ZookeeperClusterStatus struct { // MembersStatus is the status of the members of the cluster with both // ready and unready node membership lists type MembersStatus struct { - Ready []string `json:"ready,omitempty"` + //+nullable + Ready []string `json:"ready,omitempty"` + //+nullable Unready []string `json:"unready,omitempty"` } diff --git a/pkg/apis/zookeeper/v1beta1/zookeepercluster_types.go b/pkg/apis/zookeeper/v1beta1/zookeepercluster_types.go index e52651fed..b5d225490 100644 --- a/pkg/apis/zookeeper/v1beta1/zookeepercluster_types.go +++ b/pkg/apis/zookeeper/v1beta1/zookeepercluster_types.go @@ -55,6 +55,7 @@ type ZookeeperClusterSpec struct { // equal to the expected size. // // The valid range of size is from 1 to 7. + // +kubebuilder:validation:Minimum=1 Replicas int32 `json:"replicas,omitempty"` Ports []v1.ContainerPort `json:"ports,omitempty"` @@ -79,7 +80,7 @@ type ZookeeperClusterSpec struct { // default values will be provided, and optional values will be excluded. Conf ZookeeperConfig `json:"config,omitempty"` - // Domain Name to be used for DNS + // External host name appended for dns annotation DomainName string `json:"domainName,omitempty"` // Domain of the kubernetes cluster, defaults to cluster.local @@ -194,13 +195,6 @@ func (s *ZookeeperClusterSpec) withDefaults(z *ZookeeperCluster) (changed bool) // +kubebuilder:object:root=true // +kubebuilder:subresource:status // +kubebuilder:resource:shortName=zk -// +kubebuilder:printcolumn:name="Replicas",type=integer,JSONPath=`.spec.replicas`,description="The number of ZooKeeper servers in the ensemble" -// +kubebuilder:printcolumn:name="Ready Replicas",type=integer,JSONPath=`.status.readyReplicas`,description="The number of ZooKeeper servers in the ensemble that are in a Ready state" -// +kubebuilder:printcolumn:name="Version",type=string,JSONPath=`.status.currentVersion`,description="The current Zookeeper version" -// +kubebuilder:printcolumn:name="Desired Version",type=string,JSONPath=`.spec.image.tag`,description="The desired Zookeeper version" -// +kubebuilder:printcolumn:name="Internal Endpoint",type=string,JSONPath=`.status.internalClientEndpoint`,description="Client endpoint internal to cluster network" -// +kubebuilder:printcolumn:name="External Endpoint",type=string,JSONPath=`.status.externalClientEndpoint`,description="Client endpoint external to cluster network via LoadBalancer" -// +kubebuilder:printcolumn:name="Age",type=date,JSONPath=`.metadata.creationTimestamp` // ZookeeperCluster is the Schema for the zookeeperclusters API type ZookeeperCluster struct { @@ -262,8 +256,9 @@ type Ports struct { // ContainerImage defines the fields needed for a Docker repository image. The // format here matches the predominant format used in Helm charts. type ContainerImage struct { - Repository string `json:"repository,omitempty"` - Tag string `json:"tag,omitempty"` + Repository string `json:"repository,omitempty"` + Tag string `json:"tag,omitempty"` + // +kubebuilder:validation:Enum="Always";"Never";"IfNotPresent" PullPolicy v1.PullPolicy `json:"pullPolicy,omitempty"` } @@ -323,6 +318,7 @@ type PodPolicy struct { // More info: https://kubernetes.io/docs/tasks/configure-pod-container/security-context SecurityContext *v1.PodSecurityContext `json:"securityContext,omitempty"` + // +kubebuilder:validation:Minimum=0 // TerminationGracePeriodSeconds is the amount of time that kubernetes will // give for a pod instance to shutdown normally. // The default value is 30. @@ -427,6 +423,7 @@ type Persistence struct { // VolumeReclaimPolicy is a zookeeper operator configuration. If it's set to Delete, // the corresponding PVCs will be deleted by the operator when zookeeper cluster is deleted. // The default value is Retain. + // +kubebuilder:validation:Enum="Delete";"Retain" VolumeReclaimPolicy VolumeReclaimPolicy `json:"reclaimPolicy,omitempty"` // PersistentVolumeClaimSpec is the spec to describe PVC for the container // This field is optional. If no PVC is specified default persistentvolume