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
This commit is contained in:
Jaka Hudoklin 2019-02-28 13:17:40 +01:00
parent a5f9639258
commit ba1144a8df
No known key found for this signature in database
GPG key ID: 6A08896BFD32BD95
7 changed files with 296 additions and 0 deletions

View file

@ -32,6 +32,7 @@ let
./k8s/1.13/crd.nix
./k8s/submodule.nix
./k8s/defaults.nix
./helm/simple.nix
./istio/bookinfo.nix
./submodules/simple.nix
./submodules/defaults.nix

40
tests/helm/simple.nix Normal file
View file

@ -0,0 +1,40 @@
{ 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";
};
};
}