Yossi Boaron
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Engagement control
    • Make a copy
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Make a copy Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    --- title: on-prem-configurable-lb-dns-stack authors: - "@yboaron" reviewers: - "@sttts" - "@deads2k" - "@celebdor" - "@bcrochet" - "@bnemec" approvers: - "@" creation-date: 2020-02-11 last-updated: 2020-02-11 status: implementable --- # On-prem: configurable DNS/LB self-hosted stack ## Release Signoff Checklist - [X] Enhancement is `implementable` - [ ] Design details are appropriately documented from clear requirements - [ ] Test plan is defined - [ ] Graduation criteria for dev preview, tech preview, GA - [ ] User-facing documentation is created in [openshift-docs](https://github.com/openshift/openshift-docs/) ## Summary In the current implementation, the self-hosted DNS/LB stack runs under the MCO umbrella by default in all on-prem platforms and there's no option to configure it. Some customers with high production needs usually have their own external Load Balancing and DNS resolution. In addition, there are cases in which some traffic used to provide these self-hosted services is disallowed in the customer's network. The outcome of such scenarios is that cluster's resources are spent on providing unused services and generating traffic against certain customers network design. This enhancement suggests a new method for providing the self-hosted stack. *Note:* as per the OCP plan to move API and Ingress to K8S SLB, this direction should be investigated deeper after MetalLb will be integrated. ## Motivation Allow customers to adjust the self hosted DNS/LB stack according to the needs they really have instead of providing them in a generic way. The next table illustrates the supported self hosted stack configuration possibilities: | Component Name | Current status | This proposal | | ---------------------------------------------------- |------------------------| ------------------------| | Self-hosted LB and DNS | V | V | | Self-hosted LB and DNS(without node names resolution)| X | V | | external LB and DNS | X | V | ### Goals - Ability to use the self-hosted stack in all on-prem platforms. - Ability to control the self-hosted stack configuration. - Retrieve the self-hosted stack status through K8S API. - Maintain a single code base/manifests for all the on-prem platforms. ### Non-Goals - Define a new self-hosted stack for DNS or load balancing ## Proposal The [Keepalived and infra DNS components](https://github.com/openshift/machine-config-operator/tree/master/manifests/on-prem) on the bootstrap node will keep running through the MCO. However, the services on masters and workers nodes will be managed by both MCO and the new operator. The following functionalities are expected as part of the new operator: - Introduce a CRD used by the operator to manage the self-hosted stack. - Fields in CR spec that control the self-hosted stack configuration. - Fields in CR status that expose self-hosted stack status (e.g: which node holds the API-VIP). - Run Coredns-MDNS, HAProxy and MDNS-publisher self-hosted stack components as static pods according to the CRD instance content. ## Risks and Mitigations - Impact on on-prem platforms - Upgrades/Downgrades In order to mitigate the impact on on-prem platforms, in fresh deployments all the self-hosted LB, DNS, and VIP services will be enabled, therefore there is no need to rely on external services during deployment, also the on-prem platforms tests should be updated according to Test Plan section described below. Additionally, a detailed document in which the supported LB, DNS migration processes will be issued. ## Design Details ### Open Questions [optional] - Is `cluster-hosted-net-services-operator` an acceptable name? - In which namespace the new operator components should be hosted? ### current implmentation In current implementation, the [networking infra componenets](https://github.com/openshift/installer/blob/master/docs/design/baremetal/networking-infrastructure.md) run as static pods through the MCO. ### Suggested design To support early clustering requirements Keepalived will continue running as static pods through MCO, additionally, a new dnsmasq service (also deployed through MCO) will run in each node while HAProxy, CoreDNS-MDNS and MDNS-publisher will run as static pods through the new operator. The following table reflects the suggested changes. | Component Name | Current implementation | Proposed implementation | | ---------------------| -----------------------| ------------------------| | Resolv.conf prepender| NM dispatcher script | NM dispatcher script | | Keepalived | Static pod | Static pod | | HAProxy | Static pod | Static pod | | CoreDNS-MDNS | Static pod | Static pod | | mDNS-Publisher | Static pod | Static pod | | dnsmasq | -- | Systemd service | #### Self hosted DNS services - The self hosted DNS functionality should be composed of the following components in each node: - A NetworkManager dispatcher script used to configure resolv.conf to point at the node's public IP address, see [self hosted DNS design](https://github.com/openshift/installer/blob/f6bb83784a835e1f4955ef41916793c0948fd4a1/docs/design/baremetal/networking-infrastructure.md#internal-dns) for more details. - Systemd service running dnsmasq - CoreDNS-mDNS pod - The cluster-hosted-net-services-operator will be responsible only for the deployment of the CoreDNS pods while the NetworkManager dispatcher script and dnsmasq Systemd service will run through MCO. - To avoid port conflict, Dnsmasq service should listen on DNS well-known port (53) and CoreDNS-MDNS should listen on other port (e.g: 5353). - The new Dnsmasq service should be responsible to resolve 'api-int' (to API-VIP value provided in install-config) hostname when CoreDNS-MDNS pod isn't running on the node. - CoreDNS-MDNS should register itself as an upstream server in dnsmasq [via dbus interface](https://github.com/imp/dnsmasq/blob/master/dbus/DBus-interface#L51) for ClusterName.DomainName #### Self hosted API Loadbalancer - The current self hosted LB implementation (based on Keepalived and HAProxy) doesn't support graceful switchover, which means connections will break upon shutdown of node holds the VIP. - The self hosted API loadbalancer will run similarly to the current mode. - API should be available even when HAProxy pods don't run. - Additional functionality aspects of the self-hosted Loadbalancer maybe further analyzed upon need in a separate enhancement. #### Disaster recovery support In order to support disaster recovery kubelet, kube-controller-manager and kube-scheduler should be able to communicate with kube-api even when all cluster-hosted-net-services-operator pods are shutdown. The following steps will ensure that kube-api is available post disaster recovery: - Dnsmasq service and Keepalived static pods will start running on master nodes - API-VIP address will be assigned to one of the master nodes by Keepalived - Dnsmasq should resolve api-int hostname to API-VIP address The above steps should be applied also for cluster shutdown and resume use-case. ### cluster-hosted-net-services operator The `cluster-hosted-net-services-operator` is a new operator whose operand is a controller for the cluster hosted DNS, LB and VIP services. ### Standard SLO Behavior The cluster-hosted-net-services-operator is expected to follow the standard behavior of SLO, additionally, since the cluster-hosted-net-services-operator is applicable only to clusters running on on-prem ( 'baremetal', 'openstack', 'vsphere' or 'ovirt') infrastructure, It should support also the expected behaviors for "not in use" SLOs similar to the [CBO operator](https://github.com/openshift/enhancements/blob/master/enhancements/baremetal/an-slo-for-baremetal.md#standard-slo-behaviors). ### cluster-hosted-net-services-operator details The cluster-hosted-net-services-operator should: - Be a new `openshift/cluster-hosted-net-services-operator` project. - Publish an image called `cluster-hosted-net-services-operator`. - Add a new `ClusterOperator` with an additional `Disabled` status for non on-prem platforms. - Implement a controller reconciling a singleton instance representing the desired cluster hosted LB/DNS/VIP configuration. - Do nothing except set `Disabled=true`, `Available=true`, and `Progressing=False` when the `Infrastructure` resource is a platform type other than openstack, baremetal, ovirt or vsphere. - Update `ClusterOperator` DEGRADED field in accordance to the following healthchecks (in case self-hosted stack is enabled): - single node holds the VIP - kube-api is available via the VIP #### CRD definition Below is a possible option for a CRD instance of this operator: ```yaml apiVersion: clusterHostedNetServices.operator.io/v1alpha1 kind: HostedNetServices metadata: name: cluster spec: dns: nodesResolution: Enabled appsResolution: Enabled apiintIpAddress: 192.168.111.5 ingressHa: Enabled status: apiServerInternalIpOwner: master-0 ingressIpOwner: worker-1 ``` With this sample manifest the cluster-hosted-net-services-operator should: - Create DNS hosted service that will: - resolve node names and .apps wildcard record - resolve api-int to 192.168.111.5. - Run the self-hosted Loadbalancer for api only if apiintIpAddress is equal to API-VIP value provides in install-config file. - Provide high availability for default ingress. From the status section we can see that master-0 node currently owns api-int VIP and worker-1 node owns ingress VIP. Additional spec and status fields may be introduced based on requirements. #### Managing the cluster hosted networking services All the LB, DNS, and VIP components will be enabled by default in case of fresh deployment as today, while post-deployment the admin can control the services by editing the singleton CR. ##### API load balancer migration Note: API LB migration is a significant infrastructure change that may cause an API outage for some time. There is no requirement for the process to take place without service disruption. -- self-hosted to an external Load balancer In order to migrate the self-hosted LB to an external Load balancer the admin should: - Provide new IP address (!= API-VIP from install-config) pointing to external Load balancer front end. - Edit apiintIpAddress value to use this IP address. As a result of this change the cluster-hosted-net-services-operator should: - First, verify that IP address is valid and kube-api is available using the new IP address. - Update CoreDNS to resolve api-int to the new IP address - Remove the HAProxy pods after graceful shutdown timeout - Keepalived static pods will continue running -- external to self-hosted Load balancer To re-activate the self-hosted Load balancer the admin should set apiintIpAddress value to API-VIP address provided in install-config file and verify that external Load balancer is operational for graceful timeout. Post this change the cluster-hosted-net-services-operator should run the same procedure described above and run the HAProxy pods. ### User Stories #### As an admin I want to disable the self-hosted on-prem LB and DNS stack #### As an admin I want to use the self-hosted on-prem LB and DNS stack also in UPI deployments #### As an admin I want to retrieve the self-hosted stack status through K8S API ### Test Plan The operator will be tested in the OpenShift CI via e2e tests triggered using the [e2e-metal-ipi](https://github.com/openshift/release/blob/master/ci-operator/step-registry/baremetalds/e2e/baremetalds-e2e-workflow.yaml) workflow defined in the OpenShift CI steps registry and also by e2e tests for openstack, ovirt and vsphere. Additionally, the following tests should be added: - Check each platform when external Load balancer is used - Disruptive test that switch on/off the self-hosted components ### Upgrade / Downgrade Strategy Prior to this proposal, the self-hosted stack implementation was running through the MCO. The implementation of the self-hostd stack using the cluster-hosted-net-services operator might lead to cases during upgrade/downgrade in which two parallel components are running the self-hosted stack. A. If the release includes the cluster-hosted-net-services operator that means MCO in this release shouldn't include the HAProxy, CoreDNS and MDNS-Publisher static pods. B. The cluster-hosted-net-services operator will: - Have lower priority than MCO, meaning it will be applied before MCO. - Use the same code used by MCO to generate configuration files of HAProxy CoreDNS in each node. - Run the CoreDNS and HAProxy instances in each node following verification that the corresponding instance created by MCO isn't running anymore in this node (this should be applicable since both static and DaemonSet pod run on host's networking and listen on a well-known port) A and B will ensure that : - LB and DNS services will be available even when both MCO and cluster-hosted-net-services operator run the self-hosted stack. - Following upgrade to a release includes cluster-hosted-net-services operator only HAProxy ,CoreDNS and MDNS-Publisher DaemonSet pods will run. ## Alternatives Enabling/disabling of the self-hosted stack could be provided also by extending the monitor containers functionality. Currently, the self-hosted stack is implemented by: Keepalived, HAProxy, MDNS-publisher and CoreDns static pods, each one of these pods includes a monitor container which is responsible for rendering its configuration. It's possible to support enabling/disabling of the self-hosted stack in the following way: - Addition of new fields to the [controllerconfig MCO CR](https://github.com/openshift/machine-config-operator/blob/master/manifests/controllerconfig.crd.yaml). - The monitor container in each static pods should enable/disable the relevant functionality based on these fields content. The next section summarizes the pros and cons of this method. ### Pros and Cons Pros: - Ability to disable LB/DNS services. - Pods wo'nt consume actual CPU resources when service is disabled. - No need for a separate operator. - All the early clustering corner cases already covered and tested. - Easier upgrade/downgrade path since all the components continue to run under the same operator (MCO). Cons: - Self-hosted stack configuration still coupled with platform. - Not a typical operator controller implementation. - Resources(memory/CPU) for static pods are allocated even if self-hosted stack is disabled. - Is it acceptable to add these fields to the MCO CR ?

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully