0.8.5 • Published 2 years ago

@nestcloud2/kubernetes v0.8.5

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

NestCloud - Kubernetes

Description

The kubernetes client module for nestcloud.

Installation

$ npm install --save @nestcloud2/kubernetes

Usage

Use External Cluster

import { Module } from '@nestjs/common';
import { KubernetesModule } from '@nestcloud2/kubernetes';

@Module({
    imports: [KubernetesModule.forRoot({ kubeConfig: '/root/.kube/config' })],
})
export class AppModule {}

Use Internal Cluster

import { Module } from '@nestjs/common';
import { KubernetesModule } from '@nestcloud2/kubernetes';

@Module({
    imports: [KubernetesModule.forRoot()],
})
export class AppModule {}

Use Client

import { Injectable, IKubernetes } from '@nestjs/common';
import { InjectKubernetes } from '@nestcloud2/kubernetes';

@Injectable()
export class TestService {
    constructor(@InjectKubernetes() private readonly client: IKubernetes) {}

    async getConfigMaps() {
        const namespace = 'default';
        const configMap = 'test-configmap';
        const result = await this.client.api.v1
            .namespaces(namespace)
            .configmaps(configMap)
            .get();
        console.log(result);
    }
}

Stay in touch

License

NestCloud is MIT licensed.

0.9.1

2 years ago

0.9.1-rc.0

2 years ago

0.8.5

2 years ago

0.8.3

2 years ago

0.8.0

2 years ago

0.7.21

2 years ago

0.7.20

2 years ago