[![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?status.svg)](https://godoc.org/github.com/pulumi/pulumi-kubernetes)
[![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, click "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/docs/reference/clouds/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)
* [Tutorials](https://www.pulumi.com/docs/reference/tutorials/kubernetes/)
## 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.0).
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
[reference docs](https://www.pulumi.com/docs/reference/clouds/kubernetes/) for more details.
1. [Install `kubectl`](https://kubernetes.io/docs/tasks/tools/install-kubectl/#install-kubectl).
## Installing
This package is available in JavaScript/TypeScript for use with Node.js, as well as in Python and .NET.
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`.
## 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 as "@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/reference/programming-model/#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.v2.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/reference/programming-model/#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 UR
没有合适的资源?快使用搜索试试~ 我知道了~
Python库 | pulumi_kubernetes-1.1.0a1597424985.tar.gz
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 92 浏览量
2022-04-13
02:37:26
上传
评论
收藏 85KB GZ 举报
温馨提示
共279个文件
py:270个
txt:4个
pkg-info:2个
资源分类:Python库 所属语言:Python 资源全名:pulumi_kubernetes-1.1.0a1597424985.tar.gz 资源来源:官方 安装方法:https://lanzao.blog.csdn.net/article/details/101784059
资源推荐
资源详情
资源评论
收起资源包目录
Python库 | pulumi_kubernetes-1.1.0a1597424985.tar.gz (279个子文件)
setup.cfg 38B
README.md 8KB
not-zip-safe 1B
PKG-INFO 11KB
PKG-INFO 11KB
yaml.py 78KB
tables.py 37KB
helm.py 23KB
helm.py 23KB
Event.py 9KB
Event.py 9KB
StorageClass.py 8KB
StorageClass.py 8KB
RuntimeClass.py 8KB
Secret.py 7KB
PriorityClass.py 7KB
PriorityClass.py 7KB
PriorityClass.py 7KB
Service.py 7KB
ConfigMap.py 7KB
ServiceAccount.py 6KB
EndpointSlice.py 6KB
Deployment.py 6KB
Deployment.py 6KB
Deployment.py 6KB
Deployment.py 6KB
Status.py 6KB
Ingress.py 6KB
Ingress.py 6KB
kustomize.py 6KB
Pod.py 6KB
CSIDriver.py 6KB
Job.py 6KB
ControllerRevision.py 6KB
ControllerRevision.py 6KB
ControllerRevision.py 6KB
Endpoints.py 6KB
CSIDriver.py 6KB
StatefulSet.py 6KB
StatefulSet.py 6KB
StatefulSet.py 6KB
ReplicaSet.py 6KB
ReplicaSet.py 6KB
RoleBinding.py 6KB
RoleBinding.py 6KB
ReplicaSet.py 6KB
ReplicationController.py 6KB
RoleBinding.py 6KB
ClusterRoleBinding.py 5KB
ClusterRoleBinding.py 5KB
ClusterRole.py 5KB
ClusterRole.py 5KB
HorizontalPodAutoscaler.py 5KB
HorizontalPodAutoscaler.py 5KB
RuntimeClass.py 5KB
SelfSubjectRulesReview.py 5KB
SelfSubjectRulesReview.py 5KB
ClusterRoleBinding.py 5KB
ClusterRole.py 5KB
VolumeAttachment.py 5KB
VolumeAttachment.py 5KB
VolumeAttachment.py 5KB
FlowSchema.py 5KB
DaemonSet.py 5KB
DaemonSet.py 5KB
provider.py 5KB
DaemonSet.py 5KB
PersistentVolume.py 5KB
PriorityLevelConfiguration.py 5KB
CronJob.py 5KB
CronJob.py 5KB
LocalSubjectAccessReview.py 5KB
LocalSubjectAccessReview.py 5KB
ValidatingWebhookConfiguration.py 5KB
HorizontalPodAutoscaler.py 5KB
MutatingWebhookConfiguration.py 5KB
CSINode.py 5KB
CSINode.py 5KB
PersistentVolumeClaim.py 5KB
IngressClass.py 5KB
ValidatingWebhookConfiguration.py 5KB
SelfSubjectAccessReview.py 5KB
SelfSubjectAccessReview.py 5KB
MutatingWebhookConfiguration.py 5KB
Namespace.py 5KB
CustomResourceDefinition.py 5KB
Node.py 5KB
ResourceQuota.py 5KB
NetworkPolicy.py 5KB
PersistentVolumeClaimList.py 5KB
PodSecurityPolicy.py 5KB
CustomResourceDefinition.py 5KB
ReplicationControllerList.py 5KB
PriorityLevelConfigurationList.py 5KB
TokenReview.py 5KB
ValidatingWebhookConfigurationList.py 5KB
TokenReview.py 5KB
ValidatingWebhookConfigurationList.py 5KB
PodSecurityPolicy.py 5KB
MutatingWebhookConfigurationList.py 5KB
共 279 条
- 1
- 2
- 3
资源评论
挣扎的蓝藻
- 粉丝: 13w+
- 资源: 15万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功