Skip to content

Commit

Permalink
Updating API version of admissionregistration.k8s.io (#1401)
Browse files Browse the repository at this point in the history
* Added webhook timeout variable

* made timeout variable to be private

* Fixed chart version

* Bumped admission & admissionregistration ver to v1

* Bumped operator version to v1beta2-1.3.0-3.1.1

* Fixed typo in README.md

* Fixed typos in README.md

Co-authored-by: Sairaman Kumar <[email protected]>
  • Loading branch information
sairamankumar2 and Sairaman Kumar authored Nov 30, 2021
1 parent d1987d5 commit 3a0e804
Show file tree
Hide file tree
Showing 14 changed files with 78 additions and 77 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ test: clean

it-test: clean all
@echo "running unit tests"
go test -v ./test/e2e/ --kubeconfig "$HOME/.kube/config" --operator-image=gcr.io/spark-operator/spark-operator:v1beta2-1.2.3-3.1.1
go test -v ./test/e2e/ --kubeconfig "$HOME/.kube/config" --operator-image=gcr.io/spark-operator/spark-operator:v1beta2-1.3.0-3.1.1

vet:
@echo "running go vet"
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ Customization of Spark pods, e.g., mounting arbitrary volumes and setting pod af

* Version >= 1.13 of Kubernetes to use the [`subresource` support for CustomResourceDefinitions](https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/#subresources), which became beta in 1.13 and is enabled by default in 1.13 and higher.

* Version >= 1.16 of Kubernetes to use the `MutatingWebhook` and `ValidatingWebhook` of `apiVersion: admissionregistration.k8s.io/v1`.

## Installation

The easiest way to install the Kubernetes Operator for Apache Spark is to use the Helm [chart](charts/spark-operator-chart/).
Expand All @@ -47,6 +49,7 @@ The following table lists the most recent few versions of the operator.
| Operator Version | API Version | Kubernetes Version | Base Spark Version | Operator Image Tag |
| ------------- | ------------- | ------------- | ------------- | ------------- |
| `latest` (master HEAD) | `v1beta2` | 1.13+ | `3.0.0` | `latest` |
| `v1beta2-1.3.0-3.1.1` | `v1beta2` | 1.16+ | `3.1.1` | `v1beta2-1.3.0-3.1.1` |
| `v1beta2-1.2.3-3.1.1` | `v1beta2` | 1.13+ | `3.1.1` | `v1beta2-1.2.3-3.1.1` |
| `v1beta2-1.2.0-3.0.0` | `v1beta2` | 1.13+ | `3.0.0` | `v1beta2-1.2.0-3.0.0` |
| `v1beta2-1.1.2-2.4.5` | `v1beta2` | 1.13+ | `2.4.5` | `v1beta2-1.1.2-2.4.5` |
Expand Down
4 changes: 2 additions & 2 deletions charts/spark-operator-chart/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
apiVersion: v2
name: spark-operator
description: A Helm chart for Spark on Kubernetes operator
version: 1.1.13
appVersion: v1beta2-1.2.3-3.1.1
version: 1.1.14
appVersion: v1beta2-1.3.0-3.1.1
keywords:
- spark
home: https://github.com/GoogleCloudPlatform/spark-on-k8s-operator
Expand Down
2 changes: 1 addition & 1 deletion charts/spark-operator-chart/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ This chart bootstraps a [Kubernetes Operator for Apache Spark](https://github.co
## Prerequisites

- Helm >= 3
- Kubernetes >= 1.13
- Kubernetes >= 1.16

## Previous Helm Chart

Expand Down
2 changes: 1 addition & 1 deletion charts/spark-operator-chart/README.md.gotmpl
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ This chart bootstraps a [Kubernetes Operator for Apache Spark]({{template "chart
## Prerequisites

- Helm >= 3
- Kubernetes >= 1.13
- Kubernetes >= 1.16

## Previous Helm Chart

Expand Down
8 changes: 4 additions & 4 deletions examples/spark-operator-with-metrics.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ metadata:
namespace: spark-operator
labels:
app.kubernetes.io/name: sparkoperator
app.kubernetes.io/version: v1beta2-1.2.3-3.1.1
app.kubernetes.io/version: v1beta2-1.3.0-3.1.1
spec:
replicas: 1
selector:
matchLabels:
app.kubernetes.io/name: sparkoperator
app.kubernetes.io/version: v1beta2-1.2.3-3.1.1
app.kubernetes.io/version: v1beta2-1.3.0-3.1.1
strategy:
type: Recreate
template:
Expand All @@ -38,12 +38,12 @@ spec:
prometheus.io/path: "/metrics"
labels:
app.kubernetes.io/name: sparkoperator
app.kubernetes.io/version: v1beta2-1.2.3-3.1.1
app.kubernetes.io/version: v1beta2-1.3.0-3.1.1
spec:
serviceAccountName: sparkoperator
containers:
- name: sparkoperator
image: gcr.io/spark-operator/spark-operator:v1beta2-1.2.3-3.1.1
image: gcr.io/spark-operator/spark-operator:v1beta2-1.3.0-3.1.1
imagePullPolicy: Always
ports:
- containerPort: 10254
Expand Down
16 changes: 8 additions & 8 deletions examples/spark-operator-with-webhook.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,20 @@ metadata:
namespace: spark-operator
labels:
app.kubernetes.io/name: sparkoperator
app.kubernetes.io/version: v1beta2-1.2.3-3.1.1
app.kubernetes.io/version: v1beta2-1.3.0-3.1.1
spec:
replicas: 1
selector:
matchLabels:
app.kubernetes.io/name: sparkoperator
app.kubernetes.io/version: v1beta2-1.2.3-3.1.1
app.kubernetes.io/version: v1beta2-1.3.0-3.1.1
strategy:
type: Recreate
template:
metadata:
labels:
app.kubernetes.io/name: sparkoperator
app.kubernetes.io/version: v1beta2-1.2.3-3.1.1
app.kubernetes.io/version: v1beta2-1.3.0-3.1.1
spec:
serviceAccountName: sparkoperator
volumes:
Expand All @@ -43,7 +43,7 @@ spec:
secretName: spark-webhook-certs
containers:
- name: sparkoperator
image: gcr.io/spark-operator/spark-operator:v1beta2-1.2.3-3.1.1
image: gcr.io/spark-operator/spark-operator:v1beta2-1.3.0-3.1.1
imagePullPolicy: Always
volumeMounts:
- name: webhook-certs
Expand All @@ -62,20 +62,20 @@ metadata:
namespace: spark-operator
labels:
app.kubernetes.io/name: sparkoperator
app.kubernetes.io/version: v1beta2-1.2.3-3.1.1
app.kubernetes.io/version: v1beta2-1.3.0-3.1.1
spec:
backoffLimit: 3
template:
metadata:
labels:
app.kubernetes.io/name: sparkoperator
app.kubernetes.io/version: v1beta2-1.2.3-3.1.1
app.kubernetes.io/version: v1beta2-1.3.0-3.1.1
spec:
serviceAccountName: sparkoperator
restartPolicy: Never
containers:
- name: main
image: gcr.io/spark-operator/spark-operator:v1beta2-1.2.3-3.1.1
image: gcr.io/spark-operator/spark-operator:v1beta2-1.3.0-3.1.1
imagePullPolicy: IfNotPresent
command: ["/usr/bin/gencerts.sh", "-p"]
---
Expand All @@ -91,4 +91,4 @@ spec:
name: webhook
selector:
app.kubernetes.io/name: sparkoperator
app.kubernetes.io/version: v1beta2-1.2.3-3.1.1
app.kubernetes.io/version: v1beta2-1.3.0-3.1.1
8 changes: 4 additions & 4 deletions manifest/spark-operator-install/spark-operator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,25 +21,25 @@ metadata:
namespace: spark-operator
labels:
app.kubernetes.io/name: sparkoperator
app.kubernetes.io/version: v1beta2-1.2.3-3.1.1
app.kubernetes.io/version: v1beta2-1.3.0-3.1.1
spec:
replicas: 1
selector:
matchLabels:
app.kubernetes.io/name: sparkoperator
app.kubernetes.io/version: v1beta2-1.2.3-3.1.1
app.kubernetes.io/version: v1beta2-1.3.0-3.1.1
strategy:
type: Recreate
template:
metadata:
labels:
app.kubernetes.io/name: sparkoperator
app.kubernetes.io/version: v1beta2-1.2.3-3.1.1
app.kubernetes.io/version: v1beta2-1.3.0-3.1.1
spec:
serviceAccountName: sparkoperator
containers:
- name: sparkoperator
image: gcr.io/spark-operator/spark-operator:v1beta2-1.2.3-3.1.1
image: gcr.io/spark-operator/spark-operator:v1beta2-1.3.0-3.1.1
imagePullPolicy: Always
args:
- -logtostderr
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ metadata:
name: sparkoperator
labels:
app.kubernetes.io/name: sparkoperator
app.kubernetes.io/version: v1beta2-1.2.3-3.1.1
app.kubernetes.io/version: v1beta2-1.3.0-3.1.1
namespace: spark-operator
spec:
template:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,20 @@ metadata:
namespace: spark-operator
labels:
app.kubernetes.io/name: sparkoperator
app.kubernetes.io/version: v1beta2-1.2.3-3.1.1
app.kubernetes.io/version: v1beta2-1.3.0-3.1.1
spec:
backoffLimit: 3
template:
metadata:
labels:
app.kubernetes.io/name: sparkoperator
app.kubernetes.io/version: v1beta2-1.2.3-3.1.1
app.kubernetes.io/version: v1beta2-1.3.0-3.1.1
spec:
serviceAccountName: sparkoperator
restartPolicy: Never
containers:
- name: main
image: gcr.io/spark-operator/spark-operator:v1beta2-1.2.3-3.1.1
image: gcr.io/spark-operator/spark-operator:v1beta2-1.3.0-3.1.1
imagePullPolicy: IfNotPresent
command: ["/usr/bin/gencerts.sh", "-p"]
---
Expand All @@ -50,4 +50,4 @@ spec:
name: webhook
selector:
app.kubernetes.io/name: sparkoperator
app.kubernetes.io/version: v1beta2-1.2.3-3.1.1
app.kubernetes.io/version: v1beta2-1.3.0-3.1.1
4 changes: 2 additions & 2 deletions pkg/webhook/scheme.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ limitations under the License.
package webhook

import (
admissionv1beta1 "k8s.io/api/admission/v1beta1"
admissionv1 "k8s.io/api/admission/v1"
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/serializer"
Expand All @@ -34,5 +34,5 @@ func init() {

func addToScheme(scheme *runtime.Scheme) {
corev1.AddToScheme(scheme)
admissionv1beta1.AddToScheme(scheme)
admissionv1.AddToScheme(scheme)
}
Loading

0 comments on commit 3a0e804

Please sign in to comment.