feat(examples/nginx-deployment): minor refactor, fixes and e2e test

This commit is contained in:
Jaka Hudoklin 2019-03-07 23:24:28 +01:00
parent eac2d78667
commit fc9abaa519
No known key found for this signature in database
GPG key ID: 6A08896BFD32BD95
4 changed files with 54 additions and 14 deletions

View 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");
'';
};
}