Skip to content

Commit

Permalink
k8s/windows: tweaks to windows installation guide
Browse files Browse the repository at this point in the history
Please note that New Relic does not provide support for windows installations.
fixup! k8s/windows: typo
  • Loading branch information
roobre committed Jan 31, 2022
1 parent a7b082f commit 2794405
Showing 1 changed file with 72 additions and 43 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,70 +24,98 @@ To run our Kubernetes installation for Windows, follow the steps below to:
Before you install [New Relic's Kubernetes integration](/docs/integrations/kubernetes-integration/get-started/introduction-kubernetes-integration), review the [compatibility and requirements](/docs/integrations/kubernetes-integration/get-started/kubernetes-integration-compatibility-requirements).

<Callout variant="important">
When using containers in Windows, the container host version and the container image version must be the same. Our Kubernetes integration supports Windows versions 1809 and 1909.
When using containers in Windows, the container host version and the container image version must be the same. Our Kubernetes integration can run on Windows versions LTSC 2019 (1809), 20H2, and LTSC 2022.
</Callout>

To check your Windows version:

1. Open a command window.
2. Run the following command:

```
Reg Query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v
```shell
Reg Query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v
ReleaseIdcmd.exe
```

### Example: Get Kubernetes for Windows from a BusyBox container.

```shell
kubectl exec -it busybox1-766bb4d6cc-rmsnj -- Reg Query
"HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v ReleaseId
```
$ kubectl exec -it busybox1-766bb4d6cc-rmsnj -- Reg Query
"HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v ReleaseId
```

You should see something like:

```
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion
ReleaseId REG_SZ 1809
```

A useful mapping between Release IDs and OS versions can be found [here](https://hub.docker.com/_/microsoft-windows-servercore).

## Install [#k8-windows-install]

You can install the Kubernetes integration for Windows using Helm. See an example on how to install the integration in a cluster with nodes having different build versions of Windows (1809 and 2004):

1. Install [kube-state-metrics](https://github.com/kubernetes/kube-state-metrics#kubernetes-deployment "Link opens in a new window.") and run it in your cluster using this snippet:
1. Add the New Relic Helm charts repo:

```
curl -L -o kube-state-metrics-1.9.5.zip
https://github.com/kubernetes/kube-state-metrics/archive/v1.9.5.zip &&
unzip kube-state-metrics-1.9.5.zip && kubectl apply -f
kube-state-metrics-1.9.5/examples/standard
```
2. Create a `values.yml` file with the follow data to be used by Helm:
```shell
helm repo add newrelic https://helm-charts.newrelic.com
```

```
global:
licenseKey: <YOUR_LICENSE_KEY>
cluster: <YOUR_CLUSTER_NAME>
enableLinux: false
enableWindows: true
windowsOsList:
- version: 1809
imageTag: 2.2.0-windows-1809-alpha
buildNumber: 10.0.17763
- version: 2004
imageTag: 2.2.0-windows-2004-alpha
buildNumber: 10.0.19041
```
3. Install the integration with:
2. Create a namespace for newrelic:

```
helm install <YOUR_INSTALL_NAME> newrelic/newrelic-infrastructure -f values.yml
```
4. Confirm that the `DaemonSet` has been created successfully by looking for `newrelic-infra` in the results generated by this command:
```shell
kubectl create namespace <mark>newrelic</mark>
```

```
kubectl get daemonsets
```
3. Install kube-state-metrics.

```shell
helm repo add ksm https://kubernetes.github.io/kube-state-metrics
helm install ksm ksm/kube-state-metrics --version 2.13.2
```

<Callout variant="important">
The command above allows installing kube-state-metrics, which is a mandatory dependency of the integration, on a linux node. If you cluster does not have any linux node, the command above might not work. New Relic cannot offer support on how to install kube-state-metrics on non-linux nodes.
</Callout>


4. Create a `values.yml` file with the follow data to be used by Helm:

```yaml
global:
licenseKey: <var>YOUR_NEW_RELIC_LICENSE_KEY</var>
cluster: <var>K8S_CLUSTER_NAME</var>

enableLinux: <mark>true</mark> # Set to true if your cluster also has linux nodes
enableWindows: true
windowsOsList:
- version: 2019 # Human-readable version identifier
imageTag: 2-windows-1809-alpha # Tag to be used for nodes running the windows version above
buildNumber: 10.0.17763 # Build number for your nodes running the version above. Used as a selector.
- version: 20h2
imageTag: 2-windows-20H2-alpha
buildNumber: 10.0.19042
- version: 2022
imageTag: 2-windows-ltsc2022-alpha
buildNumber: 10.0.20348
```

5. Install the integration with:

```shell
helm upgrade --install <mark>newrelic</mark> newrelic/newrelic-infrastructure \
--namespace <mark>newrelic</mark> --create-namespace \
--version 3.2.11 \
-f values-newrelic.yaml
```

6. Check that pods are being deployed and reach a stable state:

```shell
kubectl -n <mark>newrelic</mark> get pods -w
```

The Helm chart will create one DeamonSet per each version of Windows that is in the list and use NodeSelector to deploy the corresponding Pod per Node.

Expand Down Expand Up @@ -125,11 +153,12 @@ There are a couple of issues with the Windows version of Kubelet that can preven

* [Issue 90554:](https://github.com/kubernetes/kubernetes/pull/90554) This issue makes the Kubelet return 500 errors when the integration makes a request to the `/stats/summary` endpoint. It will be included in the Kubernetes 1.19 release and has been backported to the releases 1.16.11, 1.17.7, and 1.18.4. There is no solution on the integration side for this problem, we advise you to update to one of the patch versions as soon as possible. You can see if you're being affected by this problem by [enabling verbose logs](/docs/integrations/kubernetes-integration/troubleshooting/get-logs-version#verbose) and looking for messages of the type:

```
error querying Kubelet. Get "https://<var><KUBELET_IP></var>/stats/summary": error calling kubelet endpoint. Got status code: 500
```
```
error querying Kubelet. Get "https://<var><KUBELET_IP></var>/stats/summary": error calling kubelet endpoint. Got status code: 500
```

* [Issue 87730:](https://github.com/kubernetes/kubernetes/pull/87730) This issue makes the Kubelet metrics very slow when running minimal load. It makes the integration fail with a timeout error. A patch for this issue has been added for Kubernetes 1.18 and backported to 1.15.12, 1.16.9, and 1.17.5. We advise you to update to one of the patch versions as soon as possible. To mitigate this issue you can increase the integration timeout with the [`TIMEOUT` config option](/docs/integrations/kubernetes-integration/installation/kubernetes-integration-install-configure#kube-state-metrics-timeout-change). You can see if you're being affected by this problem by [enabling verbose logs](/docs/integrations/kubernetes-integration/troubleshooting/get-logs-version#verbose) and looking for messages of the type:

```
error querying Kubelet. Get "https://<var><KUBELET_IP></var>/stats/summary": context deadline exceeded (Client.Timeout exceeded while awaiting headers)
```
```
error querying Kubelet. Get "https://<var><KUBELET_IP></var>/stats/summary": context deadline exceeded (Client.Timeout exceeded while awaiting headers)
```

0 comments on commit 2794405

Please sign in to comment.