https://pulumi.com logo
Join the conversationJoin Slack
Channels
announcements
automation-api
aws
azure
blog-posts
built-with-pulumi
cloudengineering
cloudengineering-support
content-share
contribex
contribute
docs
dotnet
finops
general
getting-started
gitlab
golang
google-cloud
hackathon-03-19-2020
hacktoberfest
install
java
jobs
kubernetes
learn-pulumi-events
linen
localstack
multi-language-hackathon
office-hours
oracle-cloud-infrastructure
plugin-framework
pulumi-cdk
pulumi-crosscode
pulumi-deployments
pulumi-kubernetes-operator
pulumi-service
pulumiverse
python
registry
status
testingtesting123
testingtesting321
typescript
welcome
workshops
yaml
Powered by Linen
python
  • l

    little-river-49422

    02/08/2019, 6:36 AM
    can you point me to the newest release? or is it on the site\github already?
  • l

    little-river-49422

    02/08/2019, 7:42 AM
    another bug report:
    > pulumi up
    Previewing update (aks):
    
         Type                 Name                     Plan     Info
         pulumi:pulumi:Stack  azure-py-kubernetes-aks           1 error
    
    Diagnostics:
      pulumi:pulumi:Stack (azure-py-kubernetes-aks):
        error: Failed to locate 'python3' on your PATH. Have you installed Python 3.6 or greater?
    
    error: an error occurred while advancing the preview
    C:\_\pulumi-examples\azure-py-availability-set [master ≡ +2 ~0 -0 !]
    > python
    Python 3.6.8 (tags/v3.6.8:3c6b436a57, Dec 23 2018, 23:31:17) [MSC v.1916 32 bit (Intel)] on win32
    Type "help", "copyright", "credits" or "license" for more information.
  • l

    little-river-49422

    02/08/2019, 7:42 AM
    so it looks for python3.exe specifically...
  • l

    little-river-49422

    02/08/2019, 9:41 AM
    namespace repro: main.py
    import asyncio
    
    import pulumi
    from pulumi import ResourceOptions
    from pulumi_azure.core import ResourceGroup
    from pulumi_kubernetes import Provider
    from pulumi_azure.signalr import Service
    from pulumi_azure.storage import Account
    from other_namespace_repro import gen_service
    from pulumi_kubernetes.core.v1 import ServiceAccount
    from pulumi_kubernetes.rbac.v1 import RoleBinding
    
    labels = {
        "key": "value"
    }
    
    k8s = Provider("application_provider",
                    kubeconfig=%read-file-here%, namespace="something")
    gen_namespace(k8s)
    ServiceAccount(
        "orleans-rbac",
        metadata={
            "name": "orleans-rbac"
        }
    )
    gen_service('clarity-server', labels, [
        8080, 11111, 30000], k8s)
    other_namespace_repro.py
    import pulumi
    from pulumi import ResourceOptions
    from pulumi_kubernetes.core.v1 import Service
    
    
    def gen_service(name, labels, ports, custom_provider, service_type="ClusterIP"):
        keys = ['name', 'port', 'target_port']
        ports = [{**dict.fromkeys(keys[1:], port), "name": str(port)}
                 for port in ports]
    
        service_definition = Service(name,
                                     metadata={
                                         "name": name,
                                         "labels": labels,
                                         "namespace": "default"
                                     },
                                     spec={
                                         "ports": ports,
                                         "selector": labels,
                                         "type": service_type,
                                     }, __opts__=ResourceOptions(provider=custom_provider))
        return service_definition
  • i

    incalculable-sundown-82514

    02/08/2019, 6:04 PM
    An update for yesterday: we did land a fix for https://github.com/pulumi/pulumi-kubernetes/issues/411 yesterday, so you can run
    pip install --pre pulumi_kubernetes
    to pick it up
  • i

    incalculable-sundown-82514

    02/08/2019, 6:05 PM
    Re
    python3
    , yes, we do explicitly look for
    python3.exe
    because until 2020
    python.exe
    most often refers to Python 2 and was a major source of errors for people
  • i

    incalculable-sundown-82514

    02/08/2019, 6:05 PM
    Does the Windows installer for Python 3 not do this?
  • l

    little-river-49422

    02/08/2019, 6:33 PM
    noup 🙂
  • l

    little-river-49422

    02/08/2019, 6:35 PM
    did you look at the repro yet? or am I doing something wrong?
  • l

    little-river-49422

    02/08/2019, 6:38 PM
    mm, is there a way to delete stack state without deleting stack?
  • l

    little-river-49422

    02/08/2019, 6:38 PM
    or how do I force it to recreate k8s provider
  • l

    little-river-49422

    02/08/2019, 6:42 PM
    ugh, it doesnt even allow to delete stack
  • l

    little-river-49422

    02/08/2019, 6:45 PM
    is it possible to get current stack name? not sure where to look
  • l

    little-river-49422

    02/08/2019, 6:47 PM
    ok, I assume pulumi.get_stack does that
  • l

    little-river-49422

    02/08/2019, 7:44 PM
    btw, i'm still getting errors with the same snippet
  • l

    little-river-49422

    02/08/2019, 7:45 PM
    I mean rolebinding
  • l

    little-river-49422

    02/08/2019, 7:45 PM
    what should be my pulumi_kubernetes version?
    i
    • 2
    • 5
  • i

    incalculable-sundown-82514

    02/08/2019, 8:14 PM
    It looks like you’re overriding the namespace to
    default
    in your
    Service
    - I don’t think that’s what you want
  • l

    little-river-49422

    02/08/2019, 8:16 PM
    yeah, i think its a typo, but if you remove that it still doesnt work
  • i

    incalculable-sundown-82514

    02/08/2019, 8:16 PM
    yeah, I just saw that
  • i

    incalculable-sundown-82514

    02/08/2019, 8:16 PM
    @gorgeous-egg-16927 it looks like the provider might be ignoring the namespace config here - still looking, though.
  • l

    little-river-49422

    02/08/2019, 8:17 PM
    it only does that when it passed to a thing in another file
  • l

    little-river-49422

    02/08/2019, 8:17 PM
    in the same file it does fine
  • i

    incalculable-sundown-82514

    02/08/2019, 8:20 PM
    oh!
  • i

    incalculable-sundown-82514

    02/08/2019, 8:20 PM
    i figured it out
  • i

    incalculable-sundown-82514

    02/08/2019, 8:21 PM
    you’re importing
    pulumi_azure.signalr.Service
    in the main file
  • i

    incalculable-sundown-82514

    02/08/2019, 8:21 PM
    and
    pulumi_kubernetes_core.v1.Service
    in the other file
  • i

    incalculable-sundown-82514

    02/08/2019, 8:21 PM
    fixing that and continuing
  • i

    incalculable-sundown-82514

    02/08/2019, 8:22 PM
    I’m still thinking the provider is dropping the config
  • l

    little-river-49422

    02/08/2019, 8:29 PM
    ok, one thing I dont understand is how to force "blank' state in my stack? when I'm developing I often need to just wipe it. but recreating the stack is very frustrating, because i need to set variables
Powered by Linen
Title
l

little-river-49422

02/08/2019, 8:29 PM
ok, one thing I dont understand is how to force "blank' state in my stack? when I'm developing I often need to just wipe it. but recreating the stack is very frustrating, because i need to set variables
View count: 1