Project

General

Profile

Actions

action #112457

closed

coordination #112454: [epic] Kubernetes testing

[New test] Test coverage for kubernetes client (kubectl)

Added by jlausuch about 2 years ago. Updated almost 2 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
Target version:
-
Start date:
2022-06-15
Due date:
% Done:

100%

Estimated time:

Description

Kubernetes client is part of Containers Module since 15-SP1.

From scc.suse.com:

kubernetes-client   1.17.4-4.18.1   Apache-2.0  Containers Module 15 SP1
kubernetes1.18-client   1.18.10-5.5.1   Apache-2.0  Containers Module 15 SP2
kubernetes1.18-client   1.18.10-5.5.1   Apache-2.0  Containers Module 15 SP3
kubernetes1.18-client   1.18.10-5.5.1   Apache-2.0  Containers Module 15 SP4

The goal is to have proper coverage for kubectl exercising all the command options that the CLI provides.

We could run validation of the client against several K8S environments (EKS, , similar to what we do for Helm tests.

There is already some basic smoke test for kubectl here:
https://github.com/os-autoinst/os-autoinst-distri-opensuse/blob/master/lib/rancher/utils.pm#L39

sub kubectl_basic_test {
    assert_script_run "kubectl get pod --all-namespaces -o wide";
    assert_script_run "kubectl get service --all-namespaces -o wide";
    assert_script_run "kubectl get namespaces --all-namespaces -o wide";
    assert_script_run "kubectl get endpoints --all-namespaces -o wide";
    assert_script_run "kubectl get deployments --all-namespaces -o wide";
    assert_script_run "kubectl get replicasets --all-namespaces -o wide";
    assert_script_run "kubectl get ingresses --all-namespaces -o wide";
    assert_script_run "kubectl cluster-info";
}

This could be used as a base.

There is also a method in lib directory to install it in SLE/openSUSE:
https://github.com/os-autoinst/os-autoinst-distri-opensuse/blob/master/lib/containers/k8s.pm#L38

Acceptance criteria:

New test module(s) for SLE 15-SP1+ and openSUSE to cover kubectl command line operations with real Kubernetes environments.

  • AC 1: Get (get) operation (namespace, deployment, replicaset, pod, job, cronjob, service, ingresses, pc, pvc, secrets, configmaps, endpoints)
  • AC 2: Describe (describe) operations (the same than in AC 1)
  • AC 3: Queries get operations
  • AC 4: Filtering over describe operations (for instance on configmaps or pod status)
  • AC 5: Creation, delete, list and change of namespaces

Files

rocket.jpg (21.1 KB) rocket.jpg jlausuch, 2022-07-19 09:44

Related issues 1 (0 open1 closed)

Related to Containers - action #114457: Run kubectl tests on SLESResolvedpdostal2022-07-21

Actions
Actions

Also available in: Atom PDF