project-koku / korekuta

Read Only Please See: https://github.com/project-koku/korekuta-operator
https://github.com/project-koku/korekuta-operator
GNU Affero General Public License v3.0
6 stars 1 forks source link

Is this project compatible on OCP 4.x with RHCOS? #155

Closed riupie closed 4 years ago

riupie commented 4 years ago

Describe the bug I dont know is it a bug or not. So I want to implement koku on my OCP 4.2 cluster which use RHCOS as its worker node. But it get failed: Aborting, target uses selinux but python bindings (libselinux-python) aren't installed. I didnt see any possibility to install libselinux-python on RHCOS.

To Reproduce Steps to reproduce the behavior: Running this step:

./ocp_usage.sh --setup -e OCP_API="https://api.openshift-prod.mycompany.com"  -e OCP_METERING_NAMESPACE="metering" -e OCP_TOKEN_PATH="/path/to/ocp_usage_token" -e METERING_API="https://metering.metering.api.ocp.com"

Failed

Getting this error:

Aborting, target uses selinux but python bindings (libselinux-python) aren't installed.
blentz commented 4 years ago

Hi @riupie . I understand the message may be a little confusing. In this case, those playbooks are referring to localhost as the "target" system. So, the system you're running the korekuta playbooks from needs to have the SELinux bindings installed.

The OCP 4.2 cluster itself should already have the dependencies we require.

riupie commented 4 years ago

image Ok, finish installing koku. But then I got this error on my report.

chambridge commented 4 years ago

@riupie can you provide output for oc get reportquery?

Also you may want to check out the Cost Management operator. It's now available via OperatorHub from your OCP 4 cluster to make the install process simpler. Its based on the following project that aimed to make setup of OCP cost metric collection easier: https://github.com/project-koku/korekuta-operator

riupie commented 4 years ago

Output from report query:

[root@ag-koku ~]# oc get reportquery
NAME                                            AGE
cluster-cpu-capacity                            22d
cluster-cpu-capacity-raw                        22d
cluster-cpu-usage                               22d
cluster-cpu-usage-raw                           22d
cluster-cpu-utilization                         22d
cluster-memory-capacity                         22d
cluster-memory-capacity-raw                     22d
cluster-memory-usage                            22d
cluster-memory-usage-raw                        22d
cluster-memory-utilization                      22d
cluster-persistentvolumeclaim-request           22d
hccm-openshift-node-labels                      7d5h
hccm-openshift-node-labels-lookback             7d5h
hccm-openshift-persistentvolumeclaim            7d5h
hccm-openshift-persistentvolumeclaim-lookback   7d5h
hccm-openshift-usage                            7d5h
hccm-openshift-usage-lookback                   7d5h
namespace-cpu-request                           22d
namespace-cpu-usage                             22d
namespace-cpu-utilization                       22d
namespace-memory-request                        22d
namespace-memory-usage                          22d
namespace-memory-utilization                    22d
namespace-persistentvolumeclaim-request         22d
namespace-persistentvolumeclaim-usage           22d
node-cpu-allocatable                            22d
node-cpu-allocatable-raw                        22d
node-cpu-capacity                               22d
node-cpu-capacity-raw                           22d
node-cpu-utilization                            22d
node-labels-raw                                 7d5h
node-memory-allocatable                         22d
node-memory-allocatable-raw                     22d
node-memory-capacity                            22d
node-memory-capacity-raw                        22d
node-memory-utilization                         22d
persistentvolume-labels-raw                     7d5h
persistentvolumeclaim-capacity                  22d
persistentvolumeclaim-capacity-raw              22d
persistentvolumeclaim-labels-raw                7d5h
persistentvolumeclaim-phase-raw                 22d
persistentvolumeclaim-request                   22d
persistentvolumeclaim-request-raw               22d
persistentvolumeclaim-usage                     22d
persistentvolumeclaim-usage-raw                 22d
persistentvolumeclaim-usage-with-phase-raw      22d
pod-cpu-limit-raw                               7d5h
pod-cpu-request                                 22d
pod-cpu-request-raw                             22d
pod-cpu-usage                                   22d
pod-cpu-usage-raw                               22d
pod-labels-raw                                  7d5h
pod-memory-limit-raw                            7d5h
pod-memory-request                              22d
pod-memory-request-raw                          22d
pod-memory-usage                                22d
pod-memory-usage-raw                            22d
pod-persistentvolumeclaim-info-raw              7d5h
[root@ag-koku ~]# 

I will check OperatorHub version.

riupie commented 4 years ago

Btw, how to cleanup my koku installation?

chambridge commented 4 years ago

You can remove the existing resources with the following command:

oc delete report --selector cost-management=true || true && oc delete reportquery --selector cost-management=true || true && oc delete reportdatasource --selector cost-management=true 
riupie commented 4 years ago

i have installed via OperatorHub. Should I create report manually? because it only create report query.

riupie commented 4 years ago

Trying to create report manually and get the same error: image

[root@ag-bastion-server koku]# oc get reportquery -n openshift-metering --selector cost-management=true
NAME                                          AGE
cm-node-labels-raw                            11m
cm-openshift-node-labels                      10m
cm-openshift-node-labels-lookback             10m
cm-openshift-persistentvolumeclaim            10m
cm-openshift-persistentvolumeclaim-lookback   10m
cm-openshift-usage-lookback                   10m
chambridge commented 4 years ago

@riupie The cost-mgmt-operator should create the reports, no manual intervention should need to have been taken. The following should be created by the operator:

image

Operator metering is not instantaneous. The reports are hourly, it can take 2+ hours for the dependencies to align and have data.

If you don't have reports, then you should grab the Cost management operator log, in case there is some failure.

If possible, could we close this issue as I believe, we have discussed how korekuta interacts with OCP 4.x (via a RHEL system with Insights that has network connectivity to the cluster). If you continue to have problems with the korekuta-operator can you open the issue there?

chambridge commented 4 years ago

Closing so issues regarding the operator can be opened against that repository.

If you have further questions regarding this repository feel free to open another issue.