Skip to content

Commit

Permalink
Better support for several k8s versions (#97)
Browse files Browse the repository at this point in the history
* Start marking up helm chart with logic about k8s versions

* Ran helm templating for k8s 1.13

* Ran k8s v1.14

* k8s 1.15

* k8s 1.16

* k8s 1.17

* making the yaml bundle is now k8s-version-aware

* New script to roll through KIND versions and run helm with validation against each one

* Updating README

* Process to patch generated CRD into templatized CRD
  • Loading branch information
jimdickinson authored May 28, 2020
1 parent 86b869d commit 9d76ad8
Show file tree
Hide file tree
Showing 12 changed files with 19,257 additions and 16 deletions.
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,19 @@ The DataStax Kubernetes Operator for Apache Cassandra®

Quick start:
```console
kubectl create -f https://raw.githubusercontent.com/datastax/cass-operator/v1.1.0/docs/user/cass-operator-manifests.yaml
# *** This is for GKE -> Adjust based on your cloud or storage options
# *** This is for GKE Regular Channel - k8s 1.16 -> Adjust based on your cloud or storage options
kubectl create -f https://raw.githubusercontent.com/datastax/cass-operator/v1.1.0/docs/user/cass-operator-manifests-v1.16.yaml
kubectl create -f https://raw.githubusercontent.com/datastax/cass-operator/v1.1.0/operator/k8s-flavors/gke/storage.yaml
kubectl -n cass-operator create -f https://raw.githubusercontent.com/datastax/cass-operator/v1.1.0/operator/example-cassdc-yaml/cassandra-3.11.6/example-cassdc-minimal.yaml
```

### Loading the operator

Installing the Cass Operator itself is straightforward. Apply the provided manifest as follows:
Installing the Cass Operator itself is straightforward. We have provided manifests for each Kubernetes version from 1.13 through 1.17. Apply the relevant manifest to your cluster as follows:

```console
kubectl apply -f https://raw.githubusercontent.com/datastax/cass-operator/v1.1.0/docs/user/cass-operator-manifests.yaml
K8S_VER=v1.16
kubectl apply -f https://raw.githubusercontent.com/datastax/cass-operator/v1.1.0/docs/user/cass-operator-manifests-$K8S_VER.yaml
```

Note that since the manifest will install a [Custom Resource Definition](https://kubernetes.io/docs/concepts/extend-kubernetes/api-extension/custom-resources/), the user running the above command will need cluster-admin privileges.
Expand Down Expand Up @@ -180,8 +181,7 @@ The operator is comprised of the following container images working in concert:
## Requirements
- Kubernetes cluster, 1.12 or newer.
- Users who want to use a Kubernetes version from before 1.15 can use a manifest that supports x-preserve-unknown-fields on the CassandraDatacenter CRD - [manifest](docs/user/cass-operator-manifests-pre-1.15.yaml)
- Kubernetes cluster, 1.13 or newer.
## Contributing
Expand Down Expand Up @@ -274,7 +274,7 @@ kubectl delete cassdcs --all-namespaces --all

Remove the operator Deployment, CRD, etc.
```
kubectl delete -f https://raw.githubusercontent.com/datastax/cass-operator/v1.1.0/docs/user/cass-operator-manifests.yaml
kubectl delete -f https://raw.githubusercontent.com/datastax/cass-operator/v1.1.0/docs/user/cass-operator-manifests-v1.16.yaml
```

## Contacts
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1313,10 +1313,12 @@ spec:
- containerPort
type: object
type: array
{{- if semverCompare ">= 1.16-0" .Capabilities.KubeVersion.GitVersion }}
x-kubernetes-list-map-keys:
- containerPort
- protocol
x-kubernetes-list-type: map
{{- end }}
readinessProbe:
description: 'Periodic probe of container service readiness.
Container will be removed from service endpoints if
Expand Down Expand Up @@ -3645,10 +3647,12 @@ spec:
- containerPort
type: object
type: array
{{- if semverCompare ">= 1.16-0" .Capabilities.KubeVersion.GitVersion }}
x-kubernetes-list-map-keys:
- containerPort
- protocol
x-kubernetes-list-type: map
{{- end }}
readinessProbe:
description: 'Periodic probe of container service readiness.
Container will be removed from service endpoints if
Expand Down Expand Up @@ -4579,10 +4583,12 @@ spec:
- whenUnsatisfiable
type: object
type: array
{{- if semverCompare ">= 1.16-0" .Capabilities.KubeVersion.GitVersion }}
x-kubernetes-list-map-keys:
- topologyKey
- whenUnsatisfiable
x-kubernetes-list-type: map
{{- end }}
volumes:
description: 'List of volumes that can be mounted by containers
belonging to the pod. More info: https://kubernetes.io/docs/concepts/storage/volumes'
Expand Down Expand Up @@ -6136,7 +6142,9 @@ spec:
type: string
type: object
type: object
{{- if semverCompare ">= 1.15-0" .Capabilities.KubeVersion.GitVersion }}
x-kubernetes-preserve-unknown-fields: true
{{- end }}
version: v1beta1
versions:
- name: v1beta1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,20 @@ webhooks:
apiVersions: ["v1beta1"]
operations: ["CREATE", "UPDATE"]
resources: ["cassandradatacenters"]
{{- if semverCompare ">= 1.14-0" .Capabilities.KubeVersion.GitVersion }}
scope: "*"
{{- end }}
clientConfig:
service:
name: "cassandradatacenter-webhook-service"
namespace: {{ .Release.Namespace }}
path: /validate-cassandra-datastax-com-v1beta1-cassandradatacenter
{{- if semverCompare ">= 1.14-0" .Capabilities.KubeVersion.GitVersion }}
admissionReviewVersions: ["v1beta1"]
timeoutSeconds: 10
{{- end }}
failurePolicy: "Ignore"
{{- if semverCompare ">= 1.15-0" .Capabilities.KubeVersion.GitVersion }}
matchPolicy: "Equivalent"
{{- end }}
sideEffects: None
timeoutSeconds: 10
Loading

0 comments on commit 9d76ad8

Please sign in to comment.