Repository: kubermatic/machine-controller
Pull request #1578 (2023-02-27 10:17:43)

[release/v1.54] Anexia Provider: configure rpc-statd service as kubelet dependency
**What this PR does / why we need it**:
This is a manual cherry-pick of https://github.com/kubermatic/machine-controller/pull/1553




**Does this PR introduce a user-facing change? Then add your Release Note here**:
<!--
Write your release note:
1. Enter your extended release note in the below block. If the PR requires additional action from users switching to the new release, include the string "action required".
2. If no release note is required, just write "NONE".
-->
```release-note
Enables "rpc-statd" service on new Anexia Machines using Flatcar with cloud-init to enable NFS functionality required by Anexia CSI driver.
```




kubermatic-bot: [APPROVALNOTIFIER] This PR is **NOT APPROVED**

This pull-request has been approved by: *<a href="https://github.com/kubermatic/machine-controller/pull/1578#" title="Author self-approved">marioreggiori</a>*
**Once this PR has been reviewed and has the lgtm label**, please assign moadqassem for approval by writing `/assign @moadqassem` in a comment. For more information see [the Kubernetes Code Review Process](https://git.k8s.io/community/contributors/guide/owners.md#the-code-review-process).

The full list of commands accepted by this bot can be found [here](https://go.k8s.io/bot-commands?repo=kubermatic%2Fmachine-controller).

<details open>
Needs approval from an approver in each of these files:

- **[pkg/userdata/OWNERS](https://github.com/kubermatic/machine-controller/blob/release/v1.54/pkg/userdata/OWNERS)**

Approvers can indicate their approval by writing `/approve` in a comment
Approvers can cancel approval by writing `/approve cancel` in a comment
</details>
<!-- META={"approvers":["moadqassem"]} -->
kubermatic-bot: Hi @marioreggiori. Thanks for your PR.

I'm waiting for a [kubermatic](https://github.com/orgs/kubermatic/people) member to verify that this patch is reasonable to test. If it is, they should reply with `/ok-to-test` on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should [join the org](https://github.com/orgs/kubermatic/people) to skip this step.

Once the patch is verified, the new status will be reflected by the `ok-to-test` label.

I understand the commands that are listed [here](https://go.k8s.io/bot-commands?repo=kubermatic%2Fmachine-controller).

<details>

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.
</details>

kubermatic-bot: LGTM label has been added.  <details>Git tree hash: ae92a6212e80455c569c0b6606c33f0d9a9df88d</details>
kubermatic-bot: [APPROVALNOTIFIER] This PR is **APPROVED**

This pull-request has been approved by: *<a href="https://github.com/kubermatic/machine-controller/pull/1578#pullrequestreview-1315431260" title="Approved">ahmedwaleedmalik</a>*, *<a href="https://github.com/kubermatic/machine-controller/pull/1578#" title="Author self-approved">marioreggiori</a>*

The full list of commands accepted by this bot can be found [here](https://go.k8s.io/bot-commands?repo=kubermatic%2Fmachine-controller).

The pull request process is described [here](https://git.k8s.io/community/contributors/guide/owners.md#the-code-review-process)

<details >
Needs approval from an approver in each of these files:

- ~~[pkg/userdata/OWNERS](https://github.com/kubermatic/machine-controller/blob/release/v1.54/pkg/userdata/OWNERS)~~ [ahmedwaleedmalik]

Approvers can indicate their approval by writing `/approve` in a comment
Approvers can cancel approval by writing `/approve cancel` in a comment
</details>
<!-- META={"approvers":[]} -->
kubermatic-bot: @marioreggiori: The following test **failed**, say `/retest` to rerun all failed tests or `/retest-required` to rerun all mandatory failed tests:

Test name | Commit | Details | Required | Rerun command
--- | --- | --- | --- | ---
pull-machine-controller-e2e-vsphere | 3e57db2ff9a7bdadf2cc0b8c1425474abc7593d9 | [link](https://public-prow.loodse.com/view/gs/prow-dev-public-data/pr-logs/pull/kubermatic_machine-controller/1578/pull-machine-controller-e2e-vsphere/1630174290206789632) | true | `/test pull-machine-controller-e2e-vsphere`

[Full PR test history](https://public-prow.loodse.com/pr-history?org=kubermatic&repo=machine-controller&pr=1578)

<details>

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
</details>
<!-- test report -->
kubermatic-bot: @marioreggiori: The following tests **failed**, say `/retest` to rerun all failed tests or `/retest-required` to rerun all mandatory failed tests:

Test name | Commit | Details | Required | Rerun command
--- | --- | --- | --- | ---
pull-machine-controller-e2e-vsphere | 3e57db2ff9a7bdadf2cc0b8c1425474abc7593d9 | [link](https://public-prow.loodse.com/view/gs/prow-dev-public-data/pr-logs/pull/kubermatic_machine-controller/1578/pull-machine-controller-e2e-vsphere/1630174290206789632) | true | `/test pull-machine-controller-e2e-vsphere`
pull-machine-controller-e2e-vmware-cloud-director | 3e57db2ff9a7bdadf2cc0b8c1425474abc7593d9 | [link](https://public-prow.loodse.com/view/gs/prow-dev-public-data/pr-logs/pull/kubermatic_machine-controller/1578/pull-machine-controller-e2e-vmware-cloud-director/1630174289363734528) | true | `/test pull-machine-controller-e2e-vmware-cloud-director`

[Full PR test history](https://public-prow.loodse.com/pr-history?org=kubermatic&repo=machine-controller&pr=1578)

<details>

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
</details>
<!-- test report -->
kubermatic-bot: @marioreggiori: The following tests **failed**, say `/retest` to rerun all failed tests or `/retest-required` to rerun all mandatory failed tests:

Test name | Commit | Details | Required | Rerun command
--- | --- | --- | --- | ---
pull-machine-controller-e2e-vsphere | 3e57db2ff9a7bdadf2cc0b8c1425474abc7593d9 | [link](https://public-prow.loodse.com/view/gs/prow-dev-public-data/pr-logs/pull/kubermatic_machine-controller/1578/pull-machine-controller-e2e-vsphere/1630174290206789632) | true | `/test pull-machine-controller-e2e-vsphere`
pull-machine-controller-e2e-vmware-cloud-director | 3e57db2ff9a7bdadf2cc0b8c1425474abc7593d9 | [link](https://public-prow.loodse.com/view/gs/prow-dev-public-data/pr-logs/pull/kubermatic_machine-controller/1578/pull-machine-controller-e2e-vmware-cloud-director/1630174289363734528) | true | `/test pull-machine-controller-e2e-vmware-cloud-director`
pull-machine-controller-e2e-kubevirt | 3e57db2ff9a7bdadf2cc0b8c1425474abc7593d9 | [link](https://public-prow.loodse.com/view/gs/prow-dev-public-data/pr-logs/pull/kubermatic_machine-controller/1578/pull-machine-controller-e2e-kubevirt/1630174286838763520) | true | `/test pull-machine-controller-e2e-kubevirt`

[Full PR test history](https://public-prow.loodse.com/pr-history?org=kubermatic&repo=machine-controller&pr=1578)

<details>

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
</details>
<!-- test report -->
xrstf: Please adjust the release branch, these are not flakes.

/override pull-machine-controller-e2e-kubevirt
/override pull-machine-controller-e2e-vmware-cloud-director
/override pull-machine-controller-e2e-vsphere

kubermatic-bot: @xrstf: Overrode contexts on behalf of xrstf: pull-machine-controller-e2e-kubevirt, pull-machine-controller-e2e-vmware-cloud-director, pull-machine-controller-e2e-vsphere

<details>

In response to [this](https://github.com/kubermatic/machine-controller/pull/1578#issuecomment-1446302167):

>Please adjust the release branch, these are not flakes.
>
>/override pull-machine-controller-e2e-kubevirt
>/override pull-machine-controller-e2e-vmware-cloud-director
>/override pull-machine-controller-e2e-vsphere
>


Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.
</details>

Patch:
diff --git a/pkg/userdata/flatcar/provider.go b/pkg/userdata/flatcar/provider.go
index 7ffc944c..a80b0934 100644
--- a/pkg/userdata/flatcar/provider.go
+++ b/pkg/userdata/flatcar/provider.go
@@ -637,6 +637,12 @@ coreos:
         [Unit]
         Requires=download-script.service
         After=download-script.service
+{{- if eq .CloudProviderName "anexia" }}
+    - name: 50-rpc-statd.conf
+      content: |
+        [Unit]
+        Wants=rpc-statd.service
+{{- end }}
     content: |
 {{ kubeletSystemdUnit .ContainerRuntimeName .KubeletVersion .KubeletCloudProviderName .MachineSpec.Name .DNSIPs .ExternalCloudProvider .ProviderSpec.Network.GetIPFamily .PauseImage .MachineSpec.Taints .ExtraKubeletFlags false | indent 6 }}
 


Test patch:
diff --git a/pkg/userdata/flatcar/testdata/cloud-init_v1.22.7.yaml b/pkg/userdata/flatcar/testdata/cloud-init_v1.22.7.yaml
index fc618282..4c913e42 100644
--- a/pkg/userdata/flatcar/testdata/cloud-init_v1.22.7.yaml
+++ b/pkg/userdata/flatcar/testdata/cloud-init_v1.22.7.yaml
@@ -97,6 +97,10 @@ coreos:
         [Unit]
         Requires=download-script.service
         After=download-script.service
+    - name: 50-rpc-statd.conf
+      content: |
+        [Unit]
+        Wants=rpc-statd.service
     content: |
       [Unit]
       After=docker.service
diff --git a/pkg/userdata/flatcar/testdata/cloud-init_v1.23.5.yaml b/pkg/userdata/flatcar/testdata/cloud-init_v1.23.5.yaml
index c9e4ce26..4b3d947a 100644
--- a/pkg/userdata/flatcar/testdata/cloud-init_v1.23.5.yaml
+++ b/pkg/userdata/flatcar/testdata/cloud-init_v1.23.5.yaml
@@ -97,6 +97,10 @@ coreos:
         [Unit]
         Requires=download-script.service
         After=download-script.service
+    - name: 50-rpc-statd.conf
+      content: |
+        [Unit]
+        Wants=rpc-statd.service
     content: |
       [Unit]
       After=docker.service
diff --git a/pkg/userdata/flatcar/testdata/cloud-init_v1.24.0.yaml b/pkg/userdata/flatcar/testdata/cloud-init_v1.24.0.yaml
index 6a5277d6..8a2334ed 100644
--- a/pkg/userdata/flatcar/testdata/cloud-init_v1.24.0.yaml
+++ b/pkg/userdata/flatcar/testdata/cloud-init_v1.24.0.yaml
@@ -97,6 +97,10 @@ coreos:
         [Unit]
         Requires=download-script.service
         After=download-script.service
+    - name: 50-rpc-statd.conf
+      content: |
+        [Unit]
+        Wants=rpc-statd.service
     content: |
       [Unit]
       After=containerd.service