Skip to content

Commit

Permalink
Issue 233: Fixed chart bug and made ready and unready fields as nulla…
Browse files Browse the repository at this point in the history
…ble and added checks for various crd fields (#234)

* fixed chart bug and removed ready and unready fields from crd

Signed-off-by: prabhaker24 <[email protected]>

* added kubernetesdomainname

Signed-off-by: prabhaker24 <[email protected]>

* removed unnecessary comments and added check for replicas

Signed-off-by: prabhaker24 <[email protected]>

* changed description

Signed-off-by: prabhaker24 <[email protected]>

* more field validation added

Signed-off-by: prabhaker24 <[email protected]>

* added kubernetesClusterDomain in readme

Signed-off-by: prabhaker24 <[email protected]>

* added check for storagetype and access mode

Signed-off-by: prabhaker24 <[email protected]>

Co-authored-by: prabhaker24 <[email protected]>
  • Loading branch information
Prabhaker24 and prabhaker24 authored Sep 3, 2020
1 parent 1bd5bbf commit b5502fb
Show file tree
Hide file tree
Showing 10 changed files with 187 additions and 92 deletions.
21 changes: 1 addition & 20 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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/[email protected] ;\
rm -rf $$CONTROLLER_GEN_TMP_DIR ;\
}
CONTROLLER_GEN=$(GOPATH)/bin/controller-gen
else
CONTROLLER_GEN=$(shell which controller-gen)
endif
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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:
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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:
Expand Down Expand Up @@ -1303,10 +1351,12 @@ spec:
ready:
items:
type: string
nullable: true
type: array
unready:
items:
type: string
nullable: true
type: array
type: object
metaRootCreated:
Expand Down
3 changes: 2 additions & 1 deletion charts/zookeeper/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 | `{}` |
Expand Down
3 changes: 3 additions & 0 deletions charts/zookeeper/templates/zookeeper.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
1 change: 1 addition & 0 deletions charts/zookeeper/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ image:
domainName:
labels: {}
ports: []
kubernetesClusterDomain: "cluster.local"

pod: {}
# labels: {}
Expand Down
Loading

0 comments on commit b5502fb

Please sign in to comment.