# @janus-idp/backstage-scaffolder-backend-module-kubernetes

> The kubernetes module for @backstage/plugin-scaffolder-backend

Latest version **2.3.0** (published 2024-12-04) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install @janus-idp/backstage-scaffolder-backend-module-kubernetes
pnpm add @janus-idp/backstage-scaffolder-backend-module-kubernetes
yarn add @janus-idp/backstage-scaffolder-backend-module-kubernetes
bun add @janus-idp/backstage-scaffolder-backend-module-kubernetes
```

## Health

**Score 50/100 (C)** — status: stable.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: stale.

## Facts

| | |
|---|---|
| Version | 2.3.0 |
| Published | 2024-12-04 |
| First published | 2023-05-31 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 4 |
| Unpacked size | 25.7 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 163 |
| Author | The Backstage Community |
| Maintainers | ktsao, schultzp2020, tumido, tomaskral, asoro-rh, fndlovu, nickboldt, pataknight |
| Keywords | support:tech-preview, lifecycle:active, backstage, backend-plugin-module |

## Links

- npm: https://www.npmjs.com/package/@janus-idp/backstage-scaffolder-backend-module-kubernetes
- Repository: https://github.com/janus-idp/backstage-plugins
- Homepage: https://red.ht/rhdh
- Issues: https://github.com/janus-idp/backstage-plugins/issues
- npm.io page: https://npm.io/package/@janus-idp/backstage-scaffolder-backend-module-kubernetes

## Dependencies (4)

- [@kubernetes/client-node](https://npm.io/package/@kubernetes/client-node.md) ^0.22.1
- [@backstage/catalog-client](https://npm.io/package/@backstage/catalog-client.md) ^1.7.1
- [@backstage/backend-plugin-api](https://npm.io/package/@backstage/backend-plugin-api.md) ^1.0.1
- [@backstage/plugin-scaffolder-node](https://npm.io/package/@backstage/plugin-scaffolder-node.md) ^0.5.0

## Recent versions

- 2.3.0 (latest) — 2024-12-04
- 1.7.4 — 2024-11-25
- 1.4.16 — 2024-11-14
- 2.2.1 — 2024-11-04
- 1.7.3 — 2024-10-31
- 2.2.0 — 2024-10-30
- 2.1.2 — 2024-10-29
- 2.1.0 — 2024-10-22
- 1.4.15 — 2024-10-11
- 2.0.3 — 2024-10-11
- 2.0.2 — 2024-10-09
- 2.0.1 — 2024-10-08
- 2.0.0 — 2024-10-02
- 1.8.2 — 2024-10-01
- 1.8.1 — 2024-09-25
- … 51 more at https://npm.io/package/@janus-idp/backstage-scaffolder-backend-module-kubernetes/versions

## README

# Kubernetes actions for Backstage

This module provides [Backstage](https://backstage.io/) template [actions](https://backstage.io/docs/features/software-templates/builtin-actions) for [Kubernetes](https://kubernetes.io/docs/home/).

The following actions are currently supported in this module:

- Create a kubernetes namespace

## Installation

Run the following command to install the action package in your Backstage project

```bash
yarn workspace backend add @janus-idp/backstage-scaffolder-backend-module-kubernetes
```

### Installing the action on the backend

Add the following to your `packages/backend/src/index.ts` file:

```ts title="packages/backend/src/index.ts"
const backend = createBackend();

// Add the following line
backend.add(
  import('@janus-idp/backstage-scaffolder-backend-module-kubernetes'),
);

backend.start();
```

## Configuration

Add the Kubernetes actions to your templates, see the [example](./examples/templates/01-kubernetes-template.yaml) file in this repository for complete usage examples

```yaml
action: kubernetes:create-namespace
id: create-kubernetes-namespace
name: Create kubernetes namespace
input:
  namespace: foo
  clusterRef: bar
  token: TOKEN
  skipTLSVerify: false
  caData: Zm9v
  labels: app.io/type=ns; app.io/managed-by=org;
```

## Usage

### Action: kubernetes:create-namespace

#### Input

| Parameter Name |  Type   | Required | Description                                         | Example                                |
| -------------- | :-----: | :------: | --------------------------------------------------- | -------------------------------------- |
| namespace      | string  |   Yes    | Kubernetes namespace name                           | foo                                    |
| clusterRef     | string  |    No    | Cluster resource entity reference from the catalog  | bar                                    |
| url            | string  |    No    | API url of the kubernetes cluster                   | <https://api.foo.redhat.com:6443>      |
| token          | string  |    No    | Kubernetes API bearer token used for authentication |                                        |
| skipTLSVerify  | boolean |    No    | If true, certificate verification is skipped        | false                                  |
| caData         | string  |    No    | Base64 encoded certificate data                     |                                        |
| label          | string  |    No    | Labels that will be applied to the namespace        | app.io/type=ns; app.io/managed-by=org; |

#### Output

This action doesn't have any outputs.

---
_Source: https://npm.io/package/@janus-idp/backstage-scaffolder-backend-module-kubernetes · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
