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

Initial support for agentless #1267

Merged
merged 27 commits into from
Jun 24, 2022
Merged

Conversation

ishustava
Copy link
Contributor

@ishustava ishustava commented Jun 9, 2022

Changes proposed in this PR:
Add initial support for the basic service mesh running with agentless.

  • Update connect-inject deployment to talk to consul servers (currently only in-cluster servers are supported; external servers support will come in a later PR)
  • Update endpoints controller to register and deregister services and health checks in the catalog and stop using agent APIs
  • Update connect-init command to take the -node-name flag so that it can search for services within a given node using catalog APIs
  • Add k8s probes to the envoy container
  • Provide -node-name flag to the consul connect envoy command so that we can generate correct configuration
  • Selectively disable acceptance tests that don't yet work in this configuration

How I've tested this PR:
acceptance tests

How I expect reviewers to test this PR:
👀
TODO:

  • add k8s probes to envoy container
  • fix acceptance tests
  • add support for external servers (will come in a separate PR as this one is already big)

Checklist:

  • Tests added
  • CHANGELOG entry added

    HashiCorp engineers only, community PRs should not add a changelog entry.
    Entries should use present tense (e.g. Add support for...)

@ishustava ishustava force-pushed the ishustava/agentless-inital-support branch from 0feca58 to de0faf2 Compare June 15, 2022 15:28
@ishustava ishustava changed the title wip Initial support for agentless Jun 16, 2022
Comment on lines +890 to +893
# - acceptance-tproxy:
# context: consul-ci
# requires:
# - dev-upload-docker
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tproxy is not yet supported

@ishustava ishustava force-pushed the ishustava/agentless-inital-support branch 3 times, most recently from 24f2671 to 3df5def Compare June 20, 2022 19:23
@test "client/ConfigMap: enable with global.enabled false" {
cd `chart_dir`
local actual=$(helm template \
-s templates/client-config-configmap.yaml \
--set 'client.enabled=true' \
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clients are now disabled by default (previously they were enabled), and so lots of bats tests needed to be changed to enable clients explicitly

Comment on lines -631 to -632
#--------------------------------------------------------------------
# global.tls.enableAutoEncrypt
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Auto-encrypt is no longer supported for the connect-inject deployment as this is a setting used only when talking to consul clients.

@ishustava ishustava force-pushed the ishustava/agentless-inital-support branch from 3df5def to f5479bc Compare June 20, 2022 20:32
// which in this case are Pods. It only returns true if the Pod is a Consul Client Agent Pod. It reads the labels
// from the meta of the resource and uses the values of the "app" and "component" label to validate that
// the Pod is a Consul Client Agent.
func (r *EndpointsController) filterAgentPods(object client.Object) bool {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This code might come back to better handle upgrades but removing it for now as I'm not sure yet how upgrades will be handled.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good point. but in that case, we would just re-enqueue all the endpoints I think.

Copy link
Contributor

@ndhanushkodi ndhanushkodi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks so great!! Thanks for the helpful comments all around and also reviewing this made me realize how well the k8s agentless RFC is written!!!

fieldPath: status.hostIP
{{- if .Values.global.tls.enabled }}
- name: CONSUL_CACERT
value: /consul/tls/ca/tls.crt
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clarifying q for my understanding: did this used to be the CA for server and client agents and now when clients are disabled it's only the server agent CA?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah exactly! and more specifically, when using auto-encrypt the CA for the client will be different (connect CA) and so we needed to mount a client-specific CA in that case. Without clients, we'd only need the server CA.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ahhh thank you for the clarification!!

ConsulKubernetesCheckType = "kubernetes-readiness"

// ConsulKubernetesCheckName is the name of health check in Consul for Kubernetes readiness status.
ConsulKubernetesCheckName = "Kubernetes Readiness Check"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in a custom health check like this, is the status of the check all consul would care about to decide whether to route traffic to the app?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks!!

@ishustava ishustava merged commit 783d0a5 into agentless Jun 24, 2022
@ishustava ishustava deleted the ishustava/agentless-inital-support branch June 24, 2022 18:56
thisisnotashwin pushed a commit that referenced this pull request Sep 19, 2022
Add initial support for the basic service mesh running with agentless.

* Update connect-inject deployment to talk to consul servers (currently only in-cluster servers are supported; external servers support will come in a later PR)
* Update endpoints controller to register and deregister services and health checks in the catalog and stop using agent APIs
* Update connect-init command to take the -node-name flag so that it can search for services within a given node using catalog APIs
* Add k8s probes to the envoy container
* Provide -node-name flag to the consul connect envoy command so that we can generate correct configuration
* Selectively disable acceptance tests that don't yet work in this configuration
* Disable consul clients by default
thisisnotashwin pushed a commit that referenced this pull request Sep 19, 2022
Add initial support for the basic service mesh running with agentless.

* Update connect-inject deployment to talk to consul servers (currently only in-cluster servers are supported; external servers support will come in a later PR)
* Update endpoints controller to register and deregister services and health checks in the catalog and stop using agent APIs
* Update connect-init command to take the -node-name flag so that it can search for services within a given node using catalog APIs
* Add k8s probes to the envoy container
* Provide -node-name flag to the consul connect envoy command so that we can generate correct configuration
* Selectively disable acceptance tests that don't yet work in this configuration
* Disable consul clients by default
thisisnotashwin pushed a commit that referenced this pull request Sep 19, 2022
Add initial support for the basic service mesh running with agentless.

* Update connect-inject deployment to talk to consul servers (currently only in-cluster servers are supported; external servers support will come in a later PR)
* Update endpoints controller to register and deregister services and health checks in the catalog and stop using agent APIs
* Update connect-init command to take the -node-name flag so that it can search for services within a given node using catalog APIs
* Add k8s probes to the envoy container
* Provide -node-name flag to the consul connect envoy command so that we can generate correct configuration
* Selectively disable acceptance tests that don't yet work in this configuration
* Disable consul clients by default
ishustava added a commit that referenced this pull request Sep 20, 2022
Add initial support for the basic service mesh running with agentless.

* Update connect-inject deployment to talk to consul servers (currently only in-cluster servers are supported; external servers support will come in a later PR)
* Update endpoints controller to register and deregister services and health checks in the catalog and stop using agent APIs
* Update connect-init command to take the -node-name flag so that it can search for services within a given node using catalog APIs
* Add k8s probes to the envoy container
* Provide -node-name flag to the consul connect envoy command so that we can generate correct configuration
* Selectively disable acceptance tests that don't yet work in this configuration
* Disable consul clients by default
thisisnotashwin pushed a commit that referenced this pull request Sep 20, 2022
Add initial support for the basic service mesh running with agentless.

* Update connect-inject deployment to talk to consul servers (currently only in-cluster servers are supported; external servers support will come in a later PR)
* Update endpoints controller to register and deregister services and health checks in the catalog and stop using agent APIs
* Update connect-init command to take the -node-name flag so that it can search for services within a given node using catalog APIs
* Add k8s probes to the envoy container
* Provide -node-name flag to the consul connect envoy command so that we can generate correct configuration
* Selectively disable acceptance tests that don't yet work in this configuration
* Disable consul clients by default
ishustava added a commit that referenced this pull request Sep 20, 2022
Add initial support for the basic service mesh running with agentless.

* Update connect-inject deployment to talk to consul servers (currently only in-cluster servers are supported; external servers support will come in a later PR)
* Update endpoints controller to register and deregister services and health checks in the catalog and stop using agent APIs
* Update connect-init command to take the -node-name flag so that it can search for services within a given node using catalog APIs
* Add k8s probes to the envoy container
* Provide -node-name flag to the consul connect envoy command so that we can generate correct configuration
* Selectively disable acceptance tests that don't yet work in this configuration
* Disable consul clients by default
t-eckert pushed a commit that referenced this pull request Sep 21, 2022
Add initial support for the basic service mesh running with agentless.

* Update connect-inject deployment to talk to consul servers (currently only in-cluster servers are supported; external servers support will come in a later PR)
* Update endpoints controller to register and deregister services and health checks in the catalog and stop using agent APIs
* Update connect-init command to take the -node-name flag so that it can search for services within a given node using catalog APIs
* Add k8s probes to the envoy container
* Provide -node-name flag to the consul connect envoy command so that we can generate correct configuration
* Selectively disable acceptance tests that don't yet work in this configuration
* Disable consul clients by default
t-eckert pushed a commit that referenced this pull request Sep 21, 2022
Add initial support for the basic service mesh running with agentless.

* Update connect-inject deployment to talk to consul servers (currently only in-cluster servers are supported; external servers support will come in a later PR)
* Update endpoints controller to register and deregister services and health checks in the catalog and stop using agent APIs
* Update connect-init command to take the -node-name flag so that it can search for services within a given node using catalog APIs
* Add k8s probes to the envoy container
* Provide -node-name flag to the consul connect envoy command so that we can generate correct configuration
* Selectively disable acceptance tests that don't yet work in this configuration
* Disable consul clients by default
t-eckert pushed a commit that referenced this pull request Sep 21, 2022
Add initial support for the basic service mesh running with agentless.

* Update connect-inject deployment to talk to consul servers (currently only in-cluster servers are supported; external servers support will come in a later PR)
* Update endpoints controller to register and deregister services and health checks in the catalog and stop using agent APIs
* Update connect-init command to take the -node-name flag so that it can search for services within a given node using catalog APIs
* Add k8s probes to the envoy container
* Provide -node-name flag to the consul connect envoy command so that we can generate correct configuration
* Selectively disable acceptance tests that don't yet work in this configuration
* Disable consul clients by default
t-eckert pushed a commit that referenced this pull request Sep 21, 2022
Add initial support for the basic service mesh running with agentless.

* Update connect-inject deployment to talk to consul servers (currently only in-cluster servers are supported; external servers support will come in a later PR)
* Update endpoints controller to register and deregister services and health checks in the catalog and stop using agent APIs
* Update connect-init command to take the -node-name flag so that it can search for services within a given node using catalog APIs
* Add k8s probes to the envoy container
* Provide -node-name flag to the consul connect envoy command so that we can generate correct configuration
* Selectively disable acceptance tests that don't yet work in this configuration
* Disable consul clients by default
thisisnotashwin pushed a commit that referenced this pull request Sep 22, 2022
Add initial support for the basic service mesh running with agentless.

* Update connect-inject deployment to talk to consul servers (currently only in-cluster servers are supported; external servers support will come in a later PR)
* Update endpoints controller to register and deregister services and health checks in the catalog and stop using agent APIs
* Update connect-init command to take the -node-name flag so that it can search for services within a given node using catalog APIs
* Add k8s probes to the envoy container
* Provide -node-name flag to the consul connect envoy command so that we can generate correct configuration
* Selectively disable acceptance tests that don't yet work in this configuration
* Disable consul clients by default
thisisnotashwin pushed a commit that referenced this pull request Sep 22, 2022
Add initial support for the basic service mesh running with agentless.

* Update connect-inject deployment to talk to consul servers (currently only in-cluster servers are supported; external servers support will come in a later PR)
* Update endpoints controller to register and deregister services and health checks in the catalog and stop using agent APIs
* Update connect-init command to take the -node-name flag so that it can search for services within a given node using catalog APIs
* Add k8s probes to the envoy container
* Provide -node-name flag to the consul connect envoy command so that we can generate correct configuration
* Selectively disable acceptance tests that don't yet work in this configuration
* Disable consul clients by default
thisisnotashwin pushed a commit that referenced this pull request Sep 27, 2022
Add initial support for the basic service mesh running with agentless.

* Update connect-inject deployment to talk to consul servers (currently only in-cluster servers are supported; external servers support will come in a later PR)
* Update endpoints controller to register and deregister services and health checks in the catalog and stop using agent APIs
* Update connect-init command to take the -node-name flag so that it can search for services within a given node using catalog APIs
* Add k8s probes to the envoy container
* Provide -node-name flag to the consul connect envoy command so that we can generate correct configuration
* Selectively disable acceptance tests that don't yet work in this configuration
* Disable consul clients by default
thisisnotashwin pushed a commit that referenced this pull request Sep 27, 2022
Add initial support for the basic service mesh running with agentless.

* Update connect-inject deployment to talk to consul servers (currently only in-cluster servers are supported; external servers support will come in a later PR)
* Update endpoints controller to register and deregister services and health checks in the catalog and stop using agent APIs
* Update connect-init command to take the -node-name flag so that it can search for services within a given node using catalog APIs
* Add k8s probes to the envoy container
* Provide -node-name flag to the consul connect envoy command so that we can generate correct configuration
* Selectively disable acceptance tests that don't yet work in this configuration
* Disable consul clients by default
jmurret pushed a commit that referenced this pull request Sep 27, 2022
Add initial support for the basic service mesh running with agentless.

* Update connect-inject deployment to talk to consul servers (currently only in-cluster servers are supported; external servers support will come in a later PR)
* Update endpoints controller to register and deregister services and health checks in the catalog and stop using agent APIs
* Update connect-init command to take the -node-name flag so that it can search for services within a given node using catalog APIs
* Add k8s probes to the envoy container
* Provide -node-name flag to the consul connect envoy command so that we can generate correct configuration
* Selectively disable acceptance tests that don't yet work in this configuration
* Disable consul clients by default
t-eckert pushed a commit that referenced this pull request Sep 28, 2022
Add initial support for the basic service mesh running with agentless.

* Update connect-inject deployment to talk to consul servers (currently only in-cluster servers are supported; external servers support will come in a later PR)
* Update endpoints controller to register and deregister services and health checks in the catalog and stop using agent APIs
* Update connect-init command to take the -node-name flag so that it can search for services within a given node using catalog APIs
* Add k8s probes to the envoy container
* Provide -node-name flag to the consul connect envoy command so that we can generate correct configuration
* Selectively disable acceptance tests that don't yet work in this configuration
* Disable consul clients by default
t-eckert pushed a commit that referenced this pull request Sep 28, 2022
Add initial support for the basic service mesh running with agentless.

* Update connect-inject deployment to talk to consul servers (currently only in-cluster servers are supported; external servers support will come in a later PR)
* Update endpoints controller to register and deregister services and health checks in the catalog and stop using agent APIs
* Update connect-init command to take the -node-name flag so that it can search for services within a given node using catalog APIs
* Add k8s probes to the envoy container
* Provide -node-name flag to the consul connect envoy command so that we can generate correct configuration
* Selectively disable acceptance tests that don't yet work in this configuration
* Disable consul clients by default
t-eckert pushed a commit that referenced this pull request Sep 28, 2022
Add initial support for the basic service mesh running with agentless.

* Update connect-inject deployment to talk to consul servers (currently only in-cluster servers are supported; external servers support will come in a later PR)
* Update endpoints controller to register and deregister services and health checks in the catalog and stop using agent APIs
* Update connect-init command to take the -node-name flag so that it can search for services within a given node using catalog APIs
* Add k8s probes to the envoy container
* Provide -node-name flag to the consul connect envoy command so that we can generate correct configuration
* Selectively disable acceptance tests that don't yet work in this configuration
* Disable consul clients by default
t-eckert pushed a commit that referenced this pull request Sep 28, 2022
Add initial support for the basic service mesh running with agentless.

* Update connect-inject deployment to talk to consul servers (currently only in-cluster servers are supported; external servers support will come in a later PR)
* Update endpoints controller to register and deregister services and health checks in the catalog and stop using agent APIs
* Update connect-init command to take the -node-name flag so that it can search for services within a given node using catalog APIs
* Add k8s probes to the envoy container
* Provide -node-name flag to the consul connect envoy command so that we can generate correct configuration
* Selectively disable acceptance tests that don't yet work in this configuration
* Disable consul clients by default
t-eckert pushed a commit that referenced this pull request Sep 28, 2022
Add initial support for the basic service mesh running with agentless.

* Update connect-inject deployment to talk to consul servers (currently only in-cluster servers are supported; external servers support will come in a later PR)
* Update endpoints controller to register and deregister services and health checks in the catalog and stop using agent APIs
* Update connect-init command to take the -node-name flag so that it can search for services within a given node using catalog APIs
* Add k8s probes to the envoy container
* Provide -node-name flag to the consul connect envoy command so that we can generate correct configuration
* Selectively disable acceptance tests that don't yet work in this configuration
* Disable consul clients by default
t-eckert pushed a commit that referenced this pull request Sep 28, 2022
Add initial support for the basic service mesh running with agentless.

* Update connect-inject deployment to talk to consul servers (currently only in-cluster servers are supported; external servers support will come in a later PR)
* Update endpoints controller to register and deregister services and health checks in the catalog and stop using agent APIs
* Update connect-init command to take the -node-name flag so that it can search for services within a given node using catalog APIs
* Add k8s probes to the envoy container
* Provide -node-name flag to the consul connect envoy command so that we can generate correct configuration
* Selectively disable acceptance tests that don't yet work in this configuration
* Disable consul clients by default
t-eckert pushed a commit that referenced this pull request Sep 28, 2022
Add initial support for the basic service mesh running with agentless.

* Update connect-inject deployment to talk to consul servers (currently only in-cluster servers are supported; external servers support will come in a later PR)
* Update endpoints controller to register and deregister services and health checks in the catalog and stop using agent APIs
* Update connect-init command to take the -node-name flag so that it can search for services within a given node using catalog APIs
* Add k8s probes to the envoy container
* Provide -node-name flag to the consul connect envoy command so that we can generate correct configuration
* Selectively disable acceptance tests that don't yet work in this configuration
* Disable consul clients by default
t-eckert pushed a commit that referenced this pull request Sep 28, 2022
Add initial support for the basic service mesh running with agentless.

* Update connect-inject deployment to talk to consul servers (currently only in-cluster servers are supported; external servers support will come in a later PR)
* Update endpoints controller to register and deregister services and health checks in the catalog and stop using agent APIs
* Update connect-init command to take the -node-name flag so that it can search for services within a given node using catalog APIs
* Add k8s probes to the envoy container
* Provide -node-name flag to the consul connect envoy command so that we can generate correct configuration
* Selectively disable acceptance tests that don't yet work in this configuration
* Disable consul clients by default
t-eckert pushed a commit that referenced this pull request Sep 28, 2022
Add initial support for the basic service mesh running with agentless.

* Update connect-inject deployment to talk to consul servers (currently only in-cluster servers are supported; external servers support will come in a later PR)
* Update endpoints controller to register and deregister services and health checks in the catalog and stop using agent APIs
* Update connect-init command to take the -node-name flag so that it can search for services within a given node using catalog APIs
* Add k8s probes to the envoy container
* Provide -node-name flag to the consul connect envoy command so that we can generate correct configuration
* Selectively disable acceptance tests that don't yet work in this configuration
* Disable consul clients by default
ishustava added a commit that referenced this pull request Sep 28, 2022
Add initial support for the basic service mesh running with agentless.

* Update connect-inject deployment to talk to consul servers (currently only in-cluster servers are supported; external servers support will come in a later PR)
* Update endpoints controller to register and deregister services and health checks in the catalog and stop using agent APIs
* Update connect-init command to take the -node-name flag so that it can search for services within a given node using catalog APIs
* Add k8s probes to the envoy container
* Provide -node-name flag to the consul connect envoy command so that we can generate correct configuration
* Selectively disable acceptance tests that don't yet work in this configuration
* Disable consul clients by default
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants