brave-glass-88708
04/19/2020, 9:05 PMimport * as pulumi from "@pulumi/pulumi";
import * as k8s from "@pulumi/kubernetes";
const config = new pulumi.Config();
const provider = new k8s.Provider("kubernetes", { kubeconfig: config.require("cluster-config") });
const ta = new k8s.core.v1.ServiceAccount("test-account", {
metadata: {
name: "test-account",
namespace: "default"
}
}, { provider });
export const tokenName = pulumi.interpolate `${ta.metadata.namespace}/${ta.secrets[0].name}`
type KubernetesData = { [key: string]: string }
export const token = k8s.core.v1.Secret.get(tokenName, tokenName).data.apply(v => {
return (<KubernetesData>v)["token"]
});
// export const token = k8s.core.v1.Secret.get("default/test-account-token-7rz8w", "default/test-account-token-7rz8w").data.apply(v => {
// return (<KubernetesData>v)["token"]
// });
1. Argument of type 'Output<string>' is not assignable to parameter of type 'string'.ts(2345)
2. Parameter 'v' implicitly has an 'any' type.
however, if i use the call that is commented or this
export const token = k8s.core.v1.Secret.get("harcoded-works", tokenName).data.apply(v => {
return (<KubernetesData>v)["token"]
});
is this here a less verbose method to getting values from one resource and feed it into another?faint-oil-7535
04/19/2020, 11:09 PMhigh-morning-17948
04/20/2020, 1:07 AM.pulumi/ci.json
to use production stack on release tag instead of master branch for Github Actions?clean-autumn-55516
04/20/2020, 2:09 AM"scripts": {
"postinstall": "npx prisma generate"
}
Am I running into a limitation here? Is there a way to have pulumi deploy a function with a custom package.json to achieve a post install script?quick-greece-34196
04/20/2020, 2:32 AMconst k8sProvider = new k8s.Provider(`${prefix}-k8s-provider`, {
kubeconfig: clusterStack.getOutput("kubeConfig"),
});
...
const providers = {
gcp: gcpProvider,
kubernetes: k8sProvider,
}
and then passing it to a component resource:
const externalDNS = new ExternalDNS(
`${prefix}-external-dns`,
{
labels,
domain,
zonePolicy: "sync",
nodeSelector: {
[`${domain}/nodeType`]: "main"
}
},
{ providers },
);
I am getting an error that seems to indicate the provider is wrong ? Any pointers I can use, I am out of ideas...
error: Missing required configuration variable 'customer-services:k8sMasterPassword'
please set a value using the command `pulumi config set customer-services:k8sMasterPassword <value>`
mysterious-australia-14256
04/20/2020, 10:32 AMclean-eve-27532
04/20/2020, 4:04 PMgray-yak-9058
04/20/2020, 4:19 PMplain-businessperson-30883
04/20/2020, 6:07 PMgetOutputSync
was removed and the getOutputValue
was introduced. Is there more info on the changes around it? I see that the …Value
behaves differently from the …Sync
, but I can’t find any docs on that. Since it uses Promises, I believe the result will be different, right? Is there more info about it? Thanks in advance!acceptable-stone-35112
04/20/2020, 8:01 PMfaint-oil-7535
04/20/2020, 9:00 PMlimited-rainbow-51650
04/20/2020, 9:04 PMpulumi.ComponentResource
. In the constructor of this component, I create a gcp.compute.Network
. When unit testing, in the setMocks
function, as in the examples, I do a switch(type)
and I only left the default
clause in there with a console.log
statement. When running the tests, I create an instance of my component. I expect the newResource
callback to be invoked twice but I only see it for my component, not for the inner gcp.compute.Network
. Are my expectations wrong?orange-policeman-59119
04/20/2020, 11:29 PMpulumi login --gcs
in two locations at once and try to deploy the same stack?colossal-room-15708
04/21/2020, 1:23 AMv2.0.0
released now?
pulumi new
warning: A new version of Pulumi is available. To upgrade from version '1.14.1' to '2.0.0', run
$ curl -sSL <https://get.pulumi.com> | sh
prehistoric-account-60014
04/21/2020, 1:51 AM--yes
option. Is this intentional?witty-crayon-40181
04/21/2020, 9:24 AMsome-kitchen-64615
04/21/2020, 9:43 AMstale-minister-93676
04/21/2020, 1:37 PMgetCluster
returns a promise. I'm then trying to use getProject
with cluster id via cluster.then(cluster => cluster.id)
however I get an error saying Error: Promises cannot be passed in as arguments to a data source call.
How am I supposed to get around that?limited-rainbow-51650
04/21/2020, 4:34 PMbrave-angle-33257
04/21/2020, 6:31 PMgetOutputSync
get removed in pulumi 2.0.0 ??stale-minister-93676
04/21/2020, 6:46 PMincalculable-church-62932
04/21/2020, 9:01 PMorange-policeman-59119
04/21/2020, 9:41 PM$NAME
aka istio-citadel
- the name of the resource
• $KIND/$NAME
aka deployment.apps/istio-citadel
- the resource kind and name
• $SPACE/NAME
aka istio-system/istio-citadel
- the namespace and name of the resource (omitting the resource kind)
Non-namespaced resources:
• $NAME
aka istio-citadel
- the name of the resource
• $KIND/$NAME
aka deployment.apps/istio-citadel
- the resource kind and nameorange-policeman-59119
04/21/2020, 9:42 PM{ import: '???' }
on the chart, or do I use per-yaml resource transformations?orange-policeman-59119
04/21/2020, 10:58 PMInput/Output
) value to the import
property? I am able to pass an Input/Output to the metadata.name
and metadata.namespace
into the object args, but I cannot then reference said name and namespace in the import
arg?
2. Is it possible to pass in a value for opts: { import: ??? }
that automatically determines what to import? For Kubernetes resources where the name and namespace are part of the resource itself, that is, for any given object defining { metadata: ObjectMeta }
we can determine the ID deterministically, so having to repeat it seems un-DRY.orange-policeman-59119
04/21/2020, 10:58 PMthousands-byte-82197
04/22/2020, 9:00 AMmammoth-caravan-51104
04/22/2020, 11:36 AMsteep-angle-29984
04/22/2020, 11:41 AMstocky-island-3676
04/22/2020, 2:59 PMenforcementLevel: "advisory"
, directly at the resource? To get this check out of the list of policy violations. Similar like nolint
flags.
2. How can you check if a value is a secret value, i.e. encrypted in the stack? Just read that secrets are unencrypted in policy-pack checks.