mysterious-piano-88140
09/18/2021, 8:53 AMbroad-kilobyte-43768
09/18/2021, 8:55 PMpulumi up
locally it works, but it fails with this error whenever the provider is used on my GitHub action.
THING creating error: configured Kubernetes cluster is unreachable: unable to load Kubernetes client configuration from kubeconfig file: invalid configuration: no configuration has been provided
This is my infra code on a repo called "api"
const sharedInfrastructure = new pulumi.StackReference(sharedInfraStackName)
const provider = new k8s.Provider('k8s', {
kubeconfig: sharedInfrastructure.getOutput('kubeConfig'),
})
// use provider...
Action
name: Infrastructure push
on:
push:
branches:
- main
paths:
- 'infrastructure/**'
jobs:
apply:
name: Apply infrastructure
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 14.x
- run: cd infrastructure && npm install
- uses: pulumi/actions@v3
with:
command: up
stack-name: dev
work-dir: ./infrastructure
env:
PULUMI_ACCESS_TOKEN: ${{ secrets.PULUMI_ACCESS_TOKEN }}
DIGITALOCEAN_TOKEN: ${{ secrets.DIGITALOCEAN_TOKEN }}
Here's how I create my kubernetes cluster in another shared infra repo:
import * as digitalocean from '@pulumi/digitalocean'
import * as k8s from '@pulumi/kubernetes'
const cluster = new digitalocean.KubernetesCluster('cluster', {
region: digitalocean.Region.LON1,
version: 'latest',
nodePool: {
name: 'default',
size: digitalocean.DropletSlug.DropletS2VCPU2GB,
nodeCount: 1,
},
})
export const kubeConfig = cluster.kubeConfigs[0].rawConfig
Does anyone have any tips to solve this?crooked-pillow-11944
09/19/2021, 12:15 PMfuture-window-78560
09/19/2021, 9:20 PMsalmon-printer-16080
09/19/2021, 9:53 PMhandsome-state-59775
09/20/2021, 6:02 AMpulumi config refresh
puts the refreshed stack config file in my home directory instead of the current directory that also has the current config and Pulumi.yaml. What can I do to fix this?salmon-guitar-84472
09/20/2021, 7:30 AMred-football-97286
09/20/2021, 9:23 AMpulumi imports
work? Getting an issue trying to import a WAFv2 using Go.handsome-state-59775
09/20/2021, 9:30 AMpulumi config --show-secrets --stack ...
into a selected stack?average-ability-11166
09/20/2021, 3:33 PMred-kangaroo-44125
09/20/2021, 4:53 PMDiagnostics:
pulumi:pulumi:Stack (strapi-strapi-kubernetes):
error: Program failed with an unhandled exception:
error: Traceback (most recent call last):
File "/home/dishant/.pulumi/bin/pulumi-language-python-exec", line 92, in <module>
loop.run_until_complete(coro)
File "/usr/lib64/python3.9/asyncio/base_events.py", line 642, in run_until_complete
return future.result()
File "/home/dishant/Projects/cloud-poc/infrastructure/stacks/strapi/venv/lib64/python3.9/site-packages/pulumi/runtime/stack.py", line 110, in run_in_stack
await run_pulumi_func(lambda: Stack(func))
File "/home/dishant/Projects/cloud-poc/infrastructure/stacks/strapi/venv/lib64/python3.9/site-packages/pulumi/runtime/stack.py", line 43, in run_pulumi_func
func()
File "/home/dishant/Projects/cloud-poc/infrastructure/stacks/strapi/venv/lib64/python3.9/site-packages/pulumi/runtime/stack.py", line 110, in <lambda>
await run_pulumi_func(lambda: Stack(func))
File "/home/dishant/Projects/cloud-poc/infrastructure/stacks/strapi/venv/lib64/python3.9/site-packages/pulumi/runtime/stack.py", line 133, in __init__
func()
File "/home/dishant/.pulumi/bin/pulumi-language-python-exec", line 91, in <lambda>
coro = pulumi.runtime.run_in_stack(lambda: runpy.run_path(args.PROGRAM, run_name='__main__'))
File "/usr/lib64/python3.9/runpy.py", line 285, in run_path
return _run_code(code, mod_globals, init_globals,
File "/usr/lib64/python3.9/runpy.py", line 87, in _run_code
exec(code, run_globals)
File "/home/dishant/Projects/cloud-poc/infrastructure/stacks/strapi/./__main__.py", line 41, in <module>
ingress = Ingress(
TypeError: __init__() takes 1 positional argument but 2 positional arguments (and 2 keyword-only arguments) were given
error: an unhandled error occurred: Program exited with non-zero exit code: 1
This is my pulumi code:
"""A Kubernetes Python Pulumi program"""
import http
from importlib.resources import path
import pulumi
from pulumi_kubernetes.apps.v1 import Deployment, DeploymentSpecArgs
from pulumi_kubernetes.networking.v1 import *
from pulumi_kubernetes.networking.v1.outputs import *
from pulumi_kubernetes.meta.v1 import LabelSelectorArgs, ObjectMetaArgs
from pulumi_kubernetes.core.v1 import *
app_labels = { "app": "strapi" }
deployment = Deployment(
"strapi",
spec=DeploymentSpecArgs(
selector=LabelSelectorArgs(match_labels=app_labels),
replicas=2,
template=PodTemplateSpecArgs(
metadata=ObjectMetaArgs(labels=app_labels),
spec=PodSpecArgs(containers=[ContainerArgs(name="nginx", image="strapi/strapi")])
),
))
pulumi.export("name", deployment.metadata["name"])
strapiService = Service("strapiService",
api_version="v1",
kind="Service",
metadata=ObjectMetaArgs(
name="strapi",
),
spec=ServiceSpecArgs(
selector=app_labels,
ports=[ServicePortArgs(
protocol="TCP",
port=80,
target_port=1337,
)],
))
ingress = Ingress(
"strapi",
metadata=ObjectMetaArgs(
name="strapi",
),
spec=IngressSpecArgs(
ingress_class_name="nginx",
rules=IngressRuleArgs(
host="strapi.test.cluster",
http=HTTPIngressRuleValueArgs(
paths=HTTPIngressPathArgs(
backend=IngressBackendArgs(
service=IngressServiceBackendArgs(
name="strapi",
port=ServiceBackendPortArgs(
name="http",
number="80"
),
)
),
path_type="Prefix",
path="/"
)
)
))
)
miniature-nest-23801
09/20/2021, 5:39 PMdry-autumn-28966
09/20/2021, 8:20 PMinfra
stack that outputs a kubeconfig file with temporary token. The kubeconfig is then used from a different app
stack using pulumi.NewStackReference(). Everything works fine until the temporary token expire… Running refresh>up against infra
update the kubeconfig file but then the app
refresh still uses the old one and fail. Is there any workaround?great-sunset-355
09/21/2021, 8:52 AMgorgeous-country-43026
09/21/2021, 9:49 AMbillions-mechanic-26704
09/21/2021, 12:28 PMbillions-mechanic-26704
09/21/2021, 2:25 PMvariable "org" {
type = string
validation {
condition = length(<http://var.org|var.org>) <= 3
error_message = "The org variable cannot be larger than 3 characters."
}
}
variable "tenant" {
type = string
validation {
condition = length(var.tenant) <= 4
error_message = "The tenant variable cannot be larger than 4 characters."
}
}
variable "environment" {
type = string
validation {
condition = length(var.environment) <= 4
error_message = "The environment variable cannot be larger than 4 characters."
}
}
And I use the above variables to name an azure resource group like:
module "resource_group_name" {
source = "gsoft-inc/naming/azurerm//modules/general/resource_group"
name = "main"
prefixes = [<http://var.org|var.org>, var.tenant, var.environment]
}
Is possible to do something similar in pulumi? I saw a similar issue reported here, but looks like this is more under programatically control?hallowed-teacher-48474
09/22/2021, 12:30 AMtall-nightfall-10556
09/22/2021, 1:00 AM~ advancedOptions: {
- override_main_response_version: "false"
}
I think this must be related to the recent Elasticsearch -> OpenSearch change.steep-sunset-89396
09/22/2021, 1:45 AMbulky-policeman-29913
09/22/2021, 2:00 PMacoustic-ram-46099
09/22/2021, 3:56 PMicy-engineer-10830
09/22/2021, 4:28 PMerror: over stack limit: you are using 9 of 5 stacks - manage stack limits for your organization at <https://app.pulumi.com/><my-org>/settings/subscription
are stacks not unlimited?
also, click this does nothing:dry-teacher-74595
09/22/2021, 6:15 PMrandom.RandomPassword
and its not stored in the configuration. that and is there a way to do it if my rds cluster is not publically accessible?victorious-exabyte-70545
09/22/2021, 9:32 PMvictorious-exabyte-70545
09/22/2021, 9:32 PMAttributeError: 'NoneType' object has no attribute '__name__'
In [27]: auto.select_stack("stackname", work_dir="/path_to_project")
victorious-exabyte-70545
09/22/2021, 9:32 PMbroad-gold-44713
09/22/2021, 10:09 PMterraform plan
? The closest I can think of is pulumi preview -r -j
. Is that correct?cuddly-tailor-40542
09/23/2021, 1:16 AMoidcProvider := cluster.Core.OidcProvider().ApplyT(func(oidcUrl string) string {
return strings.Trim(oidcUrl, "https://")
})
The error is in the image below. Has anyone used this EKS package and did they find a workaround for this?quiet-architect-74241
09/23/2021, 9:57 AM