@upcloud/pulumi-upcloud
Version:
A Pulumi package for creating and managing UpCloud resources.
106 lines • 3.99 kB
JavaScript
;
// *** WARNING: this file was generated by pulumi-language-nodejs. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
Object.defineProperty(exports, "__esModule", { value: true });
exports.getKubernetesClusterOutput = exports.getKubernetesCluster = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as kubernetes from "@pulumi/kubernetes";
* import * as local from "@pulumi/local";
* import * as upcloud from "@upcloud/pulumi-upcloud";
*
* // Use Kubernetes provider to access your Kubernetes cluster
* // Create a network for the Kubernetes cluster
* const exampleNetwork = new upcloud.Network("example", {
* name: "example-network",
* zone: "de-fra1",
* ipNetwork: {
* address: "172.16.1.0/24",
* dhcp: true,
* family: "IPv4",
* },
* });
* // Create a Kubernetes cluster
* const exampleKubernetesCluster = new upcloud.KubernetesCluster("example", {
* controlPlaneIpFilters: ["0.0.0.0/0"],
* name: "exampleapp",
* network: exampleNetwork.id,
* zone: "de-fra1",
* });
* // Read the details of the newly created cluster
* const example = upcloud.getKubernetesClusterOutput({
* id: exampleKubernetesCluster.id,
* });
* // Use the Kubernetes provider resources to interact with the cluster
* const exampleNamespace = new kubernetes.index.Namespace("example", {metadata: [{
* name: "example-namespace",
* }]});
* // In addition, write the kubeconfig to a file to interact with the cluster with `kubectl` or other clients
* const exampleFile = new local.index.File("example", {
* content: example.kubeconfig,
* filename: "example.conf",
* });
* ```
*/
function getKubernetesCluster(args, opts) {
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts || {});
return pulumi.runtime.invoke("upcloud:index/getKubernetesCluster:getKubernetesCluster", {
"id": args.id,
}, opts);
}
exports.getKubernetesCluster = getKubernetesCluster;
/**
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as kubernetes from "@pulumi/kubernetes";
* import * as local from "@pulumi/local";
* import * as upcloud from "@upcloud/pulumi-upcloud";
*
* // Use Kubernetes provider to access your Kubernetes cluster
* // Create a network for the Kubernetes cluster
* const exampleNetwork = new upcloud.Network("example", {
* name: "example-network",
* zone: "de-fra1",
* ipNetwork: {
* address: "172.16.1.0/24",
* dhcp: true,
* family: "IPv4",
* },
* });
* // Create a Kubernetes cluster
* const exampleKubernetesCluster = new upcloud.KubernetesCluster("example", {
* controlPlaneIpFilters: ["0.0.0.0/0"],
* name: "exampleapp",
* network: exampleNetwork.id,
* zone: "de-fra1",
* });
* // Read the details of the newly created cluster
* const example = upcloud.getKubernetesClusterOutput({
* id: exampleKubernetesCluster.id,
* });
* // Use the Kubernetes provider resources to interact with the cluster
* const exampleNamespace = new kubernetes.index.Namespace("example", {metadata: [{
* name: "example-namespace",
* }]});
* // In addition, write the kubeconfig to a file to interact with the cluster with `kubectl` or other clients
* const exampleFile = new local.index.File("example", {
* content: example.kubeconfig,
* filename: "example.conf",
* });
* ```
*/
function getKubernetesClusterOutput(args, opts) {
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts || {});
return pulumi.runtime.invokeOutput("upcloud:index/getKubernetesCluster:getKubernetesCluster", {
"id": args.id,
}, opts);
}
exports.getKubernetesClusterOutput = getKubernetesClusterOutput;
//# sourceMappingURL=getKubernetesCluster.js.map