Skip to content

Ingress

Bases: DuploResourceV3

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

Commands

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:
    http:
      - 80
  dnsPrefix: "duploctl"
  isPublic: true
rules:
  - path: "/"
    pathType: "Prefix"
    serviceName: "nginx"
    port: 80
    host: "duploctl-nginx.duplocloud.net"
    portName: null
name: "duploctl"
ingressClassName: "alb"
otherSpecs:
  tls: []

Returns:

Name Type Description
message dict

Success message.

Parameters:

--file, -f, --cli-input
A file to read the input from
FileType('r') action: YamlAction
--patches, --add, --remove, --copy, --replace, --test, --move
The json patch to apply
str action: JsonPatchAction

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:
    http:
      - 80
  dnsPrefix: "duploctl"
  isPublic: true
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:
    http:
      - 80
  dnsPrefix: "duploctl"
  isPublic: true
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

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.

Parameters:

--file, -f, --cli-input
A file to read the input from
FileType('r') action: YamlAction

delete

Delete a Ingress resource by name.

cli usage
duploctl ingress delete <name>

Returns:

Name Type Description
message dict

A success message.

Raises:

Type Description
DuploError

If the {{kind}} resource could not be found or deleted.

Parameters:

name positional
The resource name
str

find

Find Ingress resources by name.

cli usage
duploctl ingress find <name>

Returns:

Name Type Description
resource dict

The Ingress object.

Raises:

Type Description
DuploError

If the {{kind}} could not be found.

Parameters:

name positional
The resource name
str

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:
    http:
      - 80
  dnsPrefix: "duploctl"
  isPublic: true
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:
    http:
      - 80
  dnsPrefix: "duploctl"
  isPublic: true
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

Returns:

Name Type Description
message dict

The created resource or success message.

Raises:

Type Description
DuploError

If the Ingress could not be updated.

Parameters:

name positional
The resource name
str
--file, -f, --cli-input
A file to read the input from
FileType('r') action: YamlAction
--patches, --add, --remove, --copy, --replace, --test, --move
The json patch to apply
str action: JsonPatchAction

Methods

name_from_body