<@U04UQ68083H> I deployed keto using helm chart in...
# ory-copilot
g
@chilly-king-10285 I deployed keto using helm chart in my local cluster but whenever I try to put a new tuple using
PUT /relation-tuples
I get
404 page not found
b
A message from kapa.ai
Based on the information provided in the knowledge sources, it appears that you're experiencing an issue similar to what has been reported in a GitHub issue for Ory Keto. Let me provide you with some insights and potential solutions: 1. The issue you're facing is similar to the one described in [this GitHub issue](https://github.com/ory/keto/issues/1510), where a user reported getting a "404 Page Not Found" error when trying to run a permission check. 2. It's important to note that the write API for Keto typically runs on a different port than the read API. In the example configuration provided in the issue, the write API was running on port 4467, while the read API was on port 4466. 3. To troubleshoot this issue, you could try the following: a. Ensure that you're using the correct port for the write API (typically 4467 for the write operations). b. Check your Helm chart configuration to make sure that both read and write ports are correctly exposed and mapped. c. Verify that your Keto configuration file (keto.yml) has the correct settings for the serve.write section, similar to this:
Copy code
yaml    serve:      read:        host: 0.0.0.0        port: 4466      write:        host: 0.0.0.0        port: 4467
4. If the issue persists, it might be related to how your Helm chart is configured or how the services are exposed in your Kubernetes cluster. 5. As a workaround, one user in the comments of the GitHub issue mentioned that they resolved a similar problem by using different versions for the Keto service and the initialization:
Copy code
yaml    keto:      image: oryd/keto:latest    keto-init:      image: oryd/keto:v0.9.0
However, please note that using mismatched versions is not recommended for production environments and might lead to other issues. If these suggestions don't resolve your issue, you may want to: 1. Double-check your Helm chart configuration. 2. Verify that the Keto service is running correctly in your cluster. 3. Check the logs of your Keto pods for any error messages. 4. Consider opening an issue on the [Ory Keto GitHub repository](https://github.com/ory/keto) with detailed information about your setup and the exact error you're encountering. [GitHub Issue: Self-hosting keto returns "404 Page Not Found"](https://github.com/ory/keto/issues/1510)
g
ok, seems I was using the wrong endpoint, it's actually
/admin/relation-tuples
. But when try to put a new relationI get
Copy code
{
  "error": {
    "code": 404,
    "status": "Not Found",
    "reason": "Unknown namespace with name \"default-namespace\".",
    "message": "The requested resource could not be found"
  }
}
Based on the error I assume that I need to create first a namespace but how? @chilly-king-10285
b
A message from kapa.ai
You're correct in your assumption that you need to create a namespace first before you can add relationships. The error message indicates that the namespace "default-namespace" doesn't exist. Let me guide you on how to create a namespace in Ory Keto. In Ory Keto, namespaces are defined using the Ory Permission Language (OPL). Here's how you can create a namespace: 1. First, you need to define your namespaces in a configuration file. This file is typically named
namespaces.keto.ts
or something similar. Here's an example of how to define a simple namespace:
Copy code
typescript    import { Namespace, Context } from "@ory/keto-namespace-types"        class DefaultNamespace implements Namespace {      // You can define relations and permissions here    }
2. After defining your namespaces, you need to apply this configuration to your Ory Keto instance. The exact method depends on how you've deployed Keto, but typically you would include this file in your Keto configuration. 3. If you're using Ory Network (the cloud offering), you can do this through the Ory Console. Go to PermissionsRelationships in the [Ory Console](https://console.ory.sh/projects/current/permissions/relationships) and switch to the Permission Rules tab. Here, you can paste your namespace definitions. 4. For self-hosted Keto, you would typically include this file in your configuration and restart the Keto service to apply the changes. 5. After applying the namespace configuration, Keto should recognize the new namespace, and you should be able to create relationships within it. It's important to note that Keto doesn't have a specific API endpoint for creating namespaces. Instead, namespaces are defined in the configuration and are created when Keto starts up or reloads its configuration. If you're still having trouble, you might want to: 1. Double-check your namespace configuration to ensure it's correctly defined. 2. Verify that the configuration has been properly applied to your Keto instance. 3. Restart your Keto service after applying the configuration changes. 4. Check the Keto logs for any errors related to namespace loading. If you're using a Helm chart for deployment, you might need to update your values to include the namespace configuration. For more detailed information on namespaces in Ory Keto, you can refer to the [Ory Keto documentation on namespaces](https://www.ory.sh/docs/keto/concepts/namespaces). [Ory Keto Namespaces Documentation](https://www.ory.sh/docs/keto/concepts/namespaces)