Skip to content
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

Cant enable metrics on Windows PRO 64-bit #1643

Closed
patrickmcdonogh opened this issue Nov 4, 2020 · 8 comments
Closed

Cant enable metrics on Windows PRO 64-bit #1643

patrickmcdonogh opened this issue Nov 4, 2020 · 8 comments
Labels
kind/bug Something isn't working status/stale Issue went stale; did not receive attention or no reply from the OP

Comments

@patrickmcdonogh
Copy link

General information

  • OS: Windows
  • Hypervisor: Hyper-V
  • Did you run crc setup before starting it (Yes/No)? Yes
  • Running CRC on: Desktop

CRC version

# Put `crc version` output here
CodeReady Containers version: 1.18.0+bb304aa                                                                                                                                                                               OpenShift version: 4.6.1 (embedded in binary)
  
## CRC status
```bash
# Put `crc status --log-level debug` output here
PS C:\Users\mcdon> crc status --log-level debug
DEBU CodeReady Containers version: 1.18.0+bb304aa
DEBU OpenShift version: 4.6.1 (embedded in binary)
Checking file: C:\Users\mcdon\.crc\machines\crc\.crc-exist
DEBU About to run SSH command with hidden output
DEBU SSH command succeeded
DEBU authentication operator not available, Reason: OAuthRouteCheckEndpointAccessibleController_EndpointUnavailable
DEBU About to run SSH command:
df -B1 --output=size,used,target /sysroot | tail -1
DEBU SSH command results: err: <nil>, output: 32720793600 12286414848 /sysroot
CRC VM:          Running
OpenShift:       Stopped
Disk Usage:      12.29GB of 32.72GB (Inside the CRC VM)
Cache Usage:     33.26GB
Cache Directory: C:\Users\mcdon\.crc\cache

## CRC config
```bash
# Put `crc config view` output here
PS C:\Users\mcdon> crc config view
- memory                                : 14336

## Host Operating System
```bash
# Put the output of `cat /etc/os-release` in case of Linux
# put the output of `sw_vers` in case of Mac
# Put the output of `systeminfo` in case of Windows
PS C:\Users\mcdon> systeminfo

Host Name:                 DESKTOP-FOED9GF
OS Name:                   Microsoft Windows 10 Pro
OS Version:                10.0.19042 N/A Build 19042
OS Manufacturer:           Microsoft Corporation
OS Configuration:          Standalone Workstation
OS Build Type:             Multiprocessor Free
Registered Owner:          mcdonoghpatrick@gmail.com
Registered Organization:
Product ID:                00330-81494-04672-AA965
Original Install Date:     27/10/2020, 04:37:36
System Boot Time:          04/11/2020, 09:30:59
System Manufacturer:       Micro-Star International Co., Ltd.
System Model:              MS-7C90
System Type:               x64-based PC
Processor(s):              1 Processor(s) Installed.
                           [01]: AMD64 Family 23 Model 113 Stepping 0 AuthenticAMD ~2240 Mhz
BIOS Version:              American Megatrends Inc. 1.30, 01/09/2020
Windows Directory:         C:\Windows
System Directory:          C:\Windows\system32
Boot Device:               \Device\HarddiskVolume1
System Locale:             en-gb;English (United Kingdom)
Input Locale:              en-gb;English (United Kingdom)
Time Zone:                 (UTC+00:00) Dublin, Edinburgh, Lisbon, London
Total Physical Memory:     32,694 MB
Available Physical Memory: 11,799 MB
Virtual Memory: Max Size:  37,558 MB
Virtual Memory: Available: 11,351 MB
Virtual Memory: In Use:    26,207 MB
Page File Location(s):     C:\pagefile.sys
Domain:                    WORKGROUP
Logon Server:              \\DESKTOP-FOED9GF
Hotfix(s):                 6 Hotfix(s) Installed.
                           [01]: KB4580419
                           [02]: KB4562830
                           [03]: KB4570334
                           [04]: KB4577266
                           [05]: KB4580325
                           [06]: KB4579311
Network Card(s):           4 NIC(s) Installed.
                           [01]: Realtek PCIe 2.5GbE Family Controller
                                 Connection Name: Ethernet
                                 Status:          Media disconnected
                           [02]: Intel(R) Wi-Fi 6 AX200 160MHz
                                 Connection Name: WiFi
                                 DHCP Enabled:    Yes
                                 DHCP Server:     192.168.1.1
                                 IP address(es)
                                 [01]: 192.168.1.23
                                 [02]: fe80::e8ea:22f6:9016:6852
                                 [03]: fdaa:bbcc:ddee:0:6dfe:4b5c:4151:adcf
                                 [04]: fd9b:b517:6f48:1:6dfe:4b5c:4151:adcf
                                 [05]: fdaa:bbcc:ddee:0:e8ea:22f6:9016:6852
                                 [06]: fd9b:b517:6f48:1:e8ea:22f6:9016:6852
                           [03]: Bluetooth Device (Personal Area Network)
                                 Connection Name: Bluetooth Network Connection
                                 Status:          Media disconnected
                           [04]: Hyper-V Virtual Ethernet Adapter
                                 Connection Name: vEthernet (Default Switch)
                                 DHCP Enabled:    No
                                 IP address(es)
                                 [01]: 192.168.32.1
                                 [02]: fe80::8d1d:f8ce:832c:dcf
Hyper-V Requirements:      A hypervisor has been detected. Features required for Hyper-V will not be displayed.

### Steps to reproduce

  1.  crc config set memory 14336
  2.  crc setup
  3.  crc start -p C:\Utilities\OpenShift\crc-windows-1.18.0-amd64\pull-secret -m 14336
  4.  oc get clusterversion version -ojsonpath='{range .spec.overrides[*]}{.name}{"\n"}{end}' | % {$nl++;"`t$($nl-1) `t $_"};$nl=0 

When i try to get the cluster version as described in the documentation i get this error:
PS C:\Users\mcdon> oc get clusterversion version -ojsonpath='{range .spec.overrides[*]}{.name}{"\n"}{end}' | % {$nl++;"`t$($nl-1) `t $_"};$nl=0
error: error parsing jsonpath {range .spec.overrides[*]}{.name}{\n}{end}, unrecognized character in action: U+005C '\'

### Expected
I expected to get a list of values

### Actual
I get the error. 

I am trying to get metrics working in code ready containers so that I can use the horizontal auto scaling feature. I get the error above.

If i remove the {"\n"} value i can see the list and can deduce that cluster-monitoring-operator would have index 0

PS C:\Users\mcdon> oc get clusterversion version -ojsonpath='{range .spec.overrides[*]}{.name}{end}' | % {$nl++;"`t$($nl-1) `t $_"};$nl=0
        0        cluster-monitoring-operatormachine-config-operatoretcd-quorum-guardmachine-api-operatorcluster-autoscaler-operatorinsights-operatorprometheus-k8scloud-credential-operatorcsi-snapshot-controller-operatorcluster-storage-operatorkube-storage-version-migrator-operator

Then if i run the next command this fails as well. 

PS C:\Users\mcdon> oc patch clusterversion/version --type='json' -p '[{"op":"remove", "path":"/spec/overrides/0"}]'
The request is invalid

Therefore i dont know how to get metrics and autoscaling working. Any help would be greatly appreciated. I am following the documentation here : https://access.redhat.com/documentation/en-us/red_hat_codeready_containers/1.17/html/getting_started_guide/administrative-tasks_gsg#starting-monitoring-alerting-telemetry_gsg

### Logs

Before gather the logs try following if that fix your issue
```bash
$ crc delete -f
$ crc cleanup
$ crc setup
$ crc start --log-level debug

This did not fix the issue

@patrickmcdonogh patrickmcdonogh added the kind/bug Something isn't working label Nov 4, 2020
@patrickmcdonogh
Copy link
Author

Is this a known issue? Is there a workaround to get metrics enabled so we can try horizontal scalability based on CPU usage?

@neodingo
Copy link

neodingo commented Nov 9, 2020

Came here because I am having the exact same issue. I'm suspecting that the documentation is bad as there were a few other things that needed me to change them about before they would work right. Some of the tour/tutorial bits are no longer accurate/working as well.

@kowen-rh
Copy link
Contributor

kowen-rh commented Nov 9, 2020

@neodingo Would you mind explaining what you needed to change in order to work? I'm trying to address the documentation and would appreciate any input that you have. :)

@neodingo
Copy link

neodingo commented Nov 9, 2020

@robin-owen Definitely, happy to help, I'll be spinning up another instance tomorrow as part of helping a friend get acquainted to OpenShift for his new job so I'll add his eyes to the mix so I don't miss anything. I'd do it today but the wife/child are a bit under the weather so I'm on nurse duty till the plague tests come back.

Edit: I'll also get a much more complete diagnostic dump while I'm at it. The system I ran into that same error upon has had a re-install since last night for completely unrelated reasons (new nvme drive arrived, fresh install).

@patrickmcdonogh
Copy link
Author

The instructions which we are following that give this error are in the "Getting Started Guide" in Chapter 6. Administrative tasks

https://access.redhat.com/documentation/en-us/red_hat_codeready_containers/1.17/html/getting_started_guide/administrative-tasks_gsg#starting-monitoring-alerting-telemetry_gsg

If you look at Procedure and Windows there is this command to get a list of operators
PS> oc get clusterversion version -ojsonpath='{range .spec.overrides[*]}{.name}{"\n"}{end}' | % {$nl++;"t$($nl-1) t $_"};$nl=0

Then this command to turn on metrics
$ oc patch clusterversion/version --type='json' -p '[{"op":"remove", "path":"/spec/overrides/"}]'
clusterversion.config.openshift.io/version patched

Neither of these work on windows 10.

We are trying to get metrics so we can use horizontal pod auto scaling

@adrianriobo
Copy link
Contributor

adrianriobo commented Nov 13, 2020

It seems there is a problem with escaped characters. Can you try escaping ", like this:

oc get clusterversion version -ojsonpath='{range .spec.overrides[*]}{.name}{\"\n\"}{end}' | % {$nl++;"`t$($nl-1) `t $_"};$nl=0

Then pick the index from the output and substitute from the next command:

oc patch clusterversion/version --type='json' -p '[{\"op\":\"remove\", \"path\":\"/spec/overrides/<cluster-monitoring-operator-index>\"}]'

This should work

@gbraad
Copy link
Contributor

gbraad commented Nov 18, 2020

@patrickmcdonogh can you verify the solution? Documentation changes have been made

@stale
Copy link

stale bot commented Jan 17, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the status/stale Issue went stale; did not receive attention or no reply from the OP label Jan 17, 2021
@gbraad gbraad closed this as completed Jan 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working status/stale Issue went stale; did not receive attention or no reply from the OP
Projects
None yet
Development

No branches or pull requests

5 participants