threefoldtech / test_feedback

Apache License 2.0
3 stars 0 forks source link

Unable to add DNS to my public IP #291

Closed LennertDefauw1 closed 2 years ago

LennertDefauw1 commented 2 years ago

Got a VM running on public IP http://185.69.166.145:80 with default nginx installed and is available on port 80:

image

Want to have userfriendly accessibility, so want to provide DNS.

Using grid3_client in typescript with freefarm (farmID: 1) where gateways are correctly configured:

(based on docs in manual) https://library.threefold.me/info/manual/#/manual3_iac/grid3_javascript/manual__grid3_javascript_vm_gateways

    await gridClient.connect();

    const gatewayQueryOptions: FilterOptions = {
        gateway: true,
        farmId: 1,
    };

    const gw = new GatewayNameModel();
    gw.name = "lennertapp2";

    gw.node_id = +(await gridClient.capacity.filterNodes(gatewayQueryOptions))[0].nodeId;
    gw.tls_passthrough = false;

    gw.backends = ["http://185.69.166.145:80"];

    // deploy
    const res = await gridClient.gateway.deploy_name(gw);
    console.log(res);

    // get the deployment
    const l = await gridClient.gateway.getObj(gw.name);
    console.log(l);

    await gridClient.disconnect();

got this as result

[
  {
    version: 0,
    contractId: 6617,
    name: 'lennertapp2',
    created: 1663326789,
    status: 'ok',
    message: '',
    type: 'gateway-name-proxy',
    domain: 'lennertapp2.gent01.grid.tf',
    tls_passthrough: false,
    backends: [ 'http://185.69.166.145:80' ],
    metadata: '',
    description: ''
  }
]

so I would expect lennertapp2.gent01.grid.tf now would be available and redirects to http://185.69.166.145:80

but this is the result

image

Am I doing something wrong?

coesensbert commented 2 years ago

Looks correct.

It works now! Found a small typo in the CNAME of the public domain config

LennertDefauw1 commented 2 years ago

Nice! Thank you :)