pulumi-kubernetes


Namepulumi-kubernetes JSON
Version 4.11.0 PyPI version JSON
download
home_pageNone
SummaryA Pulumi package for creating and managing Kubernetes resources.
upload_time2024-04-18 06:56:08
maintainerNone
docs_urlNone
authorNone
requires_python>=3.8
licenseApache-2.0
keywords pulumi kubernetes category/cloud kind/native
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            [![Build Status](https://travis-ci.com/pulumi/pulumi-kubernetes.svg?token=eHg7Zp5zdDDJfTjY8ejq&branch=master)](https://travis-ci.com/pulumi/pulumi-kubernetes)
[![Slack](http://www.pulumi.com/images/docs/badges/slack.svg)](https://slack.pulumi.com)
[![NPM version](https://badge.fury.io/js/%40pulumi%2Fkubernetes.svg)](https://www.npmjs.com/package/@pulumi/kubernetes)
[![Python version](https://badge.fury.io/py/pulumi-kubernetes.svg)](https://pypi.org/project/pulumi-kubernetes/)
[![GoDoc](https://godoc.org/github.com/pulumi/pulumi-kubernetes/sdk/v4?status.svg)](https://pkg.go.dev/github.com/pulumi/pulumi-kubernetes/sdk/v4)
[![License](https://img.shields.io/github/license/pulumi/pulumi-kubernetes)](https://github.com/pulumi/pulumi-kubernetes/blob/master/LICENSE)

# Pulumi Kubernetes Resource Provider

The Kubernetes resource provider for Pulumi lets you create, deploy, and manage Kubernetes API resources and workloads in a running cluster. For a streamlined Pulumi walkthrough, including language runtime installation and Kubernetes configuration, select "Get Started" below.
<div>
    <p>
        <a href="https://www.pulumi.com/docs/get-started/kubernetes" title="Get Started">
            <img src="https://www.pulumi.com/images/get-started.svg?" width="120">
        </a>
    </p>  
</div>

* [Introduction](#introduction)
  * [Kubernetes API Version Support](#kubernetes-api-version-support)
  * [How does API support for Kubernetes work?](#how-does-api-support-for-kubernetes-work)
* [References](#references)
* [Prerequisites](#prerequisites)
* [Installing](#installing)
* [Quick Examples](#quick-examples)
  * [Deploying a YAML Manifest](#deploying-a-yaml-manifest)
  * [Deploying a Helm Chart](#deploying-a-helm-chart)
  * [Deploying a Workload using the Resource API](#deploying-a-workload-using-the-resource-api)
* [Contributing](#contributing)
* [Code of Conduct](#code-of-conduct)

## Introduction

`pulumi-kubernetes` provides an SDK to create any of the API resources
available in Kubernetes.

This includes the resources you know and love, such as:
- Deployments
- ReplicaSets
- ConfigMaps
- Secrets
- Jobs etc.

#### Kubernetes API Version Support

The `pulumi-kubernetes` SDK closely tracks the latest upstream release, and provides access
to the full API surface, including deprecated endpoints.
The SDK API is 100% compatible with the Kubernetes API, and is
schematically identical to what Kubernetes users expect.

We support Kubernetes clusters with version >=1.9.0.

#### How does API support for Kubernetes work?

Pulumi’s Kubernetes SDK is manufactured by automatically wrapping our
library functionality around the Kubernetes resource [OpenAPI
spec](https://github.com/kubernetes/kubernetes/tree/master/api/openapi-spec) as soon as a
new version is released! Ultimately, this means that Pulumi users do not have
to learn a new Kubernetes API model, nor wait long to work with the latest
available versions.

> Note: Pulumi also supports alpha and beta APIs.

Visit the [FAQ](https://www.pulumi.com/docs/reference/clouds/kubernetes/faq/)
for more details.

## References

* [Reference Documentation](https://www.pulumi.com/registry/packages/kubernetes/)
* API Documentation
    * [Node.js API](https://pulumi.io/reference/pkg/nodejs/@pulumi/kubernetes)
    * [Python API](https://www.pulumi.com/docs/reference/pkg/python/pulumi_kubernetes/)
* [All Examples](./examples)
* [How-to Guides](https://www.pulumi.com/registry/packages/kubernetes/how-to-guides/)

## Prerequisites

1. [Install Pulumi](https://www.pulumi.com/docs/get-started/kubernetes/install-pulumi/).
1. Install a language runtime such as [Node.js](https://nodejs.org/en/download), [Python](https://www.python.org/downloads/) or [.NET](https://dotnet.microsoft.com/download/dotnet-core/3.1).
1. Install a package manager
    * For Node.js, use [NPM](https://www.npmjs.com/get-npm) or [Yarn](https://yarnpkg.com/lang/en/docs/install).
    * For Python, use [pip](https://pip.pypa.io/en/stable/installing/).
    * For .NET, use Nuget which is integrated with the `dotnet` CLI.
1. Have access to a running Kubernetes cluster
    * If `kubectl` already works for your running cluster, Pulumi respects and uses this configuration.
    * If you do not have a cluster already running and available, we encourage you to
      explore Pulumi's SDKs for AWS EKS, Azure AKS, and GCP GKE. Visit the 
      [API reference docs in the Pulumi Registry](https://www.pulumi.com/registry/packages/kubernetes/api-docs/) for more details.
1. [Install `kubectl`](https://kubernetes.io/docs/tasks/tools/install-kubectl/#install-kubectl).

## Installing

This package is available in many languages in the standard packaging formats.

For Node.js use either `npm` or `yarn`:

`npm`:

```bash
npm install @pulumi/kubernetes
```

`yarn`:

```bash
yarn add @pulumi/kubernetes
```

For Python use `pip`:

```bash
pip install pulumi-kubernetes
```

For .NET, dependencies will be automatically installed as part of your Pulumi deployments using `dotnet build`.

To use from Go, use `go install` to grab the latest version of the library

    $ go install github.com/pulumi/pulumi-kubernetes/sdk/v4/go/kubernetes@latest

## Quick Examples

The following examples demonstrate how to work with `pulumi-kubernetes` in
a couple of ways.

Examples may include the creation of an AWS EKS cluster, although an EKS cluster
is **not** required to use `pulumi/kubernetes`. It is simply used to ensure
we have access to a running Kubernetes cluster to deploy resources and workloads into.

### Deploying a YAML Manifest

This example deploys resources from a YAML manifest file path, using the
transient, default `kubeconfig` credentials on the local machine, just as `kubectl` does.

```typescript
import * as k8s from "@pulumi/kubernetes";

const myApp = new k8s.yaml.ConfigFile("app", {
    file: "app.yaml"
});
```

### Deploying a Helm Chart

This example creates an EKS cluster with [`pulumi/eks`](https://github.com/pulumi/pulumi-eks),
and then deploys a Helm chart from the stable repo using the 
`kubeconfig` credentials from the cluster's [Pulumi provider](https://www.pulumi.com/docs/intro/concepts/resources/providers/).

```typescript
import * as eks from "@pulumi/eks";
import * as k8s from "@pulumi/kubernetes";

// Create an EKS cluster.
const cluster = new eks.Cluster("my-cluster");

// Deploy Wordpress into our cluster.
const wordpress = new k8s.helm.v3.Chart("wordpress", {
    repo: "stable",
    chart: "wordpress",
    values: {
        wordpressBlogName: "My Cool Kubernetes Blog!",
    },
}, { providers: { "kubernetes": cluster.provider } });

// Export the cluster's kubeconfig.
export const kubeconfig = cluster.kubeconfig;
```

### Deploying a Workload using the Resource API

This example creates a EKS cluster with [`pulumi/eks`](https://github.com/pulumi/pulumi-eks),
and then deploys an NGINX Deployment and Service using the SDK resource API, and the 
`kubeconfig` credentials from the cluster's [Pulumi provider](https://www.pulumi.com/docs/intro/concepts/resources/providers/).

```typescript
import * as eks from "@pulumi/eks";
import * as k8s from "@pulumi/kubernetes";

// Create an EKS cluster with the default configuration.
const cluster = new eks.Cluster("my-cluster");

// Create a NGINX Deployment and Service.
const appName = "my-app";
const appLabels = { appClass: appName };
const deployment = new k8s.apps.v1.Deployment(`${appName}-dep`, {
    metadata: { labels: appLabels },
    spec: {
        replicas: 2,
        selector: { matchLabels: appLabels },
        template: {
            metadata: { labels: appLabels },
            spec: {
                containers: [{
                    name: appName,
                    image: "nginx",
                    ports: [{ name: "http", containerPort: 80 }]
                }],
            }
        }
    },
}, { provider: cluster.provider });

const service = new k8s.core.v1.Service(`${appName}-svc`, {
    metadata: { labels: appLabels },
    spec: {
        type: "LoadBalancer",
        ports: [{ port: 80, targetPort: "http" }],
        selector: appLabels,
    },
}, { provider: cluster.provider });

// Export the URL for the load balanced service.
export const url = service.status.loadBalancer.ingress[0].hostname;

// Export the cluster's kubeconfig.
export const kubeconfig = cluster.kubeconfig;
```

## Contributing

If you are interested in contributing, please see the [contributing docs][contributing].

## Code of Conduct

You can read the code of conduct [here][code-of-conduct].

[pulumi-kubernetes]: https://github.com/pulumi/pulumi-kubernetes
[contributing]: CONTRIBUTING.md
[code-of-conduct]: CODE-OF-CONDUCT.md
[workload-example]: #deploying-a-workload-on-aws-eks
[how-pulumi-works]: https://www.pulumi.com/docs/intro/concepts/how-pulumi-works

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "pulumi-kubernetes",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": "pulumi, kubernetes, category/cloud, kind/native",
    "author": null,
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/49/18/04790c85963b750cd0465ace53602e2245abfe69e6dc05c009baf46fe5c3/pulumi_kubernetes-4.11.0.tar.gz",
    "platform": null,
    "description": "[![Build Status](https://travis-ci.com/pulumi/pulumi-kubernetes.svg?token=eHg7Zp5zdDDJfTjY8ejq&branch=master)](https://travis-ci.com/pulumi/pulumi-kubernetes)\n[![Slack](http://www.pulumi.com/images/docs/badges/slack.svg)](https://slack.pulumi.com)\n[![NPM version](https://badge.fury.io/js/%40pulumi%2Fkubernetes.svg)](https://www.npmjs.com/package/@pulumi/kubernetes)\n[![Python version](https://badge.fury.io/py/pulumi-kubernetes.svg)](https://pypi.org/project/pulumi-kubernetes/)\n[![GoDoc](https://godoc.org/github.com/pulumi/pulumi-kubernetes/sdk/v4?status.svg)](https://pkg.go.dev/github.com/pulumi/pulumi-kubernetes/sdk/v4)\n[![License](https://img.shields.io/github/license/pulumi/pulumi-kubernetes)](https://github.com/pulumi/pulumi-kubernetes/blob/master/LICENSE)\n\n# Pulumi Kubernetes Resource Provider\n\nThe Kubernetes resource provider for Pulumi lets you create, deploy, and manage Kubernetes API resources and workloads in a running cluster. For a streamlined Pulumi walkthrough, including language runtime installation and Kubernetes configuration, select \"Get Started\" below.\n<div>\n    <p>\n        <a href=\"https://www.pulumi.com/docs/get-started/kubernetes\" title=\"Get Started\">\n            <img src=\"https://www.pulumi.com/images/get-started.svg?\" width=\"120\">\n        </a>\n    </p>  \n</div>\n\n* [Introduction](#introduction)\n  * [Kubernetes API Version Support](#kubernetes-api-version-support)\n  * [How does API support for Kubernetes work?](#how-does-api-support-for-kubernetes-work)\n* [References](#references)\n* [Prerequisites](#prerequisites)\n* [Installing](#installing)\n* [Quick Examples](#quick-examples)\n  * [Deploying a YAML Manifest](#deploying-a-yaml-manifest)\n  * [Deploying a Helm Chart](#deploying-a-helm-chart)\n  * [Deploying a Workload using the Resource API](#deploying-a-workload-using-the-resource-api)\n* [Contributing](#contributing)\n* [Code of Conduct](#code-of-conduct)\n\n## Introduction\n\n`pulumi-kubernetes` provides an SDK to create any of the API resources\navailable in Kubernetes.\n\nThis includes the resources you know and love, such as:\n- Deployments\n- ReplicaSets\n- ConfigMaps\n- Secrets\n- Jobs etc.\n\n#### Kubernetes API Version Support\n\nThe `pulumi-kubernetes` SDK closely tracks the latest upstream release, and provides access\nto the full API surface, including deprecated endpoints.\nThe SDK API is 100% compatible with the Kubernetes API, and is\nschematically identical to what Kubernetes users expect.\n\nWe support Kubernetes clusters with version >=1.9.0.\n\n#### How does API support for Kubernetes work?\n\nPulumi\u2019s Kubernetes SDK is manufactured by automatically wrapping our\nlibrary functionality around the Kubernetes resource [OpenAPI\nspec](https://github.com/kubernetes/kubernetes/tree/master/api/openapi-spec) as soon as a\nnew version is released! Ultimately, this means that Pulumi users do not have\nto learn a new Kubernetes API model, nor wait long to work with the latest\navailable versions.\n\n> Note: Pulumi also supports alpha and beta APIs.\n\nVisit the [FAQ](https://www.pulumi.com/docs/reference/clouds/kubernetes/faq/)\nfor more details.\n\n## References\n\n* [Reference Documentation](https://www.pulumi.com/registry/packages/kubernetes/)\n* API Documentation\n    * [Node.js API](https://pulumi.io/reference/pkg/nodejs/@pulumi/kubernetes)\n    * [Python API](https://www.pulumi.com/docs/reference/pkg/python/pulumi_kubernetes/)\n* [All Examples](./examples)\n* [How-to Guides](https://www.pulumi.com/registry/packages/kubernetes/how-to-guides/)\n\n## Prerequisites\n\n1. [Install Pulumi](https://www.pulumi.com/docs/get-started/kubernetes/install-pulumi/).\n1. Install a language runtime such as [Node.js](https://nodejs.org/en/download), [Python](https://www.python.org/downloads/) or [.NET](https://dotnet.microsoft.com/download/dotnet-core/3.1).\n1. Install a package manager\n    * For Node.js, use [NPM](https://www.npmjs.com/get-npm) or [Yarn](https://yarnpkg.com/lang/en/docs/install).\n    * For Python, use [pip](https://pip.pypa.io/en/stable/installing/).\n    * For .NET, use Nuget which is integrated with the `dotnet` CLI.\n1. Have access to a running Kubernetes cluster\n    * If `kubectl` already works for your running cluster, Pulumi respects and uses this configuration.\n    * If you do not have a cluster already running and available, we encourage you to\n      explore Pulumi's SDKs for AWS EKS, Azure AKS, and GCP GKE. Visit the \n      [API reference docs in the Pulumi Registry](https://www.pulumi.com/registry/packages/kubernetes/api-docs/) for more details.\n1. [Install `kubectl`](https://kubernetes.io/docs/tasks/tools/install-kubectl/#install-kubectl).\n\n## Installing\n\nThis package is available in many languages in the standard packaging formats.\n\nFor Node.js use either `npm` or `yarn`:\n\n`npm`:\n\n```bash\nnpm install @pulumi/kubernetes\n```\n\n`yarn`:\n\n```bash\nyarn add @pulumi/kubernetes\n```\n\nFor Python use `pip`:\n\n```bash\npip install pulumi-kubernetes\n```\n\nFor .NET, dependencies will be automatically installed as part of your Pulumi deployments using `dotnet build`.\n\nTo use from Go, use `go install` to grab the latest version of the library\n\n    $ go install github.com/pulumi/pulumi-kubernetes/sdk/v4/go/kubernetes@latest\n\n## Quick Examples\n\nThe following examples demonstrate how to work with `pulumi-kubernetes` in\na couple of ways.\n\nExamples may include the creation of an AWS EKS cluster, although an EKS cluster\nis **not** required to use `pulumi/kubernetes`. It is simply used to ensure\nwe have access to a running Kubernetes cluster to deploy resources and workloads into.\n\n### Deploying a YAML Manifest\n\nThis example deploys resources from a YAML manifest file path, using the\ntransient, default `kubeconfig` credentials on the local machine, just as `kubectl` does.\n\n```typescript\nimport * as k8s from \"@pulumi/kubernetes\";\n\nconst myApp = new k8s.yaml.ConfigFile(\"app\", {\n    file: \"app.yaml\"\n});\n```\n\n### Deploying a Helm Chart\n\nThis example creates an EKS cluster with [`pulumi/eks`](https://github.com/pulumi/pulumi-eks),\nand then deploys a Helm chart from the stable repo using the \n`kubeconfig` credentials from the cluster's [Pulumi provider](https://www.pulumi.com/docs/intro/concepts/resources/providers/).\n\n```typescript\nimport * as eks from \"@pulumi/eks\";\nimport * as k8s from \"@pulumi/kubernetes\";\n\n// Create an EKS cluster.\nconst cluster = new eks.Cluster(\"my-cluster\");\n\n// Deploy Wordpress into our cluster.\nconst wordpress = new k8s.helm.v3.Chart(\"wordpress\", {\n    repo: \"stable\",\n    chart: \"wordpress\",\n    values: {\n        wordpressBlogName: \"My Cool Kubernetes Blog!\",\n    },\n}, { providers: { \"kubernetes\": cluster.provider } });\n\n// Export the cluster's kubeconfig.\nexport const kubeconfig = cluster.kubeconfig;\n```\n\n### Deploying a Workload using the Resource API\n\nThis example creates a EKS cluster with [`pulumi/eks`](https://github.com/pulumi/pulumi-eks),\nand then deploys an NGINX Deployment and Service using the SDK resource API, and the \n`kubeconfig` credentials from the cluster's [Pulumi provider](https://www.pulumi.com/docs/intro/concepts/resources/providers/).\n\n```typescript\nimport * as eks from \"@pulumi/eks\";\nimport * as k8s from \"@pulumi/kubernetes\";\n\n// Create an EKS cluster with the default configuration.\nconst cluster = new eks.Cluster(\"my-cluster\");\n\n// Create a NGINX Deployment and Service.\nconst appName = \"my-app\";\nconst appLabels = { appClass: appName };\nconst deployment = new k8s.apps.v1.Deployment(`${appName}-dep`, {\n    metadata: { labels: appLabels },\n    spec: {\n        replicas: 2,\n        selector: { matchLabels: appLabels },\n        template: {\n            metadata: { labels: appLabels },\n            spec: {\n                containers: [{\n                    name: appName,\n                    image: \"nginx\",\n                    ports: [{ name: \"http\", containerPort: 80 }]\n                }],\n            }\n        }\n    },\n}, { provider: cluster.provider });\n\nconst service = new k8s.core.v1.Service(`${appName}-svc`, {\n    metadata: { labels: appLabels },\n    spec: {\n        type: \"LoadBalancer\",\n        ports: [{ port: 80, targetPort: \"http\" }],\n        selector: appLabels,\n    },\n}, { provider: cluster.provider });\n\n// Export the URL for the load balanced service.\nexport const url = service.status.loadBalancer.ingress[0].hostname;\n\n// Export the cluster's kubeconfig.\nexport const kubeconfig = cluster.kubeconfig;\n```\n\n## Contributing\n\nIf you are interested in contributing, please see the [contributing docs][contributing].\n\n## Code of Conduct\n\nYou can read the code of conduct [here][code-of-conduct].\n\n[pulumi-kubernetes]: https://github.com/pulumi/pulumi-kubernetes\n[contributing]: CONTRIBUTING.md\n[code-of-conduct]: CODE-OF-CONDUCT.md\n[workload-example]: #deploying-a-workload-on-aws-eks\n[how-pulumi-works]: https://www.pulumi.com/docs/intro/concepts/how-pulumi-works\n",
    "bugtrack_url": null,
    "license": "Apache-2.0",
    "summary": "A Pulumi package for creating and managing Kubernetes resources.",
    "version": "4.11.0",
    "project_urls": {
        "Homepage": "https://pulumi.com",
        "Repository": "https://github.com/pulumi/pulumi-kubernetes"
    },
    "split_keywords": [
        "pulumi",
        " kubernetes",
        " category/cloud",
        " kind/native"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "38d4b0f78370220a32165f32c668ebad88d351fbd38032e936d34a00877d63e8",
                "md5": "52e79194cf7a0df080774b70d4212061",
                "sha256": "74fd224b34f3067367ec346ed7615476aa09ad9722c6ad391419d94c87a57280"
            },
            "downloads": -1,
            "filename": "pulumi_kubernetes-4.11.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "52e79194cf7a0df080774b70d4212061",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 2218269,
            "upload_time": "2024-04-18T06:55:54",
            "upload_time_iso_8601": "2024-04-18T06:55:54.012785Z",
            "url": "https://files.pythonhosted.org/packages/38/d4/b0f78370220a32165f32c668ebad88d351fbd38032e936d34a00877d63e8/pulumi_kubernetes-4.11.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "491804790c85963b750cd0465ace53602e2245abfe69e6dc05c009baf46fe5c3",
                "md5": "2584c1e86d59e2964a4c7964bd8375a2",
                "sha256": "0bec80a5c9538fa7bbdbf11b8d65573e9f95b12b50a944b1486a8cea3bba8d41"
            },
            "downloads": -1,
            "filename": "pulumi_kubernetes-4.11.0.tar.gz",
            "has_sig": false,
            "md5_digest": "2584c1e86d59e2964a4c7964bd8375a2",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 1385815,
            "upload_time": "2024-04-18T06:56:08",
            "upload_time_iso_8601": "2024-04-18T06:56:08.108684Z",
            "url": "https://files.pythonhosted.org/packages/49/18/04790c85963b750cd0465ace53602e2245abfe69e6dc05c009baf46fe5c3/pulumi_kubernetes-4.11.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-04-18 06:56:08",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "pulumi",
    "github_project": "pulumi-kubernetes",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "pulumi-kubernetes"
}
        
Elapsed time: 0.26656s