Dmitry Meyerson
06/02/2023, 10:03 PMDmitry Meyerson
06/02/2023, 10:04 PM% kubectl logs svc/dev-cerbos -n dev-namespae
{"log.level":"info","@timestamp":"2023-06-02T19:32:35.742Z","log.logger":"cerbos.server","message":"maxprocs: Leaving GOMAXPROCS=8: CPU quota undefined"}
{"log.level":"info","@timestamp":"2023-06-02T19:32:35.743Z","log.logger":"cerbos.server","message":"Loading configuration from /config/config.yaml"}
{"log.level":"info","@timestamp":"2023-06-02T19:32:35.744Z","log.logger":"cerbos.disk.store","message":"Initializing disk store from /work"}
{"log.level":"info","@timestamp":"2023-06-02T19:32:35.744Z","log.logger":"cerbos.index","message":"Found 0 executable policies"}
{"log.level":"info","@timestamp":"2023-06-02T19:32:35.744Z","log.logger":"cerbos.telemetry","message":"Anonymous telemetry enabled. Disable via the config file or by setting the CERBOS_NO_TELEMETRY=1 environment variable"}
Dmitry Meyerson
06/02/2023, 10:05 PM"message":"Found 0 executable policies"
msgDmitry Meyerson
06/02/2023, 10:06 PMDmitry Meyerson
06/02/2023, 10:07 PMDmitry Meyerson
06/02/2023, 10:07 PM% kubectl exec -it dev-cerbos-9f8fc69c9-crrnz -n dev-namespace /bin/sh
kubectl exec [POD] [COMMAND] is DEPRECATED and will be removed in a future version. Use kubectl exec [POD] -- [COMMAND] instead.
error: Internal error occurred: error executing command in container: failed to exec in container: failed to start exec "3d84c7966505518cff7f35baa923dd52059bfff0715a417d809de60364fef1fd": OCI runtime exec failed: exec failed: unable to start container process: exec: "/bin/sh": stat /bin/sh: no such file or directory: unknown
Dmitry Meyerson
06/02/2023, 10:08 PMDmitry Meyerson
06/02/2023, 10:11 PM/cerbos
prefix that I strip w/ traefik middleware before the request hits the serviceDmitry Meyerson
06/02/2023, 10:12 PMDmitry Meyerson
06/02/2023, 10:18 PMDmitry Meyerson
06/02/2023, 11:02 PMoguzhan
{
"log.level": "info",
"@timestamp": "2023-06-02T19:32:35.744Z",
"log.logger": "cerbos.disk.store",
"message": "Initializing disk store from /work"
}
I see the log.logger
field set as cerbos.disk.store
in the above log which means either the configuration is not right, or cerbos is running with the default configuration (default configuration sets the store as disk
).
If the configuration file you’ve created has git
as a store, you could ensure it is provided to cerbos container correctly.Dmitry Meyerson
06/06/2023, 4:59 PMcerbos:
service:
type: ClusterIP
httpPort: 3592
grpcPort: 3593
httpNodePort: 13592
grpcNodePort: 13593
envFrom:
- secretRef:
name: cerbos-github-token
config:
driver: "git"
git:
protocol: https
# git URL
url: my-git-url.cerbos-ABAC.git
# Replace with the branch name of your repo.
branch: some_branch
# Remove or leave empty if the policies are not stored in a subdirectory.
#subDir: hr
# Path to checkout. By default, /work is a Kubernetes emptyDir volume that is only available for the lifetime of the pod.
# If you want the work directory to persist between pod restarts, specify the mount path of a persistent volume here.
#checkoutDir: /work
# How often the remote repo should be checked for updates.
updatePollInterval: 60s
# Credentials used to login to the remote GitHub repo. We are using an environment variable mounted from the secret we created earlier.
https:
username: ${GITHUB_TOKEN}
password: ""
Charith (Cerbos)
service
and envFrom
sections should be at the top level. The storage configuration should be under cerbos.config.storage
. Try with this fixed config:
service:
type: ClusterIP
httpPort: 3592
grpcPort: 3593
httpNodePort: 13592
grpcNodePort: 13593
envFrom:
- secretRef:
name: cerbos-github-token
cerbos:
config:
storage:
driver: "git"
git:
protocol: https
url: my-git-url.cerbos-ABAC.git
branch: some_branch
updatePollInterval: 60s
https:
username: ${GITHUB_TOKEN}
password: ""
See https://github.com/cerbos/cerbos/blob/main/deploy/charts/cerbos/values-git-storage.yaml for an example.Charith (Cerbos)
kubectl debug
to launch an ephemeral container with a shell. https://kubernetes.io/docs/reference/generated/kubectl/kubectl-commands#debugDmitry Meyerson
06/12/2023, 3:50 PMkubecl debug
Dmitry Meyerson
06/12/2023, 3:52 PMDmitry Meyerson
06/12/2023, 3:54 PMCharith (Cerbos)
Dmitry Meyerson
06/12/2023, 4:06 PMDmitry Meyerson
06/12/2023, 6:22 PM