add cronjobs and jobs to k8s backend
Signed-off-by: Andrew Tran <atran@brex.com>
This commit is contained in:
@@ -16,6 +16,7 @@
|
||||
|
||||
import {
|
||||
AppsV1Api,
|
||||
BatchV1Api,
|
||||
AutoscalingV1Api,
|
||||
CoreV1Api,
|
||||
KubeConfig,
|
||||
@@ -74,6 +75,12 @@ export class KubernetesClientProvider {
|
||||
return kc.makeApiClient(AutoscalingV1Api);
|
||||
}
|
||||
|
||||
getBatchClientByClusterDetails(clusterDetails: ClusterDetails) {
|
||||
const kc = this.getKubeConfig(clusterDetails);
|
||||
|
||||
return kc.makeApiClient(BatchV1Api);
|
||||
}
|
||||
|
||||
getNetworkingBeta1Client(clusterDetails: ClusterDetails) {
|
||||
const kc = this.getKubeConfig(clusterDetails);
|
||||
|
||||
|
||||
@@ -68,6 +68,18 @@ export const DEFAULT_OBJECTS: ObjectToFetch[] = [
|
||||
plural: 'horizontalpodautoscalers',
|
||||
objectType: 'horizontalpodautoscalers',
|
||||
},
|
||||
{
|
||||
group: 'batch',
|
||||
apiVersion: 'v1',
|
||||
plural: 'jobs',
|
||||
objectType: 'jobs',
|
||||
},
|
||||
{
|
||||
group: 'batch',
|
||||
apiVersion: 'v1',
|
||||
plural: 'cronjobs',
|
||||
objectType: 'cronjobs',
|
||||
},
|
||||
{
|
||||
group: 'networking.k8s.io',
|
||||
apiVersion: 'v1',
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
import {
|
||||
AppsV1Api,
|
||||
AutoscalingV1Api,
|
||||
BatchV1Api,
|
||||
CoreV1Api,
|
||||
NetworkingV1beta1Api,
|
||||
} from '@kubernetes/client-node';
|
||||
@@ -41,6 +42,7 @@ export interface Clients {
|
||||
core: CoreV1Api;
|
||||
apps: AppsV1Api;
|
||||
autoscaling: AutoscalingV1Api;
|
||||
batch: BatchV1Api;
|
||||
networkingBeta1: NetworkingV1beta1Api;
|
||||
}
|
||||
|
||||
|
||||
@@ -67,6 +67,8 @@ export type KubernetesObjectTypes =
|
||||
| 'deployments'
|
||||
| 'replicasets'
|
||||
| 'horizontalpodautoscalers'
|
||||
| 'jobs'
|
||||
| 'cronjobs'
|
||||
| 'ingresses'
|
||||
| 'customresources';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user