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

Add versions v1 and v1alpha3 to CRD #1229

Merged
merged 12 commits into from
Dec 13, 2019
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -2939,11 +2939,17 @@ spec:
type: string
type: object
type: object
version: v1alpha2
version: v1
versions:
- name: v1alpha2
- name: v1
served: true
storage: true
- name: v1alpha2
served: true
storage: false
- name: v1alpha3
served: true
storage: false
status:
acceptedNames:
kind: ''
Expand Down
104 changes: 88 additions & 16 deletions helm-charts/seldon-core-operator/templates/webhook.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ webhooks:
service:
name: seldon-webhook-service
namespace: '{{ .Release.Namespace }}'
path: /validate-machinelearning-seldon-io-v1alpha2-seldondeployment
path: /validate-machinelearning-seldon-io-v1-seldondeployment
failurePolicy: Fail
name: vseldondeployment.kb.io
{{- if semverCompare ">=1.15.0" .Capabilities.KubeVersion.Version }}
Expand Down Expand Up @@ -50,6 +50,24 @@ webhooks:
matchLabels:
seldon.io/controller-id: {{ .Values.controllerId }}
{{- end }}
rules:
- apiGroups:
- machinelearning.seldon.io
apiVersions:
- v1
operations:
- CREATE
- UPDATE
resources:
- seldondeployments
- clientConfig:
caBundle: Cg==
service:
name: seldon-webhook-service
namespace: seldon-system
path: /validate-machinelearning-seldon-io-v1alpha2-seldondeployment
failurePolicy: Fail
name: vseldondeployment.kb.io
rules:
- apiGroups:
- machinelearning.seldon.io
Expand All @@ -60,6 +78,38 @@ webhooks:
- UPDATE
resources:
- seldondeployments
- clientConfig:
caBundle: Cg==
service:
name: seldon-webhook-service
namespace: seldon-system
path: /validate-machinelearning-seldon-io-v1alpha3-seldondeployment
failurePolicy: Fail
name: vseldondeployment.kb.io
rules:
- apiGroups:
- machinelearning.seldon.io
apiVersions:
- v1alpha3
operations:
- CREATE
- UPDATE
resources:
- seldondeployments
---

{{- if not .Values.certManager.enabled -}}
apiVersion: v1
data:
ca.crt: '{{ $ca.Cert | b64enc }}'
tls.crt: '{{ $cert.Cert | b64enc }}'
tls.key: '{{ $cert.Key | b64enc }}'
kind: Secret
metadata:
name: seldon-webhook-server-cert
namespace: '{{ .Release.Namespace }}'
type: kubernetes.io/tls
{{- end }}
---

apiVersion: admissionregistration.k8s.io/v1beta1
Expand All @@ -80,7 +130,7 @@ webhooks:
service:
name: seldon-webhook-service
namespace: '{{ .Release.Namespace }}'
path: /mutate-machinelearning-seldon-io-v1alpha2-seldondeployment
path: /mutate-machinelearning-seldon-io-v1-seldondeployment
failurePolicy: Fail
name: mseldondeployment.kb.io
{{- if semverCompare ">=1.15.0" .Capabilities.KubeVersion.Version }}
Expand Down Expand Up @@ -109,6 +159,24 @@ webhooks:
matchLabels:
seldon.io/controller-id: {{ .Values.controllerId }}
{{- end }}
rules:
- apiGroups:
- machinelearning.seldon.io
apiVersions:
- v1
operations:
- CREATE
- UPDATE
resources:
- seldondeployments
- clientConfig:
caBundle: Cg==
service:
name: seldon-webhook-service
namespace: seldon-system
path: /mutate-machinelearning-seldon-io-v1alpha2-seldondeployment
failurePolicy: Fail
name: mseldondeployment.kb.io
rules:
- apiGroups:
- machinelearning.seldon.io
Expand All @@ -119,17 +187,21 @@ webhooks:
- UPDATE
resources:
- seldondeployments
---

{{- if not .Values.certManager.enabled -}}
apiVersion: v1
data:
ca.crt: '{{ $ca.Cert | b64enc }}'
tls.crt: '{{ $cert.Cert | b64enc }}'
tls.key: '{{ $cert.Key | b64enc }}'
kind: Secret
metadata:
name: seldon-webhook-server-cert
namespace: '{{ .Release.Namespace }}'
type: kubernetes.io/tls
{{- end }}
- clientConfig:
caBundle: Cg==
service:
name: seldon-webhook-service
namespace: seldon-system
path: /mutate-machinelearning-seldon-io-v1alpha3-seldondeployment
failurePolicy: Fail
name: mseldondeployment.kb.io
rules:
- apiGroups:
- machinelearning.seldon.io
apiVersions:
- v1alpha3
operations:
- CREATE
- UPDATE
resources:
- seldondeployments
2 changes: 1 addition & 1 deletion helm-charts/seldon-single-model/templates/model.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"apiVersion": "machinelearning.seldon.io/v1alpha2",
"apiVersion": {{ .Values.apiVersion }},
"kind": "SeldonDeployment",
"metadata": {
"labels": {{ .Values.sdepLabels | toJson }},
Expand Down
7 changes: 4 additions & 3 deletions helm-charts/seldon-single-model/values.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
name: my-model
apiVersion: machinelearning.seldon.io/v1
model:
image:
name: seldonio/mock_classifier:1.0
Expand Down Expand Up @@ -26,12 +27,12 @@ engine:

# Add oauth key and secret if using the default API Oauth Gateway for ingress
oauth:
key:
secret:
key:
secret:

sdepLabels:
app: "seldon"

predictorLabels:
version: "v1"
fluentd: "true"
fluentd: "true"
6 changes: 6 additions & 0 deletions operator/PROJECT
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,9 @@ resources:
- group: machinelearning
version: v1alpha2
kind: SeldonDeployment
- group: machinelearning
version: v1alpha3
kind: SeldonDeployment
- group: machinelearning
version: v1
kind: SeldonDeployment
36 changes: 36 additions & 0 deletions operator/api/v1/groupversion_info.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/*
Copyright 2019 The Seldon Authors.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

// Package v1 contains API Schema definitions for the machinelearning v1 API group
// +kubebuilder:object:generate=true
// +groupName=machinelearning.seldon.io
package v1

import (
"k8s.io/apimachinery/pkg/runtime/schema"
"sigs.k8s.io/controller-runtime/pkg/scheme"
)

var (
// GroupVersion is group version used to register these objects
GroupVersion = schema.GroupVersion{Group: "machinelearning.seldon.io", Version: "v1"}

// SchemeBuilder is used to add go types to the GroupVersionKind scheme
SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion}

// AddToScheme adds the types in this group-version to the given scheme.
AddToScheme = SchemeBuilder.AddToScheme
)
Loading