Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make installing the webhook configurable #299

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ kubectl -n cass-operator create -f https://raw.githubusercontent.com/datastax/ca

### Loading the operator

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:
Installing the Cass Operator itself is straightforward. We have provided manifests for each Kubernetes version from 1.15 through 1.19. Apply the relevant manifest to your cluster as follows:

```console
K8S_VER=v1.16
Expand Down Expand Up @@ -313,7 +313,7 @@ spec:

## Requirements

- Kubernetes cluster, 1.13 or newer.
- Kubernetes cluster, 1.15 or newer.

## Contributing

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1378,14 +1378,6 @@ spec:
- containerPort
type: object
type: array
{{- if semverCompare ">= 1.16-0" .Capabilities.KubeVersion.GitVersion }}
x-kubernetes-list-map-keys:
- containerPort
{{- if semverCompare "< 1.18-0" .Capabilities.KubeVersion.GitVersion }}
- protocol
{{- end }}
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 @@ -3714,14 +3706,6 @@ spec:
- containerPort
type: object
type: array
{{- if semverCompare ">= 1.16-0" .Capabilities.KubeVersion.GitVersion }}
x-kubernetes-list-map-keys:
- containerPort
{{- if semverCompare "< 1.18-0" .Capabilities.KubeVersion.GitVersion }}
- protocol
{{- end }}
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 @@ -4652,12 +4636,6 @@ 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 @@ -6302,9 +6280,7 @@ 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
@@ -1,3 +1,4 @@
{{- if .Values.webhook.enabled }}
apiVersion: admissionregistration.k8s.io/v1beta1
kind: ValidatingWebhookConfiguration
metadata:
Expand Down Expand Up @@ -26,3 +27,4 @@ webhooks:
matchPolicy: "Equivalent"
{{- end }}
sideEffects: None
{{- end}}
2 changes: 2 additions & 0 deletions charts/cass-operator-chart/templates/webhook-cr.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if .Values.webhook.enabled }}
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
Expand All @@ -14,3 +15,4 @@ rules:
- update
resourceNames:
- "cassandradatacenter-webhook-registration"
{{- end}}
2 changes: 2 additions & 0 deletions charts/cass-operator-chart/templates/webhook-crb.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if .Values.webhook.enabled }}
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
Expand All @@ -10,3 +11,4 @@ roleRef:
kind: ClusterRole
name: {{ .Values.webhookClusterRoleName }}
apiGroup: rbac.authorization.k8s.io
{{- end}}
2 changes: 2 additions & 0 deletions charts/cass-operator-chart/templates/webhook-secret.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
{{- if .Values.webhook.enabled }}
apiVersion: v1
kind: Secret
metadata:
name: cass-operator-webhook-config
data:
tls.crt: ""
tls.key: ""
{{- end}}
2 changes: 2 additions & 0 deletions charts/cass-operator-chart/templates/webhook-service.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if .Values.webhook.enabled }}
apiVersion: v1
kind: Service
metadata:
Expand All @@ -10,3 +11,4 @@ spec:
targetPort: 8443
selector:
name: cass-operator
{{- end}}
3 changes: 3 additions & 0 deletions charts/cass-operator-chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,6 @@ deploymentReplicas: 1
defaultImage: "datastax/cass-operator:1.4.1"
imagePullPolicy: IfNotPresent
imagePullSecret: ""

webhook:
enabled: true
6 changes: 2 additions & 4 deletions docs/user/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,8 @@ and managing Cassandra or DSE in a Kubernetes cluster.

## Prerequisites

1. A Kubernetes cluster. Kubernetes v1.15 is recommended, but Kubernetes
v1.13 has been tested and works provided the line containing
`x-kubernetes-preserve-unknown-fields: true` is deleted from
`cass-operator-manifests.yaml`.
1. A Kubernetes cluster. Kubernetes v1.18 is recommended, but Kubernetes
v1.15 has been tested.
2. The ability to download images from Docker Hub from within the Kubernetes
cluster.

Expand Down
Loading