kuberneteslib 0.9.3 copy "kuberneteslib: ^0.9.3" to clipboard
kuberneteslib: ^0.9.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!);

  //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('---');
  }
}
copied to clipboard
5
likes
140
points
273
downloads

Publisher

verified publisherm3talsmith.com

Weekly Downloads

2024.09.16 - 2025.03.31

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)

Documentation

API reference

License

GPL-3.0 (license)

Dependencies

http, humanizer, json2yaml, json_annotation, json_serializable, yaml

More

Packages that depend on kuberneteslib