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

Backport of Resolve Consul DNS in OpenShift into release/1.17.x #20446

Conversation

hc-github-team-consul-core
Copy link
Collaborator

Backport

This PR is auto-generated from #20439 to be assessed for backporting due to the inclusion of the label backport/1.17.

The below text is copied from the body of the original PR.


This updates our Consul DNS forwarding documentation to include methods for updating the DNS Operator on OpenShift clusters to include Consul's DNS service.

Description

Our documentation titled Resolve Consul DNS Requests in Kubernetes has long been missing steps to update Kubernetes on OpenShift's DNS Operator to include the Consul DNS Forwarder. This PR aims to close that gap.

Testing & Reproduction steps

  • Deploy Consul on OpenShift, and ensure the following overrides are set to enable consul-dns service:
dns:
  enabled: true
  enabledRedirection: true
  type: ClusterIP
  • Find consul-dns service clusterIP: oc get svc consul-dns --namespace consul --output jsonpath='{.spec.clusterIP}'
  • Edit the DNS Operator Configuration (as outlined in the OpenShift Documentation):
    • Edit DNS Operator: oc edit edit dns.operator/default
  • Add consul-dns clusterIP as upstream server for the consul zone and save configuration changes:
spec:
  servers:
  - name: consul-server
    zones:
    - consul
    forwardPlugin:
      policy: Random
      upstreams:
      - 172.30.186.254 # Set to clusterIP of consul-dns service
  • Verify DNS Operator applied the changes: oc get configmap/dns-default -n openshift-dns -o yaml
...
data:
  Corefile: |
    # consul-server
    consul:5353 {
        prometheus 127.0.0.1:9153
        forward . 172.30.186.254 {
            policy random
        }
        errors
        log . {
            class error
        }
        bufsize 1232
        cache 900 {
            denial 9984 30
        }
    }
...
  • From terminal of pod deployed to the Consul service mesh, verify DNS name resolution with Consul domain:
$ nslookup consul.service.consul
Server:         172.30.0.10
Address:        172.30.0.10:53


Name:   consul.service.consul
Address: 10.129.2.21
Name:   consul.service.consul
Address: 10.130.2.18
Name:   consul.service.consul
Address: 10.128.2.19

$ nslookup backend.virtual.consul.ns.consul
Server:         172.30.0.10
Address:         172.30.0.10:53

Name:   backend.virtual.consul.ns.consul
Address: 240.0.0.5

Name:   backend.virtual.consul.ns.consul
Address: 240.0.0.5

Links

OpenShift DNS Operator: Using DNS Forwarding

PR Checklist

  • updated test coverage
  • external facing docs updated
  • appropriate backport labels added
  • not a security concern

Overview of commits

@hc-github-team-consul-core hc-github-team-consul-core requested a review from a team as a code owner February 1, 2024 22:01
@hc-github-team-consul-core hc-github-team-consul-core force-pushed the backport/natemollica-consul-dns-openshift/sensibly-promoted-gorilla branch from c9029d5 to db4b733 Compare February 1, 2024 22:01
Copy link
Collaborator

Choose a reason for hiding this comment

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

Auto approved Consul Bot automated PR

@github-actions github-actions bot added the type/docs Documentation needs to be created/updated/clarified label Feb 1, 2024
@vercel vercel bot temporarily deployed to Preview – consul February 1, 2024 22:11 Inactive
@natemollica-nm natemollica-nm merged commit 28501ac into release/1.17.x Feb 1, 2024
95 of 96 checks passed
@natemollica-nm natemollica-nm deleted the backport/natemollica-consul-dns-openshift/sensibly-promoted-gorilla branch February 1, 2024 22:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/docs Documentation needs to be created/updated/clarified
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants