You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(eks): ability to query runtime information from the cluster (#9535)
Introduce a `KubernetesResourceAttribute` construct that executes `kubectl get` commands to fetch runtime information on kubernetes resources.
Resolves#8394
BREAKING CHANGE: `cluster.addResource` was renamed to `cluster.addManifest` and `KubernetesResource` was renamed to `KubernetesManifest`
----
*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
const service =cluster.addResource('my-service', {
369
+
const service =cluster.addManifest('my-service', {
370
370
metadata: {
371
371
name: 'myservice',
372
372
namespace: 'my-app'
@@ -377,14 +377,14 @@ const service = cluster.addResource('my-service', {
377
377
service.node.addDependency(namespace); // will apply `my-namespace` before `my-service`.
378
378
```
379
379
380
-
NOTE: when a `KubernetesResource` includes multiple resources (either directly
381
-
or through `cluster.addResource()`) (e.g. `cluster.addResource('foo', r1, r2,
380
+
NOTE: when a `KubernetesManifest` includes multiple resources (either directly
381
+
or through `cluster.addManifest()`) (e.g. `cluster.addManifest('foo', r1, r2,
382
382
r3,...))`), these resources will be applied as a single manifest via `kubectl`
383
383
and will be applied sequentially (the standard behavior in `kubectl`).
384
384
385
385
### Patching Kubernetes Resources
386
386
387
-
The KubernetesPatch construct can be used to update existing kubernetes
387
+
The `KubernetesPatch` construct can be used to update existing kubernetes
388
388
resources. The following example can be used to patch the `hello-kubernetes`
389
389
deployment from the example above with 5 replicas.
390
390
@@ -397,6 +397,37 @@ new KubernetesPatch(this, 'hello-kub-deployment-label', {
397
397
})
398
398
```
399
399
400
+
### Querying Kubernetes Object Values
401
+
402
+
The `KubernetesObjectValue` construct can be used to query for information about kubernetes objects,
403
+
and use that as part of your CDK application.
404
+
405
+
For example, you can fetch the address of a [`LoadBalancer`](https://kubernetes.io/docs/concepts/services-networking/service/#loadbalancer) type service:
0 commit comments