Skip to content

Commit

Permalink
#620 feat: upgrade deprecated K8s apis in the helm templates
Browse files Browse the repository at this point in the history
  • Loading branch information
zsinnema committed Nov 9, 2022
1 parent 3483d3d commit f31b330
Show file tree
Hide file tree
Showing 14 changed files with 40 additions and 26 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: apiextensions.k8s.io/v1beta1
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: clusterworkflowtemplates.argoproj.io
Expand All @@ -7,7 +7,6 @@ metadata:
helm.sh/hook-delete-policy: before-hook-creation
spec:
group: argoproj.io
version: v1alpha1
scope: Cluster
names:
kind: ClusterWorkflowTemplate
Expand Down
3 changes: 1 addition & 2 deletions applications/argo/deploy/charts/crds/cron-workflow-crd.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: apiextensions.k8s.io/v1beta1
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: cronworkflows.argoproj.io
Expand All @@ -16,7 +16,6 @@ spec:
- cronwf
singular: cronworkflow
scope: Namespaced
version: v1alpha1
versions:
- name: v1alpha1
served: true
Expand Down
3 changes: 1 addition & 2 deletions applications/argo/deploy/charts/crds/workflow-crd.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: apiextensions.k8s.io/v1beta1
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: workflows.argoproj.io
Expand Down Expand Up @@ -26,7 +26,6 @@ spec:
singular: workflow
scope: Namespaced
subresources: {}
version: v1alpha1
versions:
- name: v1alpha1
served: true
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: apiextensions.k8s.io/v1beta1
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: workfloweventbindings.argoproj.io
Expand All @@ -12,7 +12,6 @@ spec:
- wfeb
singular: workfloweventbinding
scope: Namespaced
version: v1alpha1
versions:
- name: v1alpha1
served: true
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: apiextensions.k8s.io/v1beta1
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: workflowtemplates.argoproj.io
Expand All @@ -7,7 +7,6 @@ metadata:
helm.sh/hook-delete-policy: before-hook-creation
spec:
group: argoproj.io
version: v1alpha1
scope: Namespaced
names:
kind: WorkflowTemplate
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{- if .Values.installCRD }}
apiVersion: apiextensions.k8s.io/v1beta1
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: clusterworkflowtemplates.argoproj.io
Expand All @@ -13,6 +13,10 @@ spec:
names:
kind: ClusterWorkflowTemplate
plural: clusterworkflowtemplates
versions:
- name: v1
served: true
storage: true
shortNames:
- clusterwftmpl
- cwft
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{- if .Values.installCRD }}
apiVersion: apiextensions.k8s.io/v1beta1
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: cronworkflows.argoproj.io
Expand All @@ -15,5 +15,8 @@ spec:
- cronwf
- cwf
scope: Namespaced
version: v1alpha1
versions:
- name: v1alpha1
served: true
storage: true
{{- end }}
7 changes: 5 additions & 2 deletions applications/argo/deploy/charts/templates/workflow-crd.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{- if .Values.installCRD }}
apiVersion: apiextensions.k8s.io/v1beta1
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: workflows.argoproj.io
Expand All @@ -24,5 +24,8 @@ spec:
shortNames:
- wf
scope: Namespaced
version: v1alpha1
versions:
- name: v1alpha1
served: true
storage: true
{{- end }}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{- if .Values.installCRD }}
apiVersion: apiextensions.k8s.io/v1beta1
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: workflowtemplates.argoproj.io
Expand All @@ -8,11 +8,14 @@ metadata:
helm.sh/hook-delete-policy: before-hook-creation
spec:
group: argoproj.io
version: v1alpha1
scope: Namespaced
names:
kind: WorkflowTemplate
plural: workflowtemplates
shortNames:
- wftmpl
versions:
- name: v1alpha1
served: true
storage: true
{{- end }}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{- if .Values.apps.jupyterhub.scheduling.podPriority.enabled }}
apiVersion: scheduling.k8s.io/v1beta1
apiVersion: scheduling.k8s.io/v1
kind: PriorityClass
metadata:
name: {{ .Release.Name }}-default-priority
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{{- if .Values.apps.jupyterhub.scheduling.podPriority.enabled }}
{{- if .Values.apps.jupyterhub.scheduling.userPlaceholder.enabled -}}
apiVersion: scheduling.k8s.io/v1beta1
apiVersion: scheduling.k8s.io/v1
kind: PriorityClass
metadata:
name: {{ .Release.Name }}-user-placeholder-priority
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{ define "deploy_utils.database.mongo.backup"}}
apiVersion: batch/v1beta1
apiVersion: batch/v1
kind: CronJob
metadata:
name: "{{ .app.harness.database.name }}-backup"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{ define "deploy_utils.database.postgres.backup"}}
apiVersion: batch/v1beta1
apiVersion: batch/v1
kind: CronJob
metadata:
name: "{{ .app.harness.database.name }}-backup"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,30 @@
http:
paths:
- path: /(.*)
pathType: ImplementationSpecific
backend:
serviceName: {{ .app.harness.service.name }}{{- if (and .app.harness.secured $secured_gatekeepers) }}-gk{{- end }}
servicePort: {{- if (and .app.harness.secured $secured_gatekeepers) }} 8080 {{- else }} {{ .app.harness.service.port | default 80 }}{{- end }}
service:
name: {{ .app.harness.service.name }}{{- if (and .app.harness.secured $secured_gatekeepers) }}-gk{{- end }}
port:
number: {{- if (and .app.harness.secured $secured_gatekeepers) }} 8080 {{- else }} {{ .app.harness.service.port | default 80 }}{{- end }}
{{- end }}
{{- define "deploy_utils.ingress.service" }}
{{ $domain := .root.Values.domain }}
{{ $secured_gatekeepers := and .root.Values.secured_gatekeepers }}
{{ $app := get .root.Values.apps (print .service_name | snakecase) }}
- path: /proxy/{{ $app.harness.service.name }}/(.*)
pathType: ImplementationSpecific
backend:
serviceName: {{ $app.harness.service.name }}{{- if (and $app.harness.secured $secured_gatekeepers) }}-gk{{- end }}
servicePort: {{- if (and $app.harness.secured $secured_gatekeepers) }} 8080 {{- else }} {{ $app.harness.service.port | default 80 }}{{- end }}
service:
name: {{ $app.harness.service.name }}{{- if (and $app.harness.secured $secured_gatekeepers) }}-gk{{- end }}
port:
number: {{- if (and $app.harness.secured $secured_gatekeepers) }} 8080 {{- else }} {{ $app.harness.service.port | default 80 }}{{- end }}
{{- end }}
{{- if .Values.ingress.enabled }}
{{ $domain := .Values.domain }}
{{ $tls := not (not .Values.tls) }}
{{ $mainapp := .Values.mainapp }}
apiVersion: extensions/v1beta1
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ .Values.ingress.name | quote }}
Expand Down

0 comments on commit f31b330

Please sign in to comment.