|
5 | 5 | KubernetesJS CLI |
6 | 6 | </p> |
7 | 7 |
|
8 | | -## install |
| 8 | +A command-line interface for interacting with Kubernetes clusters, built with TypeScript. |
| 9 | + |
| 10 | +## Installation |
| 11 | + |
| 12 | +```sh |
| 13 | +npm install -g @kubernetesjs/cli |
| 14 | +``` |
| 15 | + |
| 16 | +## Usage |
| 17 | + |
| 18 | +The CLI provides several commands for managing Kubernetes resources. You can use either `k8s` or `kubernetes` as the command prefix: |
| 19 | + |
| 20 | +```sh |
| 21 | +k8s <command> [options] |
| 22 | +# or |
| 23 | +kubernetes <command> [options] |
| 24 | +``` |
| 25 | + |
| 26 | +Options: |
| 27 | +- `--client-url`: Kubernetes API server URL (default: http://localhost:8001) |
| 28 | + |
| 29 | + |
| 30 | +### Available Commands |
| 31 | + |
| 32 | +#### Get |
| 33 | +Retrieve information about Kubernetes resources. |
| 34 | + |
| 35 | +```sh |
| 36 | +k8s get <resource> [options] |
| 37 | +``` |
| 38 | + |
| 39 | +#### Apply |
| 40 | +Apply configurations to your Kubernetes cluster. |
| 41 | + |
| 42 | +```sh |
| 43 | +k8s apply -f <file> [options] |
| 44 | +``` |
| 45 | + |
| 46 | +#### Delete |
| 47 | +Delete resources from your Kubernetes cluster. |
| 48 | + |
| 49 | +```sh |
| 50 | +k8s delete <resource> <name> [options] |
| 51 | +``` |
| 52 | + |
| 53 | +#### Describe |
| 54 | +Show detailed information about a specific resource. |
| 55 | + |
| 56 | +```sh |
| 57 | +k8s describe <resource> <name> [options] |
| 58 | +``` |
| 59 | + |
| 60 | +#### Logs |
| 61 | +View logs from pods. |
| 62 | + |
| 63 | +```sh |
| 64 | +k8s logs <pod-name> [options] |
| 65 | +``` |
| 66 | + |
| 67 | +#### Port Forward |
| 68 | +Forward ports from pods to your local machine. |
| 69 | + |
| 70 | +```sh |
| 71 | +k8s port-forward <pod-name> <local-port>:<pod-port> [options] |
| 72 | +``` |
| 73 | + |
| 74 | +#### Exec |
| 75 | +Execute commands in a container. |
| 76 | + |
| 77 | +```sh |
| 78 | +k8s exec <pod-name> -- <command> [options] |
| 79 | +``` |
| 80 | + |
| 81 | +#### Cluster Info |
| 82 | +Display information about the current cluster. |
| 83 | + |
| 84 | +```sh |
| 85 | +k8s cluster-info |
| 86 | +``` |
| 87 | + |
| 88 | +#### Config |
| 89 | +Manage Kubernetes configuration. |
| 90 | + |
| 91 | +```sh |
| 92 | +k8s config [options] |
| 93 | +``` |
| 94 | + |
| 95 | +## Examples |
| 96 | + |
| 97 | +### Get Pod Information |
| 98 | + |
| 99 | +```sh |
| 100 | +k8s get pods |
| 101 | +``` |
| 102 | + |
| 103 | +### Apply a Configuration File |
| 104 | + |
| 105 | +```sh |
| 106 | +k8s apply -f deployment.yaml |
| 107 | +``` |
| 108 | + |
| 109 | +### View Pod Logs |
| 110 | + |
| 111 | +```sh |
| 112 | +k8s logs my-pod |
| 113 | +``` |
| 114 | + |
| 115 | +### Port Forward to a Service |
9 | 116 |
|
10 | 117 | ```sh |
11 | | -npm install cli |
| 118 | +k8s port-forward my-pod 8080:80 |
12 | 119 | ``` |
13 | | -## Table of contents |
14 | 120 |
|
15 | | -- [cli](#cli) |
16 | | - - [Install](#install) |
17 | | - - [Table of contents](#table-of-contents) |
18 | | -- [Developing](#developing) |
19 | | -- [Credits](#credits) |
| 121 | +## Configuration |
20 | 122 |
|
21 | | -## Developing |
| 123 | +The CLI uses the default Kubernetes configuration from `~/.kube/config`. You can specify a different configuration file using the `--kubeconfig` option. |
| 124 | + |
| 125 | +## Development |
22 | 126 |
|
23 | 127 | When first cloning the repo: |
24 | 128 |
|
25 | 129 | ```sh |
26 | 130 | yarn |
27 | | -# build the prod packages. When devs would like to navigate to the source code, this will only navigate from references to their definitions (.d.ts files) between packages. |
| 131 | +# Build the production packages |
28 | 132 | yarn build |
29 | 133 | ``` |
30 | 134 |
|
31 | | -Or if you want to make your dev process smoother, you can run: |
| 135 | +For development with source maps: |
32 | 136 |
|
33 | 137 | ```sh |
34 | 138 | yarn |
35 | | -# build the dev packages with .map files, this enables navigation from references to their source code between packages. |
| 139 | +# Build with source maps for better debugging |
36 | 140 | yarn build:dev |
37 | 141 | ``` |
38 | 142 |
|
39 | | -## Interchain JavaScript Stack |
| 143 | +## Related |
40 | 144 |
|
41 | | -A unified toolkit for building applications and smart contracts in the Interchain ecosystem ⚛️ |
| 145 | +Checkout these related projects: |
42 | 146 |
|
43 | | -| Category | Tools | Description | |
44 | | -|----------------------|------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------| |
45 | | -| **Chain Information** | [**Chain Registry**](https://github.com/hyperweb-io/chain-registry), [**Utils**](https://www.npmjs.com/package/@chain-registry/utils), [**Client**](https://www.npmjs.com/package/@chain-registry/client) | Everything from token symbols, logos, and IBC denominations for all assets you want to support in your application. | |
46 | | -| **Wallet Connectors**| [**Interchain Kit**](https://github.com/hyperweb-io/interchain-kit)<sup>beta</sup>, [**Cosmos Kit**](https://github.com/hyperweb-io/cosmos-kit) | Experience the convenience of connecting with a variety of web3 wallets through a single, streamlined interface. | |
47 | | -| **Signing Clients** | [**InterchainJS**](https://github.com/hyperweb-io/interchainjs)<sup>beta</sup>, [**CosmJS**](https://github.com/cosmos/cosmjs) | A single, universal signing interface for any network | |
48 | | -| **SDK Clients** | [**Telescope**](https://github.com/hyperweb-io/telescope) | Your Frontend Companion for Building with TypeScript with Cosmos SDK Modules. | |
49 | | -| **Starter Kits** | [**Create Interchain App**](https://github.com/hyperweb-io/create-interchain-app)<sup>beta</sup>, [**Create Cosmos App**](https://github.com/hyperweb-io/create-cosmos-app) | Set up a modern Interchain app by running one command. | |
50 | | -| **UI Kits** | [**Interchain UI**](https://github.com/hyperweb-io/interchain-ui) | The Interchain Design System, empowering developers with a flexible, easy-to-use UI kit. | |
51 | | -| **Testing Frameworks** | [**Starship**](https://github.com/hyperweb-io/starship) | Unified Testing and Development for the Interchain. | |
52 | | -| **TypeScript Smart Contracts** | [**Create Hyperweb App**](https://github.com/hyperweb-io/create-hyperweb-app) | Build and deploy full-stack blockchain applications with TypeScript | |
53 | | -| **CosmWasm Contracts** | [**CosmWasm TS Codegen**](https://github.com/CosmWasm/ts-codegen) | Convert your CosmWasm smart contracts into dev-friendly TypeScript classes. | |
| 147 | +* [`schema-typescript`](https://github.com/hyperweb-io/schema-typescript/tree/main/packages/schema-typescript) |
| 148 | + Provides robust tools for handling JSON schemas and converting them to TypeScript interfaces with ease and efficiency. |
| 149 | +* [`@schema-typescript/cli`](https://github.com/hyperweb-io/schema-typescript/tree/main/packages/cli) |
| 150 | + CLI is the command line utility for `schema-typescript`. |
| 151 | +* [`schema-sdk`](https://github.com/hyperweb-io/schema-typescript/tree/main/packages/schema-sdk) |
| 152 | + Provides robust tools for handling OpenAPI schemas and converting them to TypeScript clients with ease and efficiency. |
| 153 | +* [`starship`](https://github.com/hyperweb-io/starship) Unified Testing and Development for the Interchain. |
54 | 154 |
|
55 | 155 | ## Credits |
56 | 156 |
|
57 | | -🛠 Built by Hyperweb (formerly Cosmology) — if you like our tools, please checkout and contribute to [our github ⚛️](https://github.com/hyperweb-io) |
58 | | - |
| 157 | +🛠 Built by Hyperweb — if you like our tools, please checkout and contribute to [our github ⚛️](https://github.com/hyperweb-io) |
59 | 158 |
|
60 | 159 | ## Disclaimer |
61 | 160 |
|
|
0 commit comments