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

Add a pools.yaml generator example #230

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

omersch381
Copy link
Contributor

This patch adds an example to a pools.yaml file generator, it uses dummy data that was taken from a devstack deployment, and does not support multipool (yet).

Copy link
Contributor

openshift-ci bot commented Oct 3, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: omersch381

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved label Oct 3, 2024
@omersch381 omersch381 requested review from beagles and gthiemonge and removed request for olliewalsh October 3, 2024 09:46
@omersch381 omersch381 changed the title WIP Add a pools.yaml generator example Add a pools.yaml generator example Oct 3, 2024
attributes = map[string]string{
"type": "external",
}
pool2 := Pool{
Copy link
Collaborator

Choose a reason for hiding this comment

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

This sample data should include multiple entries for binds and mdns servers.

Generate and manage predictable IPs for each member of the bind
statefulset and store in it's own predictable IPs config map.

The reason it needs to be it's own map is that we do not want to cause
minidns to restart if a scaling change occurs on mind - nor do we want
minidns scale changes to affect bind pods.
@omersch381
Copy link
Contributor Author

The generated file I printed to the logs:
2024-10-04T15:08:31Z INFO Controllers.Designate pools.yaml content is

  • name: default
    description: DevStack BIND Pool
    attributes: {
    "pool_level": "default",
    "type": "internal",
    }

    ns_records:

    • hostname: ns1.example.org.
      priority: 1
    • hostname: ns2.example.org.
      priority: 2
    • hostname: ns3.example.org.
      priority: 3

    nameservers:

    • host: 172.28.0.99
      port: 53
    • host: 172.28.0.98
      port: 53

    targets:

    • type: bind9
      description: BIND9 Server 1 (172.28.0.99)

      masters:

      • host: 172.28.0.97
        port: 16000
      • host: 172.28.0.97
        port: 16001
      • host: 172.28.0.97
        port: 16002

      options:
      host: 172.28.0.99
      port: 53
      rndc_host: 172.28.0.99
      rndc_port: 953
      rndc_config_file: /etc/designate/rndc-keys/rndc-key-1.conf

    • type: bind9
      description: BIND9 Server 2 (172.28.0.98)

      masters:

      • host: 172.28.0.97
        port: 16000
      • host: 172.28.0.97
        port: 16001
      • host: 172.28.0.97
        port: 16002

      options:
      host: 172.28.0.98
      port: 53
      rndc_host: 172.28.0.98
      rndc_port: 953
      rndc_config_file: /etc/designate/rndc-keys/rndc-key-2.conf

when I had those before (but even if I didn't, they would get created):
~ oc get configmaps designate-mdns-ip-map -o json | jq -r '.data'; oc get configmaps designate-bind-ip-map -o json | jq -r '.data'
{
"mdns_crc-vlf7c-master-0": "172.28.0.97"
}
{
"bind_address_0": "172.28.0.98",
"bind_address_1": "172.28.0.99"
}

and that configmap, which was created in the current PR:
~ > oc get configmaps designate-pools-yaml-config-map -o json | jq '.data'
{
"designate-pools-yaml-config-map": "\n---\n- name: default\n description: DevStack BIND Pool\n attributes: {\n "pool_level": "default",\n "type": "internal",\n }\n\n ns_records:\n - hostname: ns1.example.org.\n priority: 1\n - hostname: ns2.example.org.\n priority: 2\n - hostname: ns3.example.org.\n priority: 3\n\n nameservers:\n - host: 172.28.0.99\n port: 53\n - host: 172.28.0.98\n port: 53\n\n targets:\n - type: bind9\n description: BIND9 Server 1 (172.28.0.99)\n\n masters:\n - host: 172.28.0.97\n port: 16000\n - host: 172.28.0.97\n port: 16001\n - host: 172.28.0.97\n port: 16002\n\n options:\n host: 172.28.0.99\n port: 53\n rndc_host: 172.28.0.99\n rndc_port: 953\n rndc_config_file: /etc/designate/rndc-keys/rndc-key-1.conf\n - type: bind9\n description: BIND9 Server 2 (172.28.0.98)\n\n masters:\n - host: 172.28.0.97\n port: 16000\n - host: 172.28.0.97\n port: 16001\n - host: 172.28.0.97\n port: 16002\n\n options:\n host: 172.28.0.98\n port: 53\n rndc_host: 172.28.0.98\n rndc_port: 953\n rndc_config_file: /etc/designate/rndc-keys/rndc-key-2.conf\n"
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants