Skip to content

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

duploctl ingress apply -f 'ingress.yaml'
Contents of the ingress.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

duploctl ingress create -f ingress.yaml
Contents of the ingress.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 -
Create an Ingress using a file.
duploctl ingress create -f ingress.yaml

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.

cli usage
duploctl ingress delete <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.

cli usage
duploctl ingress find <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

Retrieve a List of Ingress resources

cli usage
duploctl ingress list

Returns:

Name Type Description
list list

A list of Ingress.

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

duploctl ingress update -f ingress.yaml
Contents of the ingress.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.
duploctl ingress update <ingress-name> --replace /lbConfig/dnsPrefix <value>
Update port of a rule for an ingress.
duploctl ingress update <ingress-name> --replace /rules/0/port <port>
Update ingress by adding an additional rule.
duploctl ingress update <ingress-name> --add /rules/- '{"path":"/","pathType":"Prefix","serviceName":"<service-name>","port":80,"host":"<host>","portName":null}'
Update ingress by removing a rule.
duploctl ingress update <ingress-name> --remove /rules/0

Parameters:

Name Type Description Default
name NAME

The name of the Ingress resource to update. Required if body is not provided.

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 --add, --remove, --replace, --move, and --copy. Then followed by <path> and <value> for --add, --replace, and --test.

None

Returns:

Name Type Description
message dict

The created resource or success message.

Raises:

Type Description
DuploError

If the Ingress could not be updated.