Skip to content

Commit d536acb

Browse files
WIP - Remove ingress/routes logic from SDK
1 parent 2514bc9 commit d536acb

File tree

3 files changed

+328
-309
lines changed

3 files changed

+328
-309
lines changed

src/codeflare_sdk/cluster/cluster.py

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ def create_app_wrapper(self):
188188
image_pull_secrets = self.config.image_pull_secrets
189189
dispatch_priority = self.config.dispatch_priority
190190
ingress_domain = self.config.ingress_domain
191-
ingress_options = self.config.ingress_options
191+
# ingress_options = self.config.ingress_options
192192
write_to_file = self.config.write_to_file
193193
verify_tls = self.config.verify_tls
194194
return generate_appwrapper(
@@ -214,7 +214,7 @@ def create_app_wrapper(self):
214214
dispatch_priority=dispatch_priority,
215215
priority_val=priority_val,
216216
ingress_domain=ingress_domain,
217-
ingress_options=ingress_options,
217+
# ingress_options=ingress_options,
218218
write_to_file=write_to_file,
219219
verify_tls=verify_tls,
220220
)
@@ -739,24 +739,24 @@ def _delete_resources(
739739
plural="rayclusters",
740740
name=name,
741741
)
742-
elif resource["kind"] == "Ingress":
743-
name = resource["metadata"]["name"]
744-
api_instance.delete_namespaced_custom_object(
745-
group="networking.k8s.io",
746-
version="v1",
747-
namespace=namespace,
748-
plural="ingresses",
749-
name=name,
750-
)
751-
elif resource["kind"] == "Route":
752-
name = resource["metadata"]["name"]
753-
api_instance.delete_namespaced_custom_object(
754-
group="route.openshift.io",
755-
version="v1",
756-
namespace=namespace,
757-
plural="routes",
758-
name=name,
759-
)
742+
# elif resource["kind"] == "Ingress":
743+
# name = resource["metadata"]["name"]
744+
# api_instance.delete_namespaced_custom_object(
745+
# group="networking.k8s.io",
746+
# version="v1",
747+
# namespace=namespace,
748+
# plural="ingresses",
749+
# name=name,
750+
# )
751+
# elif resource["kind"] == "Route":
752+
# name = resource["metadata"]["name"]
753+
# api_instance.delete_namespaced_custom_object(
754+
# group="route.openshift.io",
755+
# version="v1",
756+
# namespace=namespace,
757+
# plural="routes",
758+
# name=name,
759+
# )
760760
elif resource["kind"] == "Secret":
761761
name = resource["metadata"]["name"]
762762
secret_instance = client.CoreV1Api(api_config_handler())
@@ -776,22 +776,22 @@ def _create_resources(yamls, namespace: str, api_instance: client.CustomObjectsA
776776
plural="rayclusters",
777777
body=resource,
778778
)
779-
elif resource["kind"] == "Ingress":
780-
api_instance.create_namespaced_custom_object(
781-
group="networking.k8s.io",
782-
version="v1",
783-
namespace=namespace,
784-
plural="ingresses",
785-
body=resource,
786-
)
787-
elif resource["kind"] == "Route":
788-
api_instance.create_namespaced_custom_object(
789-
group="route.openshift.io",
790-
version="v1",
791-
namespace=namespace,
792-
plural="routes",
793-
body=resource,
794-
)
779+
# elif resource["kind"] == "Ingress":
780+
# api_instance.create_namespaced_custom_object(
781+
# group="networking.k8s.io",
782+
# version="v1",
783+
# namespace=namespace,
784+
# plural="ingresses",
785+
# body=resource,
786+
# )
787+
# elif resource["kind"] == "Route":
788+
# api_instance.create_namespaced_custom_object(
789+
# group="route.openshift.io",
790+
# version="v1",
791+
# namespace=namespace,
792+
# plural="routes",
793+
# body=resource,
794+
# )
795795
elif resource["kind"] == "Secret":
796796
secret_instance = client.CoreV1Api(api_config_handler())
797797
secret_instance.create_namespaced_secret(

src/codeflare_sdk/templates/base-template.yaml

Lines changed: 85 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -339,91 +339,91 @@ spec:
339339
- key: odh-ca-bundle.crt
340340
path: odh-ca-bundle.crt
341341
optional: true
342-
- replicas: 1
343-
generictemplate:
344-
apiVersion: networking.k8s.io/v1
345-
kind: Ingress
346-
metadata:
347-
name: ray-dashboard-deployment-ingress
348-
namespace: default
349-
annotations:
350-
annotations-example:annotations-example
351-
labels:
352-
ingress-options: "false"
353-
ingress-owner: appwrapper-name
354-
spec:
355-
ingressClassName: nginx
356-
rules:
357-
- http:
358-
paths:
359-
- backend:
360-
service:
361-
name: raytest-head-svc
362-
port:
363-
number: 8265
364-
pathType: Prefix
365-
path: /
366-
host: ray-dashboard-raytest.<ingress-domain>
367-
- replicas: 1
368-
generictemplate:
369-
kind: Route
370-
apiVersion: route.openshift.io/v1
371-
metadata:
372-
name: ray-dashboard-deployment-route
373-
namespace: default
374-
labels:
375-
# allows me to return name of service that Ray operator creates
376-
odh-ray-cluster-service: deployment-name-head-svc
377-
spec:
378-
to:
379-
kind: Service
380-
name: deployment-name-head-svc
381-
port:
382-
targetPort: dashboard
383-
tls:
384-
termination: edge
385-
- replicas: 1
386-
generictemplate:
387-
apiVersion: networking.k8s.io/v1
388-
kind: Ingress
389-
metadata:
390-
name: rayclient-deployment-ingress
391-
namespace: default
392-
annotations:
393-
annotations-example:annotations-example
394-
labels:
395-
odh-ray-cluster-service: deployment-name-head-svc
396-
spec:
397-
ingressClassName: nginx
398-
rules:
399-
- http:
400-
paths:
401-
- backend:
402-
service:
403-
name: deployment-name-head-svc
404-
port:
405-
number: 10001
406-
path: ''
407-
pathType: ImplementationSpecific
408-
host: rayclient-raytest.<ingress-domain>
409-
- replicas: 1
410-
generictemplate:
411-
apiVersion: route.openshift.io/v1
412-
kind: Route
413-
metadata:
414-
name: rayclient-deployment-route
415-
namespace: default
416-
labels:
417-
# allows me to return name of service that Ray operator creates
418-
odh-ray-cluster-service: deployment-name-head-svc
419-
spec:
420-
port:
421-
targetPort: client
422-
tls:
423-
termination: passthrough
424-
to:
425-
kind: Service
426-
name: deployment-name-head-svc
342+
# - replicas: 1
343+
# generictemplate:
344+
# apiVersion: networking.k8s.io/v1
345+
# kind: Ingress
346+
# metadata:
347+
# name: ray-dashboard-deployment-ingress
348+
# namespace: default
349+
# annotations:
350+
# annotations-example:annotations-example
351+
# labels:
352+
# ingress-options: "false"
353+
# ingress-owner: appwrapper-name
354+
# spec:
355+
# ingressClassName: nginx
356+
# rules:
357+
# - http:
358+
# paths:
359+
# - backend:
360+
# service:
361+
# name: raytest-head-svc
362+
# port:
363+
# number: 8265
364+
# pathType: Prefix
365+
# path: /
366+
# host: ray-dashboard-raytest.<ingress-domain>
367+
# - replicas: 1
368+
# generictemplate:
369+
# kind: Route
370+
# apiVersion: route.openshift.io/v1
371+
# metadata:
372+
# name: ray-dashboard-deployment-route
373+
# namespace: default
374+
# labels:
375+
# # allows me to return name of service that Ray operator creates
376+
# odh-ray-cluster-service: deployment-name-head-svc
377+
# spec:
378+
# to:
379+
# kind: Service
380+
# name: deployment-name-head-svc
381+
# port:
382+
# targetPort: dashboard
383+
# tls:
384+
# termination: edge
385+
# - replicas: 1
386+
# generictemplate:
387+
# apiVersion: networking.k8s.io/v1
388+
# kind: Ingress
389+
# metadata:
390+
# name: rayclient-deployment-ingress
391+
# namespace: default
392+
# annotations:
393+
# annotations-example:annotations-example
394+
# labels:
395+
# odh-ray-cluster-service: deployment-name-head-svc
396+
# spec:
397+
# ingressClassName: nginx
398+
# rules:
399+
# - http:
400+
# paths:
401+
# - backend:
402+
# service:
403+
# name: deployment-name-head-svc
404+
# port:
405+
# number: 10001
406+
# path: ''
407+
# pathType: ImplementationSpecific
408+
# host: rayclient-raytest.<ingress-domain>
409+
# - replicas: 1
410+
# generictemplate:
411+
# apiVersion: route.openshift.io/v1
412+
# kind: Route
413+
# metadata:
414+
# name: rayclient-deployment-route
415+
# namespace: default
416+
# labels:
417+
# # allows me to return name of service that Ray operator creates
418+
# odh-ray-cluster-service: deployment-name-head-svc
419+
# spec:
420+
# port:
421+
# targetPort: client
422+
# tls:
423+
# termination: passthrough
424+
# to:
425+
# kind: Service
426+
# name: deployment-name-head-svc
427427
- replicas: 1
428428
generictemplate:
429429
apiVersion: v1

0 commit comments

Comments
 (0)