kuberneteslib 0.5.3 copy "kuberneteslib: ^0.5.3" to clipboard
kuberneteslib: ^0.5.3 copied to clipboard

A library that implements the Kubernetes API natively. It is written using the direct specs and currently covers most of the V1 Core, Apps, and Batch resources.

example/kuberneteslib_example.dart

import 'package:kuberneteslib/kuberneteslib.dart';

Future<void> main() async {
  //Initialize cluster configuration from default kubectl config
  final config = Config.fromYaml('<kubernetes config yaml>');

  // Initialize an auth
  final auth = ClusterAuth.fromConfig(config!);
  await auth.ensureInitialization();

  //List all pods in the 'default' namespace
  final pods = await Resource.list(resourceKind: 'pod', namespace: 'default');

  //Print pod information
  for (final pod in pods) {
    print('Pod: ${pod.metadata!.name}');
    print('Metadata: ${pod.metadata}');
    print('Spec: ${pod.spec}');
    print('Status: ${pod.status}');
    print('---');
  }
}
5
likes
0
points
1.34k
downloads

Publisher

verified publisherm3talsmith.com

Weekly Downloads

A library that implements the Kubernetes API natively. It is written using the direct specs and currently covers most of the V1 Core, Apps, and Batch resources.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

http, humanizer, js_interop, json2yaml, json_annotation, json_serializable, web, yaml

More

Packages that depend on kuberneteslib