-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Enable switch to join kubernetes master transparently, if configured #4474
Conversation
Introduced a new table: "KUBERNETES_MASTER": { "SERVER": { "IP": "10.10.10.10", "insecure": "false" } } In Minigraph: Under <MetadataDeclaration>/<Devices>/<DeviceMetadata>/<Name>...</Name>/<Properties>, added new entities as below <a:DeviceProperty> <a:Name>KubernetesMaster</a:Name> <a:Reference i:nil="true"/> <a:Value>10.10.10.10</a:Value> </a:DeviceProperty> <a:DeviceProperty> <a:Name>KubernetesInsecure</a:Name> <a:Reference i:nil="true"/> <a:Value>true</a:Value> </a:DeviceProperty> 1) Updated minigraph.py to read & write this new data 2) Updated hostcfgd to watch "KUBERNETES_MASTER" and call join/reset connection to master depending on if IP address is configured or not 3) Added helper scripts kube_join.sh & kube_reset.sh for join/reset respectively
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As comments
1) Dropped insecure 2) Finer tweaks
This pull request introduces 1 alert when merging 46ce50f into 4adf243 - view on LGTM.com new alerts:
|
retest vs please. |
retest vsimage please. |
2) Call for update, even if insecure's value changed.
Improved nodename to contain SONiC version, to distinguish. During reset, drain & delete node, to enable join later.
7895ea4
to
ba7fc22
Compare
Writing kube commands as python package. A sonic-utilities PR #962 is under review. An updated new PR will be raised for build image. Hence closing this PR. |
When configured, hostcfgd watches and call join/reset connection to master, depending on whether IP address is non-empty/empty. If master is not available at that time point, the kube_join script, creates a cron job to retry every 10 minutes, until the server is reachable.
Introduced a new table in config-db:
connection to master depending on if IP address is configured or not
Code algorithm: