Skip to content

Commit 6343bf0

Browse files
committed
Improve kubernetes dev service documentation and add integration test
1 parent e38dce9 commit 6343bf0

File tree

4 files changed

+24
-5
lines changed

4 files changed

+24
-5
lines changed

docs/src/main/asciidoc/kubernetes-dev-services.adoc

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,11 +88,22 @@ And then add the following property to your `application.properties`:
8888
quarkus.kubernetes-client.devservices.manifests=kubernetes/namespace.yaml
8989
```
9090

91+
When applying multiple properties, you can apply them as:
92+
```
93+
quarkus.kubernetes-client.devservices.manifests[0]=kubernetes/first_manifest.yaml
94+
quarkus.kubernetes-client.devservices.manifests[1]=kubernetes/second_manifest.yaml
95+
```
96+
9197
It is also possible to apply manifests from a URL. So the following syntax would also be possible:
9298
```
9399
quarkus.kubernetes-client.devservices.manifests=https://example.com/kubernetes/namespace.yaml
94100
```
95101

102+
NOTE: Quarkus will apply the manifests in the order they are specified in the list.
103+
104+
NOTE: Quarkus will await resources such as deployments to be ready before moving on to the next manifest.
105+
All applied resources are guaranteed to be ready by the time your application finishes startup.
106+
96107
=== Deploying helm charts
97108
`quarkus.kubernetes-client.devservices.manifests` only supports manifests. If you want to deploy a helm chart, you can use the `k3s` flavor and deploy a `HelmChart` manifest. See https://docs.k3s.io/helm for more information on how to use helm charts with k3s.
98109

extensions/kubernetes-client/deployment/src/main/java/io/quarkus/kubernetes/client/deployment/DevServicesKubernetesProcessor.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -230,14 +230,14 @@ public void applyManifests(
230230
});
231231
}
232232
} catch (Exception ex) {
233-
log.errorf("Failed to deploy manifest %s: %s", manifestPath, ex.getMessage());
233+
log.errorf("Failed to apply manifest %s: %s", manifestPath, ex.getMessage());
234234
}
235235
}
236236

237237
log.infof("Applied manifest %s.", manifestPath);
238238
}
239239
} catch (Exception e) {
240-
log.error("Failed to create Kubernetes client while trying to deploy manifests.", e);
240+
log.error("Failed to create Kubernetes client while trying to apply manifests.", e);
241241
}
242242
}
243243

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
quarkus.kubernetes-client.devservices.manifests=kubernetes/namespace.yaml
1+
quarkus.kubernetes-client.devservices.manifests[0]=kubernetes/namespace.yaml
2+
quarkus.kubernetes-client.devservices.manifests[1]=https://k8s.io/examples/admin/namespace-dev.yaml

integration-tests/kubernetes-client-devservices/src/test/java/io/quarkus/kubernetes/client/devservices/it/DevServicesKubernetesTest.java

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,15 @@ public void shouldReturnAllKeys() {
2626
}
2727

2828
@Test
29-
@DisplayName("specified manifest must be applied to the cluster by the dev service")
30-
public void manifestIsApplied() {
29+
@DisplayName("specified manifest in the resources folder must be applied to the cluster by the dev service")
30+
public void resourceManifestIsApplied() {
3131
Assertions.assertNotNull(kubernetesClient.namespaces().withName("example-namespace").get());
3232
}
33+
34+
@Test
35+
@DisplayName("specified manifest from a URL must be applied to the cluster by the dev service")
36+
public void urlManifestIsApplied() {
37+
// Applied by https://k8s.io/examples/admin/namespace-dev.yaml
38+
Assertions.assertNotNull(kubernetesClient.namespaces().withName("development").get());
39+
}
3340
}

0 commit comments

Comments
 (0)