DEV Community

Cover image for How to deploy Ingress with Tilt
Antoine
Antoine

Posted on

1

How to deploy Ingress with Tilt

Photo by Hello I'm Nik 🎞 on Unsplash

Tilt is an amazing tool to deploy easily services to your local kubernetes file.

But how to deploy ingress with tilt ?

Luckily, browsing tilt issues, i have found this github containing an example.

load('ext://namespace', 'namespace_create', 'namespace_inject')

namespace_create('ambassador')

k8s_yaml('ambassador-operator-crds.yaml')
k8s_yaml(namespace_inject('ambassador-operator-kind.yaml', 'ambassador'))
k8s_yaml('ingress-example.yaml')

k8s_resource('ambassador-operator', objects=[
    'ambassadorinstallations.getambassador.io:customresourcedefinition',
    'ambassador-operator:serviceaccount',
    'ambassador-operator:role',
    'ambassador-operator-cluster:clusterrole',
    'ambassador-operator:rolebinding',
    'ambassador-operator-cluster:clusterrolebinding',
    'static-helm-values:configmap',
    'ambassador:ambassadorinstallation',
])

k8s_resource(new_name='ingress', objects=['example-ingress'], resource_deps=['ambassador-operator'])
Enter fullscreen mode Exit fullscreen mode

It creates the namespace through a tilt plugin, and load the yaml resources that will be used using k8s_yaml.

It then creates the ambassador operator using k8s_resource. Please note that the : is used to split name from kind.

Finally, it create the ingress.

Hope this helps !

Sentry image

Hands-on debugging session: instrument, monitor, and fix

Join Lazar for a hands-on session where you’ll build it, break it, debug it, and fix it. You’ll set up Sentry, track errors, use Session Replay and Tracing, and leverage some good ol’ AI to find and fix issues fast.

RSVP here →

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs