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

Update minigraph.py to parse kubernetes config from minigraph.xml #6633

Merged
merged 6 commits into from
Feb 2, 2021

Conversation

renukamanavalan
Copy link
Contributor

@renukamanavalan renukamanavalan commented Feb 1, 2021

- Why I did it
To make the kubernetes server IP & enabled/disabled status configurable through minigraph.
Saved cluster name into "DEVICE_METADATA|localhost" , so this can be available for kubernetes use.

- How I did it
Updated the parser (minigraph.py) to get it from MetadataDeclaration/Devices/DeviceMetadata section for this device.
Add to "DEVICE_METADATA|localhost" , if ClusterName is available in PngDec/Devices/Device for localhost

- How to verify it
Unit test is added to parse & test out.
For manual test add the following to MetadataDeclaration/Devices/DeviceMetadata section. call "config load_minigraph" and verify through "show kube server config"

Look for "DEVICE_METADATA": { "localhost": { ... "cluster": "<this device cluster name", ...}}, if minigraph.xml does carry it in JSON dump or /etc/sonic/config_db.json

<a:DeviceProperty>
<a:Name>KubernetesEnabled</a:Name>
<a:Reference i:nil="true"/>
<a:Value>0</a:Value>
</a:DeviceProperty>
<a:DeviceProperty>
<a:Name>KubernetesServerIp</a:Name>
<a:Reference i:nil="true"/>
<a:Value>10.10.10.10</a:Value>
</a:DeviceProperty>

- Which release branch to backport (provide reason below if selected)

  • 201811
  • 201911
  • 202006
  • 202012

- Description for the changelog

- A picture of a cute animal (not mandatory but encouraged)

kcudnik
kcudnik previously approved these changes Feb 1, 2021
@qiluo-msft
Copy link
Collaborator

qiluo-msft commented Feb 2, 2021

Remove extra blank lines #Closed


Refers to: src/sonic-config-engine/tests/test_minigraph_case.py:300 in bab6ca0. [](commit_id = bab6ca0, deletion_comment = False)

@renukamanavalan
Copy link
Contributor Author

Remove extra blank lines

Refers to: src/sonic-config-engine/tests/test_minigraph_case.py:300 in bab6ca0. [](commit_id = bab6ca0, deletion_comment = False)

Can you please tell mem which file & line number ?
If it is last line in tests/test_minigraph_case.py, I have removed it.

Copy link
Collaborator

@qiluo-msft qiluo-msft left a comment

Choose a reason for hiding this comment

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

Minor format issue. Otherwise lgtm.

No logical code changes.
@renukamanavalan renukamanavalan merged commit 890545f into sonic-net:master Feb 2, 2021
lguohan pushed a commit that referenced this pull request Feb 3, 2021
)

Update minigraph parser to retrieve kubernetes server info from minigraph.xml and update "KUBERNETES_MASTER|SERVER" in running config.
Update minigraph parser to include clusterName from minigraph.xml into "DEVICE_METADATA|localhost"
deran1980 pushed a commit to deran1980/sonic-buildimage that referenced this pull request Feb 4, 2021
…nic-net#6633)

Update minigraph parser to retrieve kubernetes server info from minigraph.xml and update "KUBERNETES_MASTER|SERVER" in running config.
Update minigraph parser to include clusterName from minigraph.xml into "DEVICE_METADATA|localhost"
@renukamanavalan renukamanavalan deleted the minigraph branch July 19, 2021 16:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants