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

Use Consul Dataplane for Terminating Gateways #1534

Merged
merged 32 commits into from
Sep 28, 2022

Conversation

t-eckert
Copy link
Contributor

@t-eckert t-eckert commented Sep 26, 2022

Changes proposed in this PR:

  • Use env var template helper
  • Use consul-dataplane instead of Envoy
  • Set Consul service name of gateway by annotation
  • Update BATS tests to match

How I've tested this PR:

  • BATS, unit, and acceptance

How I expect reviewers to test this PR:

  • You already know

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...)

@t-eckert t-eckert changed the base branch from agentless-base to ashwin/agentless-ingress-gateways September 27, 2022 13:32
@t-eckert t-eckert force-pushed the agentless-termgw-dataplane branch 10 times, most recently from a24d97e to db41a21 Compare September 28, 2022 02:16
@t-eckert t-eckert changed the base branch from ashwin/agentless-ingress-gateways to ashwin/ingress-gateways September 28, 2022 02:16
@t-eckert t-eckert force-pushed the agentless-termgw-dataplane branch 9 times, most recently from 03401b8 to 9ba968e Compare September 28, 2022 02:59
Comment on lines -2080 to -2082
serviceInstances, _, err := consulClient.Catalog().Service(consulSvcName, "", &api.QueryOptions{Namespace: ts.ConsulNS})
defaultNS, _, err := consulClient.Catalog().Service(consulSvcName, "", &api.QueryOptions{Namespace: "default"})
require.NoError(t, err)
require.Empty(t, serviceInstances)
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 fixes a "loophole" where the Mesh gateway could sneak through this check if it was not deregistered and the ConsulNS was not "default".

@thisisnotashwin thisisnotashwin force-pushed the ashwin/ingress-gateways branch 2 times, most recently from 453199c to 57dfafc Compare September 28, 2022 03:29
Base automatically changed from ashwin/ingress-gateways to agentless-base September 28, 2022 03:52
ishustava and others added 5 commits September 28, 2022 11:06
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
* Register mesh-gateways using the endpoints controller.
- Use consul-dataplane to configure the mesh-gateway proxy and remove envoy container.
- Remove instances of client and auto-encrypt from the deployment.
* Replace ioutil.ReadFile with os.ReadFile
…ager

* Introduce new set of Consul flags that will be used by all consul-k8s commands
* Use consul-server-connection-manager to discover servers and use up-to-date
  server IP every time we need to make an API request.
@t-eckert t-eckert force-pushed the agentless-termgw-dataplane branch from 709d2a2 to 26cfe42 Compare September 28, 2022 15:06
@t-eckert t-eckert marked this pull request as ready for review September 28, 2022 18:38
Comment on lines +118 to +150
- name: consul-service
emptyDir:
medium: "Memory"
{{- range (default $defaults.extraVolumes .extraVolumes) }}
- name: userconfig-{{ .name }}
{{ .type }}:
{{- if (eq .type "configMap") }}
name: {{ .name }}
{{- else if (eq .type "secret") }}
secretName: {{ .name }}
{{- end }}
{{- with .items }}
items:
{{- range . }}
- key: {{.key}}
path: {{.path}}
{{- end }}
{{- end }}
{{- end }}
{{- if $root.Values.global.tls.enabled }}
{{- if not (and $root.Values.externalServers.enabled $root.Values.externalServers.useSystemRoots) }}
- name: consul-ca-cert
secret:
{{- if $root.Values.global.tls.caCert.secretName }}
secretName: {{ $root.Values.global.tls.caCert.secretName }}
{{- else }}
secretName: {{ template "consul.fullname" $root }}-ca-cert
{{- end }}
items:
- key: {{ default "tls.crt" $root.Values.global.tls.caCert.secretKey }}
path: tls.crt
{{- end }}
{{- end }}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Mesh and ingress had these one less indented so I just matched it.

Copy link
Contributor

@thisisnotashwin thisisnotashwin left a comment

Choose a reason for hiding this comment

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

Great work!

Copy link
Contributor

@ishustava ishustava left a comment

Choose a reason for hiding this comment

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

Looks good! Just a couple of comments.

@t-eckert t-eckert merged commit 0805258 into agentless-base Sep 28, 2022
@t-eckert t-eckert deleted the agentless-termgw-dataplane branch September 28, 2022 19:41
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.

3 participants