Skip to content

Instantly share code, notes, and snippets.

@donovanmuller
Created April 1, 2020 13:23
Show Gist options
  • Save donovanmuller/362e3969fa84d686518174efede5d0ba to your computer and use it in GitHub Desktop.
Save donovanmuller/362e3969fa84d686518174efede5d0ba to your computer and use it in GitHub Desktop.
import * as k8s from "@pulumi/kubernetes";
import {CustomResource} from "@pulumi/kubernetes/apiextensions";
// Install the ECK operator
new k8s.yaml.ConfigGroup("eck-operator", {
files: "https://download.elastic.co/downloads/eck/1.0.1/all-in-one.yaml",
});
// create a new Elasticsearch instance
const elastic = new CustomResource("test-elastic", {
apiVersion: "elasticsearch.k8s.elastic.co/v1",
kind: "Elasticsearch",
metadata: {
name: "test"
},
spec: {
version: "7.5.2",
nodeSets: [{
name: "default",
count: 1,
}]
}
});
// reference the Secret created for the `test` Elasticsearch cluster
const elasticUser = new k8s.core.v1.Secret(
"test-es-elastic-user", {
metadata: {
name: "test-es-elastic-user"
}
}, {
import: "default/test-es-elastic-user",
dependsOn: elastic
});
export const elasticPassword = elasticUser.data;
@donovanmuller
Copy link
Author

pulumi-custom-resources

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment