Skip to content

Commit

Permalink
fix: upgrade ingress resource to v1
Browse files Browse the repository at this point in the history
  • Loading branch information
DarinMao committed Jan 8, 2022
1 parent 1fe4efc commit 28d34c5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion rcds/backends/k8s/manifests.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
KIND_TO_API_VERISON = {
"Deployment": "apps/v1",
"Service": "v1",
"Ingress": "networking.k8s.io/v1beta1",
"Ingress": "networking.k8s.io/v1",
"NetworkPolicy": "networking.k8s.io/v1",
}

Expand Down
9 changes: 6 additions & 3 deletions rcds/backends/k8s/templates/ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{% if container.expose %}
{% set httpPorts = container.expose|selectattr("http", "defined")|list %}
{% if httpPorts | first is defined %}
apiVersion: networking.k8s.io/v1beta1
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
namespace: {{ namespace }}
Expand All @@ -21,9 +21,12 @@ spec:
http:
paths:
- path: /
pathType: Prefix
backend:
serviceName: {{ container.name }}
servicePort: {{ httpPort.target }}
service:
name: {{ container.name }}
port:
number: {{ httpPort.target }}
{% endfor %}
{% endif %}
{% endif %}

0 comments on commit 28d34c5

Please sign in to comment.