mirror of
https://github.com/TECHNOFAB11/kubenix.git
synced 2025-12-12 16:10:05 +01:00
feat(examples/nginx-deployment): minor refactor, fixes and e2e test
This commit is contained in:
parent
eac2d78667
commit
fc9abaa519
4 changed files with 54 additions and 14 deletions
20
examples/nginx-deployment/test.nix
Normal file
20
examples/nginx-deployment/test.nix
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
{ config, lib, pkgs, kubenix, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
{
|
||||
imports = [ kubenix.modules.test ./module.nix ];
|
||||
|
||||
test = {
|
||||
name = "nginx-deployment";
|
||||
description = "Test testing nginx deployment";
|
||||
testScript = ''
|
||||
$kube->waitUntilSucceeds("docker load < ${config.docker.images.nginx.image}");
|
||||
$kube->waitUntilSucceeds("kubectl apply -f ${toYAML config.kubernetes.generated}");
|
||||
|
||||
$kube->succeed("kubectl get deployment | grep -i nginx");
|
||||
$kube->waitUntilSucceeds("kubectl get deployment -o go-template nginx --template={{.status.readyReplicas}} | grep 10");
|
||||
$kube->waitUntilSucceeds("${pkgs.curl}/bin/curl http://nginx.default.svc.cluster.local | grep -i hello");
|
||||
'';
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue