Skip to content

Ingress

Gregory Nickonov edited this page Mar 20, 2019 · 4 revisions

Quick Start

R.ingress :frontend do
  add_tls :frontend, 'www.example.org'

  add_rule 'www.example.org'
end

This adds an Ingress with the host name www.example.org pointing to the Service frontend and secures it with TLS information from Secret frontend.

Ingress

Kubernetes Documentation

Sunstone property Kubernetes property Type
metadata metadata Kubernetes Object Metadata
spec spec IngressSpec

add_rule

Adds a rule to the Ingress specification binding host name to the Service, optionally specifying path and port:

R.ingress :frontend do
  # Add rule binding 'www.example.org' with the Service 'frontend', pointing at '/' on port 80
  add_rule 'www.example.org'

  # The same, but bind to the Service 'frontend-new'
  add_rule 'www.example.org', 'frontend-new'

  # Specify port and path
  add_rule 'www.example.org', 'frontend-new', path: '/new', service_port: 8080

  # Add more than one backend/path
  add_rule 'www.example.org' do
    # Also route everything under /api to service 'api', port 80
    add_path :api, 80, '/api'
  end
end

add_tls

Configures Ingress to use TLS when accessing specified hosts:

R.ingress :frontend do
  add_tls :frontend, 'www.example.org', 'example.org'
end

IngressSpec

Kubernetes Documentation

Sunstone property Kubernetes property Type
backend backend IngressBackend
rules rules Array of IngressRule
tls tls Array of IngressTLS

IngressBackend

Kubernetes Documentation

Sunstone property Kubernetes property Type
service_name serviceName String
service_port servicePort Integer or String

IngressRule

Kubernetes Documentation

Sunstone property Kubernetes property Type
host host String
http http HTTPIngressRuleValue

HTTPIngressRuleValue

Kubernetes Documentation

Sunstone property Kubernetes property Type
paths paths Array of HTTPIngressPath

HTTPIngressPath

Kubernetes Documentation

Sunstone property Kubernetes property Type
backend backend IngressBackend
path path String

IngressTLS

Kubernetes Documentation

Sunstone property Kubernetes property Type
hosts hosts Array of String
secret_name secretName String
Clone this wiki locally