-
Notifications
You must be signed in to change notification settings - Fork 26
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
Unable to connect opa-docker-authz.sock #51
Comments
Are there any other logs ? Any more information from running |
Also what's different between the pre-prod and prod environments ? |
It is same except that traffic is more in prod
…On Wed, Sep 16, 2020, 15:17 Ashutosh Narkar ***@***.***> wrote:
Also what's different between the pre-prod and prod environments ?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#51 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABV4VKUZFY2NXT6RJORFUYTSGE2N5ANCNFSM4RPPE65Q>
.
|
In that case, have you tried allotting more resources to check if the system is not exhausted ? |
Ashutosh,
You were right, both CPU and Memory(RAM) in the pod spiked way above the
requested amount.
Resources in pod spec:
resources:
requests:
memory: 4G
cpu: 1
Actual consumption:
![image](https://user-images.githubusercontent.com/7064234/93518039-2462b480-f8e1-11ea-94f1-4fb6a5f2b1c5.png)
We can increase the resources to a higher level but not to 25G, but memory
keeps on increasing. I suspect a memory leak or other issue? Could you
help me debug this?
Thanks,
Rama
|
Memory usage typically depends on the size of the data and policy that you load into OPA. This page provides more details on resource utilization. Do you have an estimate of these values ? |
This is the policy, it just evaluates only one field.
I don't control the data, docker sends the input data to OPA plugin Here is a sample input data with Body as null.
When Body is not null, data is around 6kb. In 60 minutes OPA docker plugin processed around 2000 request. Is there a way for me to control the size of the data? |
@ashutosh-narkar Can you suggest a way to reduce the data or another way to avoid this 'huge' memory consumption by OPA docker plugin? |
The data seems pretty small. Have you documented OPA's memory usage with time ? And also how much memory have you allocated so far ? |
resource request is 4GB, but the actual usage went upto 25GB and then connection to scoket is lost. So we had to start docker-DIND without OPA plugin to get it working back |
@ramapalani Can you provide an example of how to reproduce the issue ? Any scripts that you have to simulate the traffic etc. would be helpful. |
I'll try to reproduce this in our pre-prod environment and share it with you. |
@ashutosh-narkar I'm trying to reproduce this in pre-prod env. As part of this effort, I was checking whether the socket is open every minute using a simple shell script. I also collect open file and processes running at the failed instance. Though I'm not exactly reproduce the issue as in prod env, I see opa socket is not listening often. Here is one instance of the failure. Many times the next check works fine and but failures do happen frequently. Test script
Failure
Full log file is attached: testsocket.log |
Hmm you're getting a segmentation fault. What system are you running this on ? |
We run docker DIND (docker in docker) container as a Kuberenetes daemonset. This is the image docker:18.09.5-dind. OPA docker plugin is installed into this instance of docker. |
@ashutosh-narkar I couldn't reproduce this issue in pre-prod environment, but we encounter this in production environment (with higher traffic) consistently after a short period. So I created a custom plugin, to prevent privileged container creation and that works well. |
That's great ! Is that custom plugin using OPA ? |
No, created a fresh docker authorization plugin totally separate from OPA |
I'm trying to run OPA docker plugin as part of Daemonset DIND (docker-in-docker).
Followed steps in this tutorial: https://www.openpolicyagent.org/docs/latest/docker-authorization/#goals
Only rule that in the rego file is to prevent privileged containers. This works as expected in a pre-prod environment. When we run this in prod env, it works as expected for about an hour, after that OPA plugin is not reachable. Docker logs has messages like these
time="2020-09-06T19:08:06.723350267Z" level=warning msg="Unable to connect to plugin: /run/docker/plugins/e680e3fff81e36d08a68f15256251be43a41a9a090f37f1c353f8d5fb95465a8/opa-docker-authz.sock/AuthZPlugin.AuthZReq: Post http://%2Frun%2Fdocker%2Fplugins%2Fe680e3fff81e36d08a68f15256251be43a41a9a090f37f1c353f8d5fb95465a8%2Fopa-docker-authz.sock/AuthZPlugin.AuthZReq: dial unix /run/docker/plugins/e680e3fff81e36d08a68f15256251be43a41a9a090f37f1c353f8d5fb95465a8/opa-docker-authz.sock: connect: connection refused, retrying in 1s"
time="2020-09-06T19:08:21.759791345Z" level=error msg="Handler for POST /v1.39/images/create returned error: plugin openpolicyagent/opa-docker-authz-v2:0.7 failed with error: Post http://%2Frun%2Fdocker%2Fplugins%2Fe680e3fff81e36d08a68f15256251be43a41a9a090f37f1c353f8d5fb95465a8%2Fopa-docker-authz.sock/AuthZPlugin.AuthZReq: dial unix /run/docker/plugins/e680e3fff81e36d08a68f15256251be43a41a9a090f37f1c353f8d5fb95465a8/opa-docker-authz.sock: connect: connection refused"
Daemonset definition:
authz.rego/
The text was updated successfully, but these errors were encountered: