kubenix/tests/helm/simple.nix
Jaka Hudoklin ba1144a8df
feat: initial helm integration (thanks to @matejc)
helm2json was first implemented by matejc in
https://github.com/matejc/helm2json and incorperated in this project,
big thanks to @matejc for making this possible
2019-02-28 13:17:40 +01:00

40 lines
1.1 KiB
Nix

{ config, test, kubenix, k8s, helm, ... }:
with k8s;
let
corev1 = config.kubernetes.api.core.v1;
appsv1beta2 = config.kubernetes.api.apps.v1beta2;
in {
imports = [
kubenix.helm
];
test = {
name = "helm-simple";
description = "Simple k8s testing wheter name, apiVersion and kind are preset";
assertions = [{
message = "should have generated resources";
assertion =
appsv1beta2.StatefulSet ? "app-psql-postgreql" &&
corev1.ConfigMap ? "app-psql-postgresql-init-scripts" &&
corev1.Secret ? "app-psql-postgresql" &&
corev1.Service ? "app-psql-postgresql-headless" ;
} {
message = "should have namespace defined";
assertion =
appsv1beta2.StatefulSet.app-psql-postgresql.metadata.namespace == "test-namespace";
}];
};
kubernetes.api.namespaces.test-namespace = {};
kubernetes.helm.instances.app-psql = {
namespace = "test-namespace";
chart = helm.fetch {
chart = "stable/postgresql";
version = "3.0.0";
sha256 = "0icnnpcqvf1hqn7fc9niyifd0amlm9jfrx3iks0y360rk8wndbch";
};
};
}