Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

connect block blank in job inspect output #7397

Closed
shoenig opened this issue Mar 20, 2020 · 2 comments · Fixed by #7690
Closed

connect block blank in job inspect output #7397

shoenig opened this issue Mar 20, 2020 · 2 comments · Fixed by #7690
Assignees
Labels
theme/consul/connect Consul Connect integration type/bug

Comments

@shoenig
Copy link
Member

shoenig commented Mar 20, 2020

Possibly related to #7275, I noticed the output of inspect does not provide connect information.

From the original job:

service {
  name = "myserver"
  port = 2000

  connect {
    sidecar_service {
      proxy {
        expose {
          checks = true
        }
      }
    }
  }
}
$ nomad job inspect checks | jq .Job.TaskGroups[0].Services[0].Connect
{
  "Native": false,
  "SidecarService": {
    "Port": "",
    "Proxy": {
      "Config": null,
      "ExposeConfig": null,
      "LocalServiceAddress": "",
      "LocalServicePort": 0,
      "Upstreams": null
    },
    "Tags": null
  },
  "SidecarTask": null
}
@shoenig shoenig self-assigned this Mar 20, 2020
@shoenig shoenig added type/bug theme/consul/connect Consul Connect integration labels Mar 20, 2020
@shoenig shoenig added this to the 0.11.0 milestone Mar 20, 2020
@schmichael schmichael removed this from the 0.11.0 milestone Apr 9, 2020
@shoenig
Copy link
Member Author

shoenig commented Apr 9, 2020

Created a job with all the settings filled in under the connect stanza filled in to see what all gets left out on inspect

Input:

service {
  name = "count-api"
  port = "9001"

  connect {
    sidecar_service {
      proxy {
        expose {
          path {
            path            = "/health"
            protocol        = "http"
            local_path_port = 9001
            listener_port   = "example"
          }
        }
        local_service_address = "10.0.0.1"
        local_service_port    = 8081
        upstreams {
          destination_name = "my-upstream"
          local_bind_port  = 8090
        }
        config {
          foo = "bar"
        }
      }
      port = "example"
      tags = ["a", "b"]
    }
    sidecar_task {
      # name = "my-sidecar"
      driver = "docker"
      user   = "bob"
      config {
        a = "b"
      }
      env {
        MY_SIDECAR = "v1"
      }
      resources {
        cpu    = 400
        memory = 256
      }
      meta {
        foo = "bar"
      }
      logs {
        max_files = 4
      }
      kill_timeout   = "10s"
      shutdown_delay = "5s"
      kill_signal    = "SIGTERM"
    }
  }
}

Inspect:

$ nomad job inspect foo | jq '.Job.TaskGroups[0].Services[0].Connect' | cat
{
  "Native": false,
  "SidecarService": {
    "Port": "example",
    "Proxy": {
      "Config": {
        "foo": "bar"
      },
      "ExposeConfig": null,
      "LocalServiceAddress": "",
      "LocalServicePort": 0,
      "Upstreams": [
        {
          "DestinationName": "my-upstream",
          "LocalBindPort": 8090
        }
      ]
    },
    "Tags": [
      "a",
      "b"
    ]
  },
  "SidecarTask": {
    "Config": {
      "a": "b"
    },
    "Driver": "docker",
    "Env": {
      "MY_SIDECAR": "v1"
    },
    "KillSignal": "SIGTERM",
    "KillTimeout": 10000000000,
    "LogConfig": {
      "MaxFileSizeMB": 0,
      "MaxFiles": 4
    },
    "Meta": {
      "foo": "bar"
    },
    "Name": "",
    "Resources": {
      "CPU": 400,
      "Devices": null,
      "DiskMB": 0,
      "IOPS": 0,
      "MemoryMB": 256,
      "Networks": null
    },
    "ShutdownDelay": 5000000000,
    "User": "bob"
  }
}

Looks like we are missing all of the expose block, local_service_address, local_service_port.

It seems sidecar_task.name is not configurable, but is documented as being such. Will open a separate issue around that.

@github-actions
Copy link

github-actions bot commented Nov 8, 2022

I'm going to lock this issue because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 8, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
theme/consul/connect Consul Connect integration type/bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants