<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Tomasz Hanusiak on Medium]]></title>
        <description><![CDATA[Stories by Tomasz Hanusiak on Medium]]></description>
        <link>https://medium.com/@hanusiak-tomasz?source=rss-76f34ed0a420------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*qONE7rQ_SL47G9VV.jpg</url>
            <title>Stories by Tomasz Hanusiak on Medium</title>
            <link>https://medium.com/@hanusiak-tomasz?source=rss-76f34ed0a420------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 25 Nov 2026 00:01:06 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@hanusiak-tomasz/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Configuring multi-tenant Cloud Pak for Data environment on OpenShift]]></title>
            <link>https://hanusiak-tomasz.medium.com/configuring-multi-tenant-cloud-pak-for-data-environment-on-openshift-b9c713834345?source=rss-76f34ed0a420------2</link>
            <guid isPermaLink="false">https://medium.com/p/b9c713834345</guid>
            <category><![CDATA[cloud-pak-for-data]]></category>
            <category><![CDATA[ibm]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[multitenancy]]></category>
            <category><![CDATA[openshift]]></category>
            <dc:creator><![CDATA[Tomasz Hanusiak]]></dc:creator>
            <pubDate>Mon, 14 Sep 2020 23:30:09 GMT</pubDate>
            <atom:updated>2020-10-15T07:52:04.432Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*9TJH6a9ZkTpkCaSh" /></figure><p>In some scenarios you need to deploy multiple Cloud Pak for Data instances (for example Prod/Dev environments, HA configuration, separation of different services), in other cases you need to install Cloud Pak for Data next to existing solutions and you want to make sure the products don’t affect each other.</p><p>Since Cloud Pak for Data deploys in a dedicated namespace there is some initial separation, this however may not be enough. Let me share a couple of additional mechanism that can be used to keep the workloads independent.</p><p>Please make sure that you review you license agreements before you deploy multiple CP4D instances on top of a single OpenShift cluster.</p><h3>1. Dedicating a group of workers to a namespace.</h3><p>Allocating specific resources (workers) to Cloud Pak for Data can be done in various ways — there are taints, labels, toleration, etc.</p><p>In my opinion the easiest mechanism is the node-selector approach. This solution allows you to fine-tune your configuration in a few simple steps.</p><ol><li>Label nodes</li></ol><pre>oc label node mynode type=cp4d</pre><pre>oc get node mynode --show-labels</pre><p>2. Change your project configuration</p><pre>oc patch namespace myproject -p &#39;{&quot;metadata&quot;:{&quot;annotations&quot;:{&quot;openshift.io/node-selector&quot;:&quot;type=cp4d&quot;}}}&#39;</pre><p>The above will not relocate the already running pods, but any new workload will be placed on the desired workers.</p><p>You can notice this by describing a newly create pod and grepping for Node-Selectors</p><pre>oc describe pod mypod |grep Node-Selectors<br>Node-Selectors:  type=cp4d</pre><p>More details can be found in OpenShift documentation:</p><ul><li><a href="https://docs.openshift.com/container-platform/4.3/nodes/scheduling/nodes-scheduler-node-selectors.html#nodes-scheduler-node-selectors-project_nodes-scheduler-node-selectors">Placing pods on specific nodes using node selectors</a></li><li><a href="https://docs.openshift.com/container-platform/3.11/admin_guide/managing_projects.html#setting-the-project-wide-node-selector">Managing Projects</a></li></ul><h3>2. Create a dedicated Storage Class for each namespace.</h3><p>Usually a single Storage Class is used across multiple namespaces, and while this works fine, sometimes project- specific storage definition may be needed.</p><p>This can be especially useful when using a storage mechanism which is not namespace-aware — for example NFS.</p><p>Instead of keeping all the data in a single location (export path) you can separate them by defining a new Storage Class, this allows you to back up/transfer the data and configure security restrictions per project.</p><p>For example (assuming NFS):</p><pre>Provider 1:</pre><pre>      - env:<br>        - name: PROVISIONER_NAME<br>          value: cpd-storage-dev.io/nfs<br>        - name: NFS_SERVER<br>          value: 10.10.10.10<br>        - name: NFS_PATH<br>          value: /nfsdev</pre><pre>Provider 2:</pre><pre>      - env:<br>        - name: PROVISIONER_NAME<br>          value: cpd-storage-prod.io/nfs<br>        - name: NFS_SERVER<br>          value: 10.10.10.10<br>        - name: NFS_PATH<br>          value: /nfsprod</pre><h3>3. Create a new Machine Config Pool for individual projects</h3><p>This approach allows you to apply different changes to specific workers instead of modifying all workers at once.</p><p>Since OpenShift Container Platform 4.3 &amp; Cloud Pak for Data 3.0.1 we suggest the following steps to configure nodes:</p><p><a href="https://www.ibm.com/support/knowledgecenter/en/SSQNUZ_3.0.1/cpd/install/node-settings.html#node-settings__crio">https://www.ibm.com/support/knowledgecenter/en/SSQNUZ_3.0.1/cpd/install/node-settings.html#node-settings__crio</a></p><p>Please note that some MachineConfig configuration are needed and that by default only one group of workers exist in an OCP cluster.</p><p>To change this, follow this process:</p><p>Label the desired nodes</p><pre>oc label node &lt;node-name&gt; node-role.kubernetes.io/cp4d=&quot;&quot;</pre><pre>oc get node</pre><p>Create a new MachineConfigPool</p><pre>cat &lt;&lt; EOF &gt; cp4dmcp.yaml<br>apiVersion: machineconfiguration.openshift.io/v1<br>kind: MachineConfigPool<br>metadata:<br>  name: cp4d<br>spec:<br>  machineConfigSelector:<br>    matchExpressions:<br>      - {key: machineconfiguration.openshift.io/role, operator: In, values: [worker,cp4d]}<br>  nodeSelector:<br>    matchLabels:<br>      node-role.kubernetes.io/cp4d: &quot;&quot;<br>EOF</pre><pre>oc create -f cp4dmcp.yaml<br>oc get mcp</pre><p>Test it with</p><pre>cat &lt;&lt; EOF &gt; cp4dmc-test.yaml<br>apiVersion: machineconfiguration.openshift.io/v1<br>kind: MachineConfig<br>metadata:<br>  labels:<br>    machineconfiguration.openshift.io/role: cp4d<br>  name: 31-cp4d<br>spec:<br>  config:<br>    ignition:<br>      version: 2.2.0<br>    storage:<br>      files:<br>      - contents:<br>          source: data:,cp4d-test<br>        filesystem: root<br>        mode: 0644<br>        path: /etc/cp4dtest<br>EOF</pre><pre>oc create -f cp4dmc-test.yaml<br>oc get mc | grep 31-cp4d</pre><pre>Wait for the node to restart (monitor `oc get node`), finally run:</pre><pre>ssh core@&lt;node-name&gt; &#39;cat /etc/cp4dtest&#39;</pre><p>More references:<br><a href="https://access.redhat.com/solutions/4287111">https://access.redhat.com/solutions/4287111</a></p><ul><li><a href="https://access.redhat.com/solutions/5034771">Configuring Infrastructure Nodes with Taint in OpenShift 4 - Red Hat Customer Portal</a></li><li><a href="https://access.redhat.com/solutions/5034771">Configuring Infrastructure Nodes with Taint in OpenShift 4 - Red Hat Customer Portal</a></li><li><a href="https://access.redhat.com/solutions/4342791">Openshift 4 create infra machines - Red Hat Customer Portal</a></li></ul><h3>4. Configure egress IPs and/or redirection through a load balancer</h3><p>This method allows you to control the traffic coming out of your project/namespace. You may need to do so if your worker nodes are dynamic, you need to limit the number of firewall rules or you simply need to clearly differentiate between two Cloud Pak for Data instances.</p><p>The <strong>first solution involves egress IP</strong> configuration and can be achieved by modifying the NetNamespace resource and then patching hosts’ subnet settings.</p><p>Please see the following link for details:</p><p><a href="https://docs.openshift.com/container-platform/4.3/networking/openshift_sdn/assigning-egress-ips.html">Configuring egress IPs for a project</a></p><p>The <strong>second solution involves redirecting all outgoing traffic</strong> through your load balancer, this is particularly useful when dealing with air-gaped environments.</p><p>Start by modifying the load balancer configuration (for example haproxy):</p><pre>Assuming that there is a service running on exampleHost (1.2.3.4), listening on port 678.</pre><pre>Edit the configuration file of the load balancer (/etc/haproxy/haproxy.cfg) and restart the lb after applying the changes.</pre><pre>Add a `frontend` and `backend` section:</pre><pre>frontend example<br>  bind *:30678<br>  mode tcp<br>  default_backend example-tcp<br>  option tcplog</pre><pre>backend example-tcp<br>  mode tcp<br>  balance source<br>  server exampleHost 1.2.3.4:678 check</pre><p>Check that you can talk to the service through the load balancer (`curl -k -v &lt;load_balancer_ip&gt;:30678&#39;).</p><p>Once the load balancer has been configured, let’s create a Service and an Endpoint which will talk to the load balancer. This way we don’t need to use the load balancer details in our application, and the users can simply talk to the example-service as if it was the application running on exampleHost.</p><pre>cat &lt;&lt; EOF &gt; objects.yaml<br>apiVersion: v1<br>kind: Service<br>metadata:<br>  name: example-service<br>spec:<br>  clusterIP: None<br>  ports:<br>  - protocol: TCP<br>    port: 30678<br>    targetPort: 30678<br>---<br>apiVersion: v1<br>kind: Endpoints<br>metadata:<br>  name: example-service<br>subsets:<br>  - addresses:<br>    - ip: &lt;load_balancer_ip&gt;<br>    ports:<br>    - port: 30678<br>EOF</pre><pre>oc create -f objects.yaml</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b9c713834345" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Using iTerm2 to work with OpenShift clusters to manage Cloud Pak for Data]]></title>
            <link>https://hanusiak-tomasz.medium.com/using-iterm2-to-work-with-openshift-clusters-to-manage-cloud-pak-for-data-b2f3224fbca8?source=rss-76f34ed0a420------2</link>
            <guid isPermaLink="false">https://medium.com/p/b2f3224fbca8</guid>
            <category><![CDATA[iterm2]]></category>
            <category><![CDATA[cloud-pak-for-data]]></category>
            <category><![CDATA[ibm]]></category>
            <category><![CDATA[openshift]]></category>
            <category><![CDATA[kubernetes]]></category>
            <dc:creator><![CDATA[Tomasz Hanusiak]]></dc:creator>
            <pubDate>Thu, 06 Feb 2020 08:52:55 GMT</pubDate>
            <atom:updated>2020-02-06T08:53:36.081Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/609/0*bvHuRf8itQWI4VWe.jpeg" /></figure><p>As a team working with hundreds of <strong>Cloud Pak for Data </strong>clusters running on <strong>OpenShift</strong> each month (both internal and external) we had to come up with an easy, yet reliable method to simplify and increase the speed of cluster management &amp; troubleshooting.</p><p>While there are several tools that can help you do that, they usually require deploying applications/plugins onto the OpenShift cluster or modifying the underlying operating systems (for example changing the shell or adding extensions to the existing ones) — neither was really a good option to us.</p><p>We then found a great Terminal replacement for macOS —<strong> iTerm2</strong>, which allowed us to create a simple, yet powerful solution.</p><p>iTerm2 allowed us to do a couple of interesting things very easily:</p><ul><li>Define <strong>Tagged profiles</strong> so that we always know which server belongs to whom and what version/configuration of the product it has. Additionally, <strong>Dynamic Profiles</strong> are supported, so you can keep a single copy of all profiles on Box/GitHub and have the whole team share the up-to-date list of servers.</li><li>To make it even better, profiles comes with different configuration (colors, text sizes, etc.) &amp; <strong>badges</strong> so you always know which server you are on — there is nothing worse than spending an hour trying to solve a problem on a server which never had it, just because you clicked on the wrong tab. You can also define an <strong>automatic profile switching</strong>, so even if you ssh/oc to a different box, iTerm will remind you of that.</li><li>Use <strong>triggers</strong> to automate actions based on matching some regex — for example automatically <strong>prompt for passwords</strong>. Passwords are stored in macOS’s keychain, so they are safe and you don’t have to retype them every time.</li><li>Last but definitely not least — <strong>Smart Selection</strong> — this allowed us to define a set of action menu items to automate the most common actions.</li></ul><p>Let me now share a couple of screenshots, and explain how you can configure iTerm2 a similar way.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/590/1*RC7uKLZW3NUO0fk3932Oew.png" /></figure><p>Small subset of our Profiles, with corresponding tags — please note that the profiles are dynamic — each change to the configuration file will refresh the list.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4LZZQie85eaTE86JgifPGA.png" /><figcaption>To make the Profiles truly dynamic, the profiles file points at a file in Box Sync folder which is accessible by the team members. Using Git or other VCS can be considered, but Box is enough for us.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0gSbw_xpjckLFsN3TqMhGA.png" /></figure><p>Example of a Smart Selection Rule and corresponding action. Whenever the regex is matched, the actions will show up in the context menu.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CF51eS2C6LGYAMzKVu8yVQ.png" /></figure><p>Subset of actions available on selecting a line in iTerm.</p><p>Using the Smart Selectors, both Utils and Pod actions are available. No need to type the commands and copy and past the pod &amp; namespace names.</p><p>You can find a simple template with some most common actions we use here: <a href="https://github.com/Hanneck/iterm">https://github.com/Hanneck/iterm</a>.</p><p>Obviously there is a lot more you can do in iTerm — key bindings, adding custom actions to MacBook’s Touch Bar, and much, much more… Plus it’s open sourced, so you could potentially change/add any feature you’d like.</p><p>Please have a look at the list of all the features — <a href="https://iterm2.com/features.html">https://iterm2.com/features.html</a> &amp; <a href="https://github.com/gnachman/iTerm2">https://github.com/gnachman/iTerm2</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b2f3224fbca8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Implications of ungracefully killing pods.]]></title>
            <link>https://hanusiak-tomasz.medium.com/implications-of-ungracefully-killing-pods-ac7a8c87860e?source=rss-76f34ed0a420------2</link>
            <guid isPermaLink="false">https://medium.com/p/ac7a8c87860e</guid>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[cockroachdb]]></category>
            <category><![CDATA[troubleshooting]]></category>
            <category><![CDATA[containers]]></category>
            <category><![CDATA[kubernetes]]></category>
            <dc:creator><![CDATA[Tomasz Hanusiak]]></dc:creator>
            <pubDate>Mon, 29 Jul 2019 08:47:02 GMT</pubDate>
            <atom:updated>2019-07-29T08:47:02.249Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rFeyE4EbWYhSyGG79PkEZw.png" /><figcaption>Credit for the image goes to Ashley McNamara’s awesome <a href="https://github.com/ashleymcnamara/gophers">Gopher collection</a></figcaption></figure><p>We have all been in a situation where a pod is stuck in Terminating state for a long time, and it seems that they only solution left is to use the force deletion.</p><p>Looking at Kubernetes docs:</p><p><a href="https://kubernetes.io/docs/concepts/workloads/pods/pod/#termination-of-pods">https://kubernetes.io/docs/concepts/workloads/pods/pod/#termination-of-pods</a> and output of <strong><em>kubectl delete —help</em></strong>:</p><blockquote><strong>IMPORTANT</strong>: Force deleting pods does not wait for confirmation that the pod’s processes have been terminated, which can leave those processes running until the node detects the deletion and completes graceful deletion. If your processes use shared storage or talk to a remote API and depend on the name of the pod to identify themselves, force deleting those pods may result in multiple processes running on different machines using the same identification which may lead to data corruption or inconsistency. Only force delete pods when you are sure the pod is terminated, or if your application can tolerate multiple copies of the same pod running at once. Also, if you force delete pods the scheduler may place new pods on those nodes before the node has released those resources and causing those pods to be evicted immediately.</blockquote><p>suggests that it’s a risky business.</p><p>You may ask — what can go wrong? Let me give you a couple of examples, based on my experience.</p><p>Let’s assume we have a cluster of CocroachDB pods running on top of Kubernetes using Gluster as storage. In my case CocroachDB is running under <strong>metastoredb</strong> name.</p><p>If for some reason you decide to force kill one of the pods from the CocroachDB cluster, you may then hit the following problems:</p><p>CocroachDB doesn’t want to restart (stuck in <em>CrashLoopBackOff</em>) because of <em>LOCK</em> files, for example</p><blockquote>could not cleanup temporary directories from record file: could not lock temporary directory /cockroach/cockroach-data/cockroach-temp328989466, may still be in use: IO error: While lock file: /cockroach/cockroach-data/cockroach-temp328989466/TEMP_DIR.LOCK: Resource temporarily unavailable</blockquote><p>You may overcome that by accessing the underlying Gluster volume and clearing the lock files, then restarting the pods. All good?</p><p>Not necessarily, you may find that CocroachDB is now in fact starting, yet it stays in Running 0/1 status forever. Reviewing the logs doesn’t tell you much, all you can see is that its stuck on:</p><blockquote>server/config.go:541 [n?] RocksDB cache size: 256 MiB.….. server/config.go:541 [n?] store 0: RocksDB, max size 0 B, max open file limit 60536</blockquote><p>If it doesn’t really tell you anything; you may want to review the namespace events (which can give you more information that the pod’s events):</p><p><strong><em>kubectl -n &lt;namespace&gt; get events — sort-by=’{.lastTimestamp}</em></strong></p><p>Doing this you may find some reference to volume issues (like Gluster not able to provision a PV for some reason), but it’s usually not the case.</p><p>Since we killed ungracefully, we can’t be certain that the pod’s container and underlying processes are stopped.</p><p>Let’s try to find if we have some zombie containers (I recommend to have a look at this article: <a href="https://blog.phusion.nl/2015/01/20/docker-and-the-pid-1-zombie-reaping-problem/"><strong><em>https://blog.phusion.nl/2015/01/20/docker-and-the-pid-1-zombie-reaping-problem/</em></strong></a> ):</p><p><strong><em>for node in $(kubectl get nodes | grep worker| awk {‘print $1’}); do echo $node” — — -&gt;”; ssh $node ‘docker ps|grep metastore’; done</em></strong></p><pre><em>172.16.241.151-----&gt;</em></pre><pre><em>796d29ee39af              4087934f6105                      <br>&quot;/bin/bash -ecx &#39;exe…&quot;    11 days ago         Up 11 days                 k8s_zen-metastoredb_zen-metastoredb_zen_df47c06e8-11e9-9927-0016...</em></pre><pre><em>5b19738678ed              mycluster.icp:8500/ibmcom/pause:3.1   &quot;/pause&quot;                  11 days ago         Up 11 days                           k8s_POD_zen-metastoredb-0_zen_df47c06e-a6d8-11e9-9927-00163e01eee4_0</em></pre><pre><strong><em>588537823fe5              4087934f6105                          &quot;/bin/bash -ecx &#39;exe…&quot;    4 weeks ago         Up 4 weeks<br>k8s_zen-metastoredb_zen-metastoredb-0_zen_aa4eef97-97f1-11e9-9927...</em></strong></pre><p>Please have a look at the container <strong>588537823fe5 </strong>— it’s been up for 4 weeks, but notice it doesn’t have a corresponding pause pod (another reading recommendation: <a href="https://prefetch.net/blog/2018/02/19/how-the-docker-container-creation-process-works-from-docker-run-to-runc/"><strong>https://prefetch.net/blog/2018/02/19/how-the-docker-container-creation-process-works-from-docker-run-to-runc/</strong></a>)</p><p>If you run <strong><em>docker ps -a</em></strong>, we should be able to find when it stopped:</p><pre><em>1474c7af4b47              mycluster.icp:8500/ibmcom/pause:3.1 “/pause”                  4 weeks ago         </em><strong><em>Exited (0) 3 weeks ago<br></em></strong><em>k8s_POD_zen-metastoredb-0_zen_aa4eef97–97f1–11e9–9927–00163e01eee4_0</em></pre><p>You may be tempted to stop/kill the container using docker commands — this will almost certainly fail, similar to trying to exec into that container:</p><pre><em>docker exec -it 588537823fe5 sh<br>OCI runtime exec failed: exec failed: cannot exec a container that has stopped: unknown</em></pre><p>What can be done then? We can have a look at the <strong><em>docker stat </em></strong>command, and see that for Docker this container is pretty much dead (please note that there is 0 in the last (<em>PIDS</em>) column):</p><pre><em>docker stats | grep 588<br>588537823fe5 <br>k8s_POD_zen-metastoredb-0_zen_aa4eef97–97f1–11e9–9927–00163e01eee4_0 <br>0.00%   0B/0B    0.00%   0B/0B    0B/0B    0</em></pre><p>There is however a solution —<em> </em><strong><em>docker inspect</em></strong> will allow you to find the underlying process.</p><pre><em>docker inspect 588537823fe5 | grep Pid<br>“Pid”: </em><strong><em>16532</em></strong><em>,<br>...</em></pre><p>Killing that process (even with -9) may not work, since the process is also a zombie (<em>&lt;defunct&gt;</em>), however have a look at the parent process (<em>PPID</em>):</p><pre><em>ps -ef | grep </em><strong><em>[1]6532</em></strong><em><br>root </em><strong><em>16532</em></strong><em> </em><strong><em>16513</em></strong><em> 0 Jun26 ? 01:17:28 [cockroach] &lt;defunct&gt;</em></pre><pre><em>ps -ef | grep </em><strong><em>[1]6513</em></strong><em><br>root </em><strong><em>16513</em></strong><em> 5089 0 Jun26 ? 00:06:55 containerd-shim -namespace moby -workdir /var/lib/docker/containerd/daemon/io.containerd.runtime.v1.linux/moby/588537823fe55a25552dd4e34c4c836faef40190627dc56449d3c9c603a8b427 -address /var/run/docker/containerd/containerd.sock -containerd-binary /usr/bin/containerd -runtime-root /var/run/docker/runtime-runc -systemd-cgroup</em></pre><p>if it’s a shim process (<em>containerd-shim</em>) you should be able to stop it by doing kill.</p><p>At this point you should find the container removed:</p><pre><em>docker inspect 588537823fe5<br>[]<br>Error: No such object: 588537823fe5</em></pre><p>Having said all that, you may be in a situation, where even the above is not enough.</p><p>I’ve been in a situation when a pod keeps Terminating and you can’t kill the actual processes, as if something else was holding them — and in my case it was the Gluster performing a copy operation.</p><p>When I looked inside of the pod, just before it crashed, I could see that the last executed operation was:</p><pre><em>root 131 1 0 23:12 ? 00:00:00 cp -r /xxx/.ipython/profile_default /yyy/profile_py3clusterspark</em></pre><p>After looking at pod description, finding the right PVC under Volumes and the corresponding PV, I decided to check for any processes using that PV on the node where the Terminating pod resided.</p><pre><em>ps -ef | grep </em><strong><em>[p]vc-45480145–8833–11e9-ac38–00163e01f125</em></strong></pre><pre><em>root 27165 1 0 Jul11 ? 00:00:00 /usr/sbin/</em><strong><em>glusterfs</em></strong><em> — log-level=ERROR — log-file=/var/lib/kubelet/plugins/kubernetes.io/glusterfs/</em><strong><em>pvc-45480145–8833–11e9-ac38–00163e01f125</em></strong><em>/jupyter-server-1558691678299–999–68bb96c745-vhpnp-glusterfs.log — fuse-mountopts=auto_unmount — volfile-server=172.16.241.100 — volfile-server=172.16.241.100 — volfile-server=172.16.241.151 — volfile-server=172.16.242.121 — volfile-id=</em><strong><em>pvc-45480145–8833–11e9-ac38–00163e01f125</em></strong><em> — fuse-mountopts=auto_unmount /var/lib/kubelet/pods/b3398f8c-97f0–11e9–9927–00163e01eee4/volumes/kubernetes.io~glusterfs/</em><strong><em>pvc-45480145–8833–11e9-ac38–00163e01f125</em></strong></pre><p>once I killed the glusterfs process, the container shut-down nicely. All I had to do then is mount the Gluster volume, and remove the corrupted file (in <em>yyy</em>).</p><p>You may find that after all these operations, the metrics-server pod keeps crashing, like so:</p><pre>NAME                              READY  STATUS    RESTARTS   AGE     <em>metrics-server-584f5bf6f8-bqgnt   0/1    Running   5610       30d</em></pre><p>if you review the logs</p><pre><em>kubectl logs metrics-server-584f5bf6f8-bqgnt —since=1h -p<br>...<br>E0726 13:36:54.304683 1 manager.go:118] unable to save metrics: duplicate pod zen/zen-metastoredb-0 received</em></pre><p>you will see that Kubernetes complains about two copies of the pod — a solution I found is to restart <em>kubelet</em> service on the node where that pod resides.</p><p>Thanks</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ac7a8c87860e" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>