Skip to content
This repository has been archived by the owner on Jan 18, 2023. It is now read-only.

Commit

Permalink
Repatch extended resource cmk.intel.com/exclusive-cores after kubelet…
Browse files Browse the repository at this point in the history
… restart.

Since 1.10 version of Kubernetes Kubelet sets extended resource
capacity to zero after it restarts. To repatch extended resource
cmk.intel.com/exclusive-cores "discovery" container added to
reconcile-report daemonset.

Signed-off-by: Liliia Butorina <l.butorina@partner.samsung.com>
  • Loading branch information
LilyaBu committed Aug 30, 2019
1 parent cc50f8f commit a6dfd1c
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion cmk.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
software.
--cmk-cmd-list=<list> Comma seperated list of CMK sub-commands to run
on each host
[default: init,reconcile,install,discover,nodereport].
[default: init,install,discover,rediscover,reconcile,nodereport].
--cmk-img=<img> CMK Docker image [default: cmk:v1.3.1].
--cmk-img-pol=<pol> Image pull policy for the CMK Docker image
[default: IfNotPresent].
Expand Down
2 changes: 1 addition & 1 deletion docs/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -1030,7 +1030,7 @@ $ docker run -it --volume=/etc/cmk:/etc/cmk:rw \
### `cmk uninstall`

Removes `cmk` from a node. Uninstall process reverts `cmk cluster-init`:
- deletes `cmk-reconcile-nodereport-pod-{node}` if present
- deletes `cmk-rediscover-reconcile-nodereport-pod-{node}` if present
- removes `NodeReport` from Kubernetes ThirdPartyResources if present
- removes `ReconcileReport` from Kubernetes ThirdPartyResources if present
- removes cmk node label if present
Expand Down
2 changes: 1 addition & 1 deletion docs/html/docs/cli.html
Original file line number Diff line number Diff line change
Expand Up @@ -1027,7 +1027,7 @@ <h3>
</h3>
<p>Removes <code>cmk</code> from a node. Uninstall process reverts <code>cmk cluster-init</code>:</p>
<ul>
<li>deletes <code>cmk-reconcile-nodereport-pod-{node}</code> if present</li>
<li>deletes <code>cmk-rediscover-reconcile-nodereport-pod-{node}</code> if present</li>
<li>removes <code>NodeReport</code> from Kubernetes ThirdPartyResources if present</li>
<li>removes <code>ReconcileReport</code> from Kubernetes ThirdPartyResources if present</li>
<li>removes cmk node label if present</li>
Expand Down
2 changes: 1 addition & 1 deletion docs/html/docs/operator.html
Original file line number Diff line number Diff line change
Expand Up @@ -617,7 +617,7 @@ <h2>
the recommended way to start troubleshooting is to look at the logs using <code>kubectl logs POD_NAME [CONTAINER_NAME] -f</code>.</p>
<p>For example, assuming you ran the <a href="../resources/pods/cmk-cluster-init-pod.yaml">cmk-cluster-init-pod template</a> with default options, it
should create two pods on each node named <code>cmk-init-install-discover-pod-&lt;node-name&gt;</code> and
<code>cmk-reconcile-nodereport-&lt;node-name&gt;</code>, where <code>&lt;node-name&gt;</code> should be replaced with the name of the node.</p>
<code>cmk-rediscover-reconcile-nodereport-&lt;node-name&gt;</code>, where <code>&lt;node-name&gt;</code> should be replaced with the name of the node.</p>
<p>If you want to look at the logs from the container which ran the <code>discover</code> subcommand in the pod, you can use
<code>kubectl logs -f cmk-init-install-discover-pod-&lt;node-name&gt; discover</code></p>
<p>If you want to look at the logs from the container which ran the <code>reconcile</code> subcommand in the pod, you can use
Expand Down
4 changes: 2 additions & 2 deletions docs/operator.md
Original file line number Diff line number Diff line change
Expand Up @@ -567,13 +567,13 @@ the recommended way to start troubleshooting is to look at the logs using `kubec

For example, assuming you ran the [cmk-cluster-init-pod template][cluster-init-template] with default options, it
should create two pods on each node named `cmk-init-install-discover-pod-<node-name>` and
`cmk-reconcile-nodereport-<node-name>`, where `<node-name>` should be replaced with the name of the node.
`cmk-rediscover-reconcile-nodereport-<node-name>`, where `<node-name>` should be replaced with the name of the node.

If you want to look at the logs from the container which ran the `discover` subcommand in the pod, you can use
`kubectl logs -f cmk-init-install-discover-pod-<node-name> discover`

If you want to look at the logs from the container which ran the `reconcile` subcommand in the pod, you can use
`kubectl logs -f cmk-reconcile-nodereport-pod-<node-name> reconcile`
`kubectl logs -f cmk-rediscover-reconcile-nodereport-pod-<node-name> reconcile`

If you want to remove `cmk` use `cmk-uninstall-pod.yaml`. [nodeSelector](https://kubernetes.io/docs/user-guide/node-selection)
can help to fine-grain the deletion for specific node.
Expand Down
4 changes: 3 additions & 1 deletion intel/clusterinit.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def cluster_init(host_list, all_hosts, cmd_list, cmk_img, cmk_img_pol,

# Check if all the flag values passed are valid.
# Check if cmk_cmd_list is valid.
valid_cmd_list = ["init", "discover", "install", "reconcile", "nodereport"]
valid_cmd_list = ["init", "discover", "install", "rediscover", "reconcile", "nodereport"]
for cmk_cmd in cmk_cmd_list:
if cmk_cmd not in valid_cmd_list:
raise RuntimeError("CMK command should be one of {}"
Expand Down Expand Up @@ -147,6 +147,8 @@ def run_cmd_pods(cmd_list, cmd_init_list, cmk_img, cmk_img_pol, conf_dir,
args = "/cmk/cmk.py isolate --pool=infra /cmk/cmk.py -- reconcile --interval=5 --publish" # noqa: E501
elif cmd == "nodereport":
args = "/cmk/cmk.py isolate --pool=infra /cmk/cmk.py -- node-report --interval=5 --publish" # noqa: E501
elif cmd == "rediscover":
args = "/cmk/cmk.py isolate --pool=infra /cmk/cmk.py -- discover; sleep infinity" # noqa: E501

update_pod_with_container(pod, cmd, cmk_img, cmk_img_pol, args)
elif cmd_init_list:
Expand Down
2 changes: 1 addition & 1 deletion intel/uninstall.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
def uninstall(install_dir, conf_dir, namespace):
delete_cmk_pod("cmk-init-install-discover-pod", namespace,
postfix=os.getenv("NODE_NAME"))
delete_cmk_pod("cmk-reconcile-nodereport-ds", namespace,
delete_cmk_pod("cmk-rediscover-reconcile-nodereport-ds", namespace,
postfix=os.getenv("NODE_NAME"))

delete_cmk_pod("cmk-node-report-ds-all", namespace)
Expand Down

0 comments on commit a6dfd1c

Please sign in to comment.