Skip to content

Commit 30c8d8a

Browse files
rimoliveopenshift-merge-bot[bot]
authored andcommitted
Add pipelineStorage flag to deploy K8s Native API
Signed-off-by: Ricardo M. Oliveira <[email protected]>
1 parent 29b7060 commit 30c8d8a

21 files changed

+662
-46
lines changed

api/v1/dspipeline_types.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,12 @@ type APIServer struct {
152152
// +kubebuilder:validation:Optional
153153
ArtifactSignedURLExpirySeconds *int `json:"artifactSignedURLExpirySeconds"`
154154

155+
// The Pipeline Storage type for Pipelines and Pipeline Versions. It can be
156+
// either 'database' or 'kubernetes'. Default to 'database'.
157+
// +kubebuilder:default:=database
158+
// +kubebuilder:validation:Optional
159+
PipelineStorage string `json:"pipelineStorage"`
160+
155161
// Enable/disable caching in the DSP API server. Default: true
156162
// +kubebuilder:default:=true
157163
CacheEnabled *bool `json:"cacheEnabled,omitempty"`

api/v1alpha1/dspipeline_types.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,12 @@ type APIServer struct {
204204
// +kubebuilder:validation:Optional
205205
ArtifactSignedURLExpirySeconds *int `json:"artifactSignedURLExpirySeconds"`
206206

207+
// The Pipeline Storage type for Pipelines and Pipeline Versions. It can be
208+
// either 'database' or 'kubernetes'. Default to 'database'.
209+
// +kubebuilder:default:=database
210+
// +kubebuilder:validation:Optional
211+
PipelineStorage string `json:"pipelineStorage"`
212+
207213
// Enable/disable caching in the DSP API server. Default: true
208214
// +kubebuilder:default:=true
209215
CacheEnabled *bool `json:"cacheEnabled,omitempty"`

config/crd/bases/datasciencepipelinesapplications.opendatahub.io_datasciencepipelinesapplications.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,12 @@ spec:
192192
type: string
193193
type: object
194194
type: object
195+
pipelineStorage:
196+
default: database
197+
description: |-
198+
The Pipeline Storage type for Pipelines and Pipeline Versions. It can be
199+
either 'database' or 'kubernetes'. Default to 'database'.
200+
type: string
195201
resources:
196202
description: Specify custom Pod resource requirements for this
197203
component.
@@ -1170,6 +1176,12 @@ spec:
11701176
Image used for internal artifact passing handling within Tekton taskruns. This field specifies the image used in the 'move-all-results-to-tekton-home' step.
11711177
Deprecated: DSP V1 only, will be removed in the future.
11721178
type: string
1179+
pipelineStorage:
1180+
default: database
1181+
description: |-
1182+
The Pipeline Storage type for Pipelines and Pipeline Versions. It can be
1183+
either 'database' or 'kubernetes'. Default to 'database'.
1184+
type: string
11731185
resources:
11741186
description: Specify custom Pod resource requirements for this
11751187
component.

config/internal/apiserver/default/deployment.yaml.tmpl

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,17 @@ spec:
264264
name: ca-bundle
265265
{{ end }}
266266
{{ if .APIServer.EnableRoute }}
267+
{{ if eq .APIServer.PipelineStorage "kubernetes" }}
268+
command:
269+
- /bin/apiserver
270+
args:
271+
- '--config=/config'
272+
- '--sampleconfig=/config/sample_config.json'
273+
- '-logtostderr=true'
274+
- '--logLevel=debug'
275+
- '--pipelinesStoreKubernetes=true'
276+
- '--disableWebhook=true'
277+
{{ end }}
267278
- name: oauth-proxy
268279
args:
269280
- --https-address=:8443

config/internal/apiserver/default/role_ds-pipeline.yaml.tmpl

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,32 @@ metadata:
77
app: {{.APIServerDefaultResourceName}}
88
component: data-science-pipelines
99
rules:
10+
- verbs:
11+
- create
12+
- get
13+
- list
14+
- watch
15+
- update
16+
- patch
17+
- delete
18+
apiGroups:
19+
- pipelines.kubeflow.org
20+
resources:
21+
- pipelines
22+
- pipelines/status
23+
- verbs:
24+
- create
25+
- get
26+
- list
27+
- watch
28+
- update
29+
- patch
30+
- delete
31+
apiGroups:
32+
- pipelines.kubeflow.org
33+
resources:
34+
- pipelineversions
35+
- pipelineversions/status
1036
- apiGroups:
1137
- ""
1238
resources:
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
---
2+
apiVersion: apiextensions.k8s.io/v1
3+
kind: CustomResourceDefinition
4+
metadata:
5+
annotations:
6+
controller-gen.kubebuilder.io/version: v0.16.4
7+
name: pipelines.pipelines.kubeflow.org
8+
spec:
9+
group: pipelines.kubeflow.org
10+
names:
11+
kind: Pipeline
12+
listKind: PipelineList
13+
plural: pipelines
14+
singular: pipeline
15+
scope: Namespaced
16+
versions:
17+
- name: v2beta1
18+
schema:
19+
openAPIV3Schema:
20+
description: Pipeline is the Schema for the pipelines API.
21+
properties:
22+
apiVersion:
23+
description: |-
24+
APIVersion defines the versioned schema of this representation of an object.
25+
Servers should convert recognized schemas to the latest internal value, and
26+
may reject unrecognized values.
27+
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
28+
type: string
29+
kind:
30+
description: |-
31+
Kind is a string value representing the REST resource this object represents.
32+
Servers may infer this from the endpoint the client submits requests to.
33+
Cannot be updated.
34+
In CamelCase.
35+
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
36+
type: string
37+
metadata:
38+
type: object
39+
spec:
40+
description: PipelineSpec defines the desired state of Pipeline.
41+
properties:
42+
description:
43+
type: string
44+
type: object
45+
type: object
46+
served: true
47+
storage: true
48+
subresources:
49+
status: {}
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
---
2+
apiVersion: apiextensions.k8s.io/v1
3+
kind: CustomResourceDefinition
4+
metadata:
5+
annotations:
6+
controller-gen.kubebuilder.io/version: v0.16.4
7+
name: pipelineversions.pipelines.kubeflow.org
8+
spec:
9+
group: pipelines.kubeflow.org
10+
names:
11+
kind: PipelineVersion
12+
listKind: PipelineVersionList
13+
plural: pipelineversions
14+
singular: pipelineversion
15+
scope: Namespaced
16+
versions:
17+
- name: v2beta1
18+
schema:
19+
openAPIV3Schema:
20+
description: PipelineVersion is the Schema for the pipelineversions API.
21+
properties:
22+
apiVersion:
23+
description: |-
24+
APIVersion defines the versioned schema of this representation of an object.
25+
Servers should convert recognized schemas to the latest internal value, and
26+
may reject unrecognized values.
27+
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
28+
type: string
29+
kind:
30+
description: |-
31+
Kind is a string value representing the REST resource this object represents.
32+
Servers may infer this from the endpoint the client submits requests to.
33+
Cannot be updated.
34+
In CamelCase.
35+
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
36+
type: string
37+
metadata:
38+
type: object
39+
spec:
40+
description: PipelineVersionSpec defines the desired state of PipelineVersion.
41+
properties:
42+
codeSourceURL:
43+
type: string
44+
description:
45+
type: string
46+
pipelineName:
47+
type: string
48+
pipelineSpec:
49+
x-kubernetes-preserve-unknown-fields: true
50+
required:
51+
- pipelineSpec
52+
type: object
53+
status:
54+
description: PipelineVersionStatus defines the observed state of PipelineVersion.
55+
properties:
56+
conditions:
57+
items:
58+
description: |-
59+
SimplifiedCondition is a metav1.Condition without lastTransitionTime since the database model doesn't have such
60+
a concept and it allows a default status in the CRD without a controller setting it.
61+
properties:
62+
message:
63+
maxLength: 32768
64+
type: string
65+
reason:
66+
type: string
67+
status:
68+
enum:
69+
- "True"
70+
- "False"
71+
- Unknown
72+
type: string
73+
type:
74+
maxLength: 316
75+
pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$
76+
type: string
77+
required:
78+
- message
79+
- reason
80+
- status
81+
- type
82+
type: object
83+
type: array
84+
type: object
85+
type: object
86+
served: true
87+
storage: true
88+
subresources:
89+
status: {}
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
name: {{.WebhookName}}
5+
namespace: {{.DSPONamespace}}
6+
labels:
7+
app: {{.WebhookName}}
8+
component: data-science-pipelines
9+
spec:
10+
selector:
11+
matchLabels:
12+
app: {{.WebhookName}}
13+
component: data-science-pipelines
14+
template:
15+
metadata:
16+
annotations:
17+
configHash: {{.APIServerConfigHash}}
18+
labels:
19+
app: {{.WebhookName}}
20+
component: data-science-pipelines
21+
spec:
22+
containers:
23+
- env:
24+
- name: POD_NAMESPACE
25+
value: "{{.DSPONamespace}}"
26+
image: {{.APIServer.Image}}
27+
# imagePullPolicy: default - https://kubernetes.io/docs/concepts/containers/images/#imagepullpolicy-defaulting
28+
name: ds-pipeline-webhook
29+
command: ['/bin/apiserver']
30+
args:
31+
- --config=/config
32+
- -logtostderr=true
33+
- --sampleconfig=/config/sample_config.json
34+
- --webhookPortFlag=:8443
35+
- --webhookTLSCertPath=/etc/webhook/certs/tls.crt
36+
- --webhookTLSKeyPath=/etc/webhook/certs/tls.key
37+
- --globalKubernetesWebhookMode=true
38+
ports:
39+
- containerPort: 8443
40+
name: webhook
41+
volumeMounts:
42+
- mountPath: /etc/webhook/certs
43+
name: webhook-tls
44+
serviceAccountName: {{.WebhookName}}
45+
volumes:
46+
- name: webhook-tls
47+
secret:
48+
secretName: ds-pipelines-webhook-tls-{{.WebhookName}}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
apiVersion: v1
2+
kind: ServiceAccount
3+
metadata:
4+
name: {{.WebhookName}}
5+
namespace: {{.DSPONamespace}}
6+
labels:
7+
app: {{.WebhookName}}
8+
component: data-science-pipelines
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
apiVersion: v1
2+
kind: Service
3+
metadata:
4+
name: {{.WebhookName}}
5+
namespace: {{.DSPONamespace}}
6+
annotations:
7+
service.beta.openshift.io/serving-cert-secret-name: ds-pipelines-webhook-tls-{{.WebhookName}}
8+
labels:
9+
app: {{.WebhookName}}
10+
component: data-science-pipelines
11+
spec:
12+
ports:
13+
- name: webhook
14+
port: 8443
15+
protocol: TCP
16+
targetPort: webhook
17+
selector:
18+
app: {{.WebhookName}}
19+
component: data-science-pipelines

0 commit comments

Comments
 (0)