Ingress
Bases: DuploTenantResourceV3
Kubernetes Ingress
This class offers methods to manage Kubernetes Ingress within DuploCloud.
See more details at: https://docs.duplocloud.com/docs/kubernetes-overview/ingress-loadbalancer
apply
Apply a Ingress
Create or Update a Ingress resource with Duplocloud cli.
CLI Usage
Contents of theingress.yaml
file
labels: null
annotations: null
lbConfig:
listeners:
https:
- 443
http:
- 80
dnsPrefix: "duploctl"
isPublic: true
certArn:
rules:
- path: "/"
pathType: "Prefix"
serviceName: "nginx"
port: 80
host: "duploctl-nginx.duplocloud.net"
portName: null
name: "duploctl"
ingressClassName: "alb"
otherSpecs:
tls: []
Parameters:
Name | Type | Description | Default |
---|---|---|---|
body
|
BODY
|
The resource to apply. |
required |
wait
|
WAIT
|
Wait for the resource to be created. |
False
|
patches
|
PATCHES
|
The patches to apply to the resource. |
None
|
Returns:
Name | Type | Description |
---|---|---|
message |
dict
|
Success message. |
create
Create an Ingress resource.
Creates a new Ingress resource with the specified metadata and data entries.
CLI Usage
Contents of theingress.yaml
file
labels: null
annotations: null
lbConfig:
listeners:
https:
- 443
http:
- 80
dnsPrefix: "duploctl"
isPublic: true
certArn:
rules:
- path: "/"
pathType: "Prefix"
serviceName: "nginx"
port: 80
host: "duploctl-nginx.duplocloud.net"
portName: null
name: "duploctl"
ingressClassName: "alb"
otherSpecs:
tls: []
Create an Ingress using a one-liner.
echo """
labels: null
annotations: null
lbConfig:
listeners:
https:
- 443
http:
- 80
dnsPrefix: "duploctl"
isPublic: true
certArn:
rules:
- path: "/"
pathType: "Prefix"
serviceName: "nginx"
port: 80
host: "duploctl-nginx.duplocloud.net"
portName: null
name: "duploctl"
ingressClassName: "alb"
otherSpecs:
tls: []
""" | duploctl ingress create -f -
Parameters:
Name | Type | Description | Default |
---|---|---|---|
body
|
BODY
|
The complete Ingress resource definition including name, rules, and other configuration. |
required |
Returns:
Name | Type | Description |
---|---|---|
message |
dict
|
The created resource or success message. |
Raises:
Type | Description |
---|---|
DuploError
|
If the Ingress could not be created due to invalid configuration or API errors. |
delete
Delete a Ingress resource by name.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name
|
NAME
|
The name of the Ingress resource to delete. |
required |
Returns:
Name | Type | Description |
---|---|---|
message |
dict
|
A success message. |
Raises:
Type | Description |
---|---|
DuploError
|
If the {{kind}} resource could not be found or deleted. |
find
Find Ingress resources by name.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name
|
NAME
|
The name of the Ingress resource to find. |
required |
Returns:
Name | Type | Description |
---|---|---|
resource |
dict
|
The Ingress object. |
Raises:
Type | Description |
---|---|
DuploError
|
If the {{kind}} could not be found. |
list
update
Update an Ingress resource.
Update an existing Ingress resource with the specified metadata and data entries. The update can be performed either by providing a complete resource definition or by applying JSON patches to modify specific fields.
CLI Usage
Contents of theingress.yaml
file
labels: null
annotations: null
lbConfig:
listeners:
https:
- 443
http:
- 80
dnsPrefix: "duploctl"
isPublic: true
certArn:
rules:
- path: "/"
pathType: "Prefix"
serviceName: "nginx"
port: 80
host: "duploctl-nginx.duplocloud.net"
portName: null
name: "duploctl"
ingressClassName: "alb"
otherSpecs:
tls: []
Update ingress using a one-liner.
echo """
labels: null
annotations: null
lbConfig:
listeners:
https:
- 443
http:
- 80
dnsPrefix: "duploctl"
isPublic: true
certArn:
rules:
- path: "/"
pathType: "Prefix"
serviceName: "nginx"
port: 80
host: "duploctl-nginx.duplocloud.net"
portName: null
name: "duploctl"
ingressClassName: "alb"
otherSpecs:
tls: []
""" | duploctl ingress update -f -
Update dnsPrefix for an ingress.
Update port of a rule for an ingress.
Update ingress by adding an additional rule.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name
|
NAME
|
The name of the Ingress resource to update. Required if |
required |
body
|
BODY
|
The complete Ingress resource definition with updated configuration. |
None
|
patches
|
PATCHES
|
A list of JSON patches to apply to the Ingress resource.
The options are |
None
|
Returns:
Name | Type | Description |
---|---|---|
message |
dict
|
The created resource or success message. |
Raises:
Type | Description |
---|---|
DuploError
|
If the Ingress could not be updated. |