Slackbot
05/02/2023, 1:35 PMShuvy Ankor
05/02/2023, 1:38 PMPhilip Claesson
05/02/2023, 1:39 PMPhilip Claesson
05/02/2023, 1:47 PMAsaf Cohen
05/02/2023, 2:06 PMRo'e Katz
05/02/2023, 2:21 PMopal-server
in one of our environments which is actually pretty busy, the avg CPU is ~200 mcores (with some spikes towards ~1000).
As for memory usage we se it capped at ~2.5GB - but we really push opal to the limit in that regard, So I believe much less would be enough at most cases (512Mb?)
Maybe more people can share their experience with resource consumption :)Philip Claesson
05/02/2023, 2:58 PMPhilip Claesson
05/03/2023, 9:42 AMk describe
gives me
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Normal Scheduled 4m27s default-scheduler Successfully assigned uas/uas-opal-client-764897d94d-28hwh to ip-10-11-14-144.eu-west-1.compute.internal
Normal Pulling 4m26s kubelet Pulling image "<http://docker.io/permitio/opal-client:0.6.1|docker.io/permitio/opal-client:0.6.1>"
Normal Pulled 4m23s kubelet Successfully pulled image "<http://docker.io/permitio/opal-client:0.6.1|docker.io/permitio/opal-client:0.6.1>" in 2.712545837s
Warning Unhealthy 114s (x5 over 3m57s) kubelet Liveness probe failed: HTTP probe failed with statuscode: 503
Normal Killing 114s kubelet Container opal-client failed liveness probe, will be restarted
Normal Pulled 114s kubelet Container image "<http://docker.io/permitio/opal-client:0.6.1|docker.io/permitio/opal-client:0.6.1>" already present on machine
Normal Created 113s (x2 over 4m23s) kubelet Created container opal-client
Normal Started 113s (x2 over 4m23s) kubelet Started container opal-client
Warning Unhealthy 113s kubelet Readiness probe failed: Get "<http://10.11.14.127:7000/healthcheck>": dial tcp 10.11.14.127:7000: connect: connection refused
Warning Unhealthy 102s (x11 over 4m12s) kubelet Readiness probe failed: HTTP probe failed with statuscode: 503
Appears like readiness probe returns 503 - any idea why that would be?Philip Claesson
05/03/2023, 9:44 AMRo'e Katz
05/03/2023, 9:47 AMRo'e Katz
05/03/2023, 9:52 AMPhilip Claesson
05/03/2023, 12:18 PMuas-opal-client-5d487bcfb4-85bp6 opal-client ValueError: OPA Client: unexpected status code: 401, error: {'code': 'unauthorized', 'message': 'unauthorized resource access'}
This error exists because we use OPA request auth. We make sure there's a certain secret is passed to all requests before giving access to OPA: https://www.openpolicyagent.org/docs/latest/security/#authentication-and-authorization
opaStartupData:
auth.rego: >
package system.authz
default allow := {
"allowed": false,
"reason": "unauthorized resource access"
}
allow := { "allowed": true } { # Allow request if...
# logic for allowing access in here
}
If I disable this auth policy, the readiness probe works. However, that's not a solution since we don't want OPA access to be unrestricted.Philip Claesson
05/03/2023, 12:21 PMAuthorization: Bearer $KEY
header passed with the readiness probe.
2nd alternative would be to edit the auth policy to always allow requests to the endpoint the readinessprobe is using.Philip Claesson
05/03/2023, 1:21 PMPhilip Claesson
05/03/2023, 1:53 PMPhilip Claesson
05/03/2023, 2:35 PMRaz Co
05/03/2023, 2:45 PMPhilip Claesson
05/03/2023, 3:24 PMRo'e Katz
05/04/2023, 8:01 AMPhilip Claesson
05/04/2023, 8:08 AMPhilip Claesson
05/05/2023, 5:50 AMRaz Co
05/05/2023, 6:43 AMRaz Co
05/05/2023, 7:08 AMRaz Co
05/05/2023, 7:09 AMPhilip Claesson
05/05/2023, 8:19 AM