Comments (4)
@ahmetb, those are great questions! i appreciate you opening an issue to ask for better documentation.
tilt looks at pods and jobs to determine readiness for kubernetes resources. a pod is considered ready when all of its containers are ready, (which may take into account readiness probes if they're defined on a container). a job is considered ready when it has completed.
if a k8s workload object, including a CRD, doesn't create pods, there isn't a way for tilt to know when it's ready. that's why there's a pod_readiness='ignore'
option, which tells tilt that it shouldn't be waiting for pods to show up to determine a resource's readiness.
there are a couple CRD examples linked in our docs, if that's helpful, or you can take a look at the knative extension for more info about what that looks like in practice.
i'll follow up with a docs pr, too.
from tilt.build.
if a k8s workload object, including a CRD, doesn't create pods, there isn't a way for tilt to know when it's ready.
I think this definition is inherently problematic. For example, Knative Service CRD creates Pods but deletes them later if they don't receive any requests. The readiness definition for many CRDs (incl. Knative) is converging towards the kstatus convention (the snippet/link I added in my original comment). So checking the Pods is not a good indicator, but the CRD itself reports its readiness.
Would it be noteworthy to consider looking at status.conditions[*].type~Ready.status=="True" to determine readiness of other resources? I suspect this convention is only going to get more widespread, and can be a good indicator, if present.
from tilt.build.
let's move our discussion over to #3301, so other tilt folks can chime in and this issue for docs can be closed. upvotes and comments on existing issues are great, since it helps us gauge interest/need.
i'll tag you and include your comments there.
from tilt.build.
For others looking for how to "wait for CRDs to be ready", the key part from the examples is here: https://github.com/tilt-dev/tilt-example-frameworks/blob/5d8554023431587916400917f2b716edebe99ad5/prometheus/Tiltfile#L39
However, I found the kubectl wait
command wasn't finding the CRD I wanted it to wait for, for some reason. (probably missing a namespace indicator or something)
Anyway, I switched to using the tilt wait command instead:
k8s_resource(new_name="my-crd-definition",
objects=[my_crd_name],
pod_readiness="ignore")
# wait until the CRD is ready
local_resource("my-crd-definition-ready",
cmd="tilt wait --for=condition=Ready uiresource/my-crd-definition",
resource_deps=["my-crd-definition"])
k8s_resource("the-resource-to-start-afterward",
resource_deps=["my-crd-definition-ready"])
from tilt.build.
Related Issues (20)
- include docs about using tilt set to override default values HOT 2
- docs: unclear that `link()` should be used with `links=[]`
- config.define_bool code example is jumbled HOT 3
- "image" should be replaced with "build" in Docker Compose caveat HOT 1
- docs: Wrong error level in the "Code. Update. Repeat." chapter of the tutorial HOT 1
- Add dark theme to docs https://docs.tilt.dev
- Capturing user analytics
- How to combine multiple Tiltfiles with their own config HOT 1
- Mention the need for specifying platform in bazel docs HOT 1
- Upgrade installs tilt to wrong path
- update docs for Tiltfile Reference API with optional flag for local() function
- Example version_settings constraints are incorrect HOT 1
- Add guidance for optimized live_update workflow with more frameworks
- Provide example of cleanup on tilt down
- missing API docs for readiness_probe
- Examples/guidance for more complex shell escaping
- docs: unclear if/when there's a minimum tilt version needed
- Scrolling gets stuck on iOS Safari HOT 2
- docs: using multiple repos with tilt HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tilt.build.