https://pulumi.com logo
#general
Title
# general
l

lemon-greece-30910

03/03/2019, 5:09 PM
Hi, does anyone have advice on how to configure ingress with HTTPS when using kubernetes? i have previously used caddy to set this up because it has the ability to automatically fetch and update TLS certs. i can see in the documentation when creating a container app, you can specify a path to the
Dockerfile
with
awsx.ecs.Image.fromPath
as show in the example on https://pulumi.io/quickstart/aws/tutorial-service.html... i would like something similar so i can build an image for kubernetes to work on an example like shown at: https://github.com/pulumi/examples/tree/master/kubernetes-ts-exposed-deployment. how i am trying to create a caddy server:
Copy code
image: awsx.ecs.Image.fromPath("caddy", {dockerfile: "./src" }),
unlike in the example on the pulumi tutorial, it seems
fromPath
in the latest version (0.16.5) requires 2 parameters. but i cant figure out how the second parameter needs to be specified. i have tried searching the documentation but i am unable to find what i am looking for. perhaps i am searching in the wrong place?
w

white-balloon-205

03/03/2019, 5:10 PM
The first parameter is a “name”, the second is the path to the sources you want to
docker build
.
We’ll make sure the API docs are up to date here.
(And the tutorial)
l

lemon-greece-30910

03/03/2019, 5:33 PM
my deployment spec is as follows:
Copy code
const deployment = new k8s.apps.v1.Deployment(name,
        {
            metadata: {
                namespace: namespaceName,
                labels: appLabels,
            },
            spec: {
                replicas: 1,
                selector: { matchLabels: appLabels },
                template: {
                    metadata: {
                        labels: appLabels,
                    },
                    spec: {
                        containers: [
                            {
                                name: name,
                                image: awsx.ecs.Image.fromPath("ingress", "./src/." ),
                                ports: [{ name: "http", containerPort: 80 }],
                                volumeMounts: [{
                                    name: "volume",
                                    mountPath: "/root/.caddy"
                                }]
                            }
                        ],
                        volumes: [
                            {
                                name: "volume",
                                awsElasticBlockStore: {
                                    volumeID: volume.id
                                }
                            }
                        ]
                    }
                }
            },
        },
        {
            provider: cluster.provider,
        }
    );
this does not work. perhaps this method is not compatible with kubernetes?
i am open to any other options to set up an ingress when using Pulumi if this is not the best/simplest way.
c

creamy-potato-29402

03/04/2019, 6:42 AM
@lemon-greece-30910 the
Deployment
API is the same as the official Kubernetes API.
that is to say, you must provide an image name.
The Kubernetes YAML API does not let you pass an image path instead, and we don’t (at this point) either.
4 Views