mirror of
https://github.com/TECHNOFAB11/kubenix.git
synced 2025-12-12 16:10:05 +01:00
fix helm test
This commit is contained in:
parent
1cc28e4602
commit
be58b0e94e
2 changed files with 25 additions and 22 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
|
@ -1 +1 @@
|
||||||
result
|
result*
|
||||||
|
|
|
||||||
|
|
@ -11,22 +11,25 @@ let
|
||||||
postgresql = pullImage {
|
postgresql = pullImage {
|
||||||
imageName = "docker.io/bitnami/postgresql";
|
imageName = "docker.io/bitnami/postgresql";
|
||||||
imageDigest = "sha256:ec16eb9ff2e7bf0669cfc52e595f17d9c52efd864c3f943f404d525dafaaaf96";
|
imageDigest = "sha256:ec16eb9ff2e7bf0669cfc52e595f17d9c52efd864c3f943f404d525dafaaaf96";
|
||||||
sha256 = "1idl8amp2jifc71lq8ymyns41d76cnasqbxyaild0gjzlpxmsn9n";
|
sha256 = "12jr8pzvj1qglrp7sh857a5mv4nda67hw9si6ah2bl6y1ff19l65";
|
||||||
|
finalImageName = "docker.io/bitnami/postgresql";
|
||||||
finalImageTag = "11.7.0-debian-10-r55";
|
finalImageTag = "11.7.0-debian-10-r55";
|
||||||
};
|
};
|
||||||
|
|
||||||
postgresqlExporter = pullImage {
|
postgresqlExporter = pullImage {
|
||||||
imageName = "docker.io/bitnami/postgres-exporter";
|
imageName = "docker.io/bitnami/postgres-exporter";
|
||||||
imageDigest = "sha256:08ab46104b83834760a5e0329af11de23ccf920b4beffd27c506f34421920313";
|
imageDigest = "sha256:373ba8ac1892291b4121591d1d933b7f9501ae45b9b8d570d7deb4900f91cfe9";
|
||||||
sha256 = "14yw8fp6ja7x1wn3lyw8ws5lc5z9jz54vdc5ad5s7yxjfs0jvk6d";
|
sha256 = "0icrqmlj8127jhmiy3vh419cv7hwnw19xdn89hxxyj2l6a1chryh";
|
||||||
finalImageTag = "0.8.0-debian-10-r66";
|
finalImageName = "docker.io/bitnami/postgres-exporter";
|
||||||
|
finalImageTag = "0.9.0-debian-10-r43";
|
||||||
};
|
};
|
||||||
|
|
||||||
minideb = pullImage {
|
bitnamiShell = pullImage {
|
||||||
imageName = "docker.io/bitnami/minideb";
|
imageName = "docker.io/bitnami/bitnami-shell";
|
||||||
imageDigest = "sha256:2f430acaa0ffd88454ac330a6843840f1e1204007bf92f8ce7b654fd3b558d68";
|
imageDigest = "sha256:58ba68e1f1d9a55c1234ae5b439bdcf0de1931e4aa1bac7bd0851b66de14fd97";
|
||||||
sha256 = "1h589digi99jvpdzn3azx4p8hlh7plci04him9vfmx2vfa5zxq4i";
|
sha256 = "00lmphm3ds17apbmh2m2r7cz05jhp4dc3ynswrj0pbpq0azif4zn";
|
||||||
finalImageTag = "buster";
|
finalImageName = "docker.io/bitnami/bitnami-shell";
|
||||||
|
finalImageTag = "10";
|
||||||
};
|
};
|
||||||
in {
|
in {
|
||||||
imports = [ kubenix.modules.test kubenix.modules.helm kubenix.modules.k8s ];
|
imports = [ kubenix.modules.test kubenix.modules.helm kubenix.modules.k8s ];
|
||||||
|
|
@ -37,22 +40,22 @@ in {
|
||||||
assertions = [{
|
assertions = [{
|
||||||
message = "should have generated resources";
|
message = "should have generated resources";
|
||||||
assertion =
|
assertion =
|
||||||
appsv1.StatefulSet ? "app-psql-postgresql-master" &&
|
appsv1.StatefulSet ? "app-psql-postgresql-primary" &&
|
||||||
appsv1.StatefulSet ? "app-psql-postgresql-slave" &&
|
appsv1.StatefulSet ? "app-psql-postgresql-read" &&
|
||||||
corev1.Secret ? "app-psql-postgresql" &&
|
corev1.Secret ? "app-psql-postgresql" &&
|
||||||
corev1.Service ? "app-psql-postgresql-headless" ;
|
corev1.Service ? "app-psql-postgresql-headless" ;
|
||||||
} {
|
} {
|
||||||
message = "should have values passed";
|
message = "should have values passed";
|
||||||
assertion = appsv1.StatefulSet.app-psql-postgresql-slave.spec.replicas == 2;
|
assertion = appsv1.StatefulSet.app-psql-postgresql-read.spec.replicas == 2;
|
||||||
} {
|
} {
|
||||||
message = "should have namespace defined";
|
message = "should have namespace defined";
|
||||||
assertion =
|
assertion =
|
||||||
appsv1.StatefulSet.app-psql-postgresql-master.metadata.namespace == "test";
|
appsv1.StatefulSet.app-psql-postgresql-primary.metadata.namespace == "test";
|
||||||
}];
|
}];
|
||||||
testScript = ''
|
testScript = ''
|
||||||
kube.wait_until_succeeds("docker load < ${postgresql}")
|
kube.wait_until_succeeds("docker load < ${postgresql}")
|
||||||
kube.wait_until_succeeds("docker load < ${postgresqlExporter}")
|
kube.wait_until_succeeds("docker load < ${postgresqlExporter}")
|
||||||
kube.wait_until_succeeds("docker load < ${minideb}")
|
kube.wait_until_succeeds("docker load < ${bitnamiShell}")
|
||||||
kube.wait_until_succeeds("kubectl apply -f ${config.kubernetes.result}")
|
kube.wait_until_succeeds("kubectl apply -f ${config.kubernetes.result}")
|
||||||
kube.wait_until_succeeds("PGPASSWORD=postgres ${pkgs.postgresql}/bin/psql -h app-psql-postgresql.test.svc.cluster.local -U postgres -l")
|
kube.wait_until_succeeds("PGPASSWORD=postgres ${pkgs.postgresql}/bin/psql -h app-psql-postgresql.test.svc.cluster.local -U postgres -l")
|
||||||
'';
|
'';
|
||||||
|
|
@ -67,24 +70,24 @@ in {
|
||||||
chart = helm.fetch {
|
chart = helm.fetch {
|
||||||
repo = "https://charts.bitnami.com/bitnami";
|
repo = "https://charts.bitnami.com/bitnami";
|
||||||
chart = "postgresql";
|
chart = "postgresql";
|
||||||
version = "8.6.13";
|
version = "10.3.8";
|
||||||
sha256 = "pYJuxr5Ec6Yjv/wFn7QAA6vCiVjNTz1mWoexdxwiEzE=";
|
sha256 = "sha256-0hJ5pNIivpXeRal1DwJ2VSD3Yxtw2omOoIYGZKGtu9I=";
|
||||||
};
|
};
|
||||||
|
|
||||||
values = {
|
values = {
|
||||||
image = {
|
image = {
|
||||||
repository = "bitnami/postgresql";
|
repository = "bitnami/postgresql";
|
||||||
tag = "10.7.0";
|
tag = "11.11.0-debian-10-r71";
|
||||||
pullPolicy = "IfNotPresent";
|
pullPolicy = "IfNotPresent";
|
||||||
};
|
};
|
||||||
volumePermissions.image = {
|
volumePermissions.image = {
|
||||||
repository = "bitnami/minideb";
|
repository = "bitnami/bitnami-shell";
|
||||||
tag = "latest";
|
tag = "10";
|
||||||
pullPolicy = "IfNotPresent";
|
pullPolicy = "IfNotPresent";
|
||||||
};
|
};
|
||||||
metrics.image = {
|
metrics.image = {
|
||||||
repository = "wrouesnel/postgres_exporter";
|
repository = "bitnami/postgres-exporter";
|
||||||
tag = "v0.4.7";
|
tag = "0.9.0-debian-10-r43";
|
||||||
pullPolicy = "IfNotPresent";
|
pullPolicy = "IfNotPresent";
|
||||||
};
|
};
|
||||||
replication.enabled = true;
|
replication.enabled = true;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue