romil
04/12/2022, 6:11 AMapiVersion: "v1"
kind: "Service"
metadata:
name: "spicedb"
labels:
app: "spicedb"
spec:
selector:
app: "spicedb"
type: "LoadBalancer"
ports:
- name: "grpc"
port: 50051
protocol: "TCP"
** targetPort: 50051
** - name: "internal"
port: 50053
protocol: "TCP"
targetPort: 50053
- name: "http"
port: 8443
protocol: "TCP"
targetPort: 8443
-------
spec:
dnsPolicy: "ClusterFirst"
restartPolicy: "Always"
terminationGracePeriodSeconds: 30
containers:
- name: "spicedb"
image: "quay.io/authzed/spicedb"
imagePullPolicy: "IfNotPresent"
command: ["spicedb", "serve"]
args:
- grpc-no-tls
- --http-enabled
- --dispatch-upstream-addr=kubernetes:///spicedb.authz:50051
------
I assume these are internal port that needs to be configured and not the one expose .
Any view why the error still coming ?user
04/12/2022, 6:12 AM--dispatch-upstream-addr
should be pointing to 50053user
04/12/2022, 6:12 AMromil
04/12/2022, 6:13 AMromil
04/12/2022, 6:19 AMargs:
- grpc-no-tls
- --http-enabled
- --dispatch-upstream-addr=kubernetes:///spicedb.authz:50053
user
04/12/2022, 6:20 AM--grpc-preshared-key $YOUR_SECRET
. All CLI flags can also be done with environment variables e.g. SPICEDB_GRPC_PRESHARED_KEY
if you want to mount the value from a secretuser
04/12/2022, 6:21 AM--grpc-no-tls
flag anymoreromil
04/12/2022, 6:21 AMkubectl -n authz create secret generic spicedb --from-literal=SPICEDB_GRPC_PRESHARED_KEY=graphToken
user
04/12/2022, 6:22 AMquay.io/authzed/spicedb:v1.6.0
romil
04/12/2022, 6:23 AMimage: "quay.io/authzed/spicedb"
user
04/12/2022, 6:23 AMIfNotPresent
user
04/12/2022, 6:26 AMromil
04/12/2022, 6:29 AM2022/04/12 06:28:35 ERROR: kuberesolver: watching ended with error='invalid response code 403 for service spicedb in namespace authz', will reconnect again
{"level":"info","grpc.component":"server","grpc.method":"Check","grpc.method_type":"unary","grpc.service":"grpc.health.v1.Health","peer.address":"127.0.0.1:51358","protocol":"grpc","requestID":"6c8c5a8ceea2160f692ae2baa4668703","grpc.request.deadline":"2022-04-12T06:28:36Z","grpc.start_time":"2022-04-12T06:28:35Z","grpc.code":"OK","grpc.time_ms":"0.046","time":"2022-04-12T06:28:35Z","message":"started call"}
{"level":"info","grpc.component":"server","grpc.method":"Check","grpc.method_type":"unary","grpc.service":"grpc.health.v1.Health","peer.address":"127.0.0.1:51358","protocol":"grpc","requestID":"6c8c5a8ceea2160f692ae2baa4668703","grpc.request.deadline":"2022-04-12T06:28:36Z","grpc.start_time":"2022-04-12T06:28:35Z","grpc.code":"OK","grpc.time_ms":"0.302","time":"2022-04-12T06:28:35Z","message":"finished call"}
2022/04/12 06:28:36 ERROR: kuberesolver: watching ended with error='invalid response code 403 for service spicedb in namespace authz', will reconnect again
user
04/12/2022, 6:29 AMromil
04/12/2022, 6:30 AMcontainers:
- name: "spicedb"
image: "quay.io/authzed/spicedb:v1.6.0"
imagePullPolicy: "IfNotPresent"
command: ["spicedb", "serve"]
args:
- grpc-no-tls
- --http-enabled
- --dispatch-upstream-addr=kubernetes:///spicedb.authz:50053
env:
- name: "SPICEDB_GRPC_SHUTDOWN_GRACE_PERIOD"
value: "1s"
- name: "SPICEDB_LOG_LEVEL"
value: "debug"
- name: "SPICEDB_GRPC_PRESHARED_KEY"
valueFrom:
secretKeyRef:
name: "spicedb"
key: "SPICEDB_GRPC_PRESHARED_KEY"
ports:
- name: "grpc"
containerPort: 50051
protocol: "TCP"
- name: "internal"
containerPort: 50053
protocol: "TCP"
readinessProbe:
exec:
command: ["grpc_health_probe", "-v", "-addr=localhost:50051"]
failureThreshold: 5
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 5
user
04/12/2022, 6:30 AMromil
04/12/2022, 6:31 AMuser
04/12/2022, 6:32 AMuser
04/12/2022, 6:32 AMromil
04/12/2022, 6:33 AMuser
04/12/2022, 6:34 AMromil
04/12/2022, 8:59 AMapiVersion: v1
kind: ServiceAccount
metadata:
name: spicedb
namespace: authz
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
namespace: authz
name: watch-service
rules:
- apiGroups: [""] # "" indicates the core API group
resources: ["endpoints"]
verbs: ["get", "watch"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: spicedb-watch-service
namespace: authz
subjects:
- kind: ServiceAccount
name: spicedb
roleRef:
kind: Role
name: watch-service
apiGroup: rbac.authorization.k8s.io
I still get below error :
kuberesolver: watching ended with error='invalid response code 403 for service spicedb in namespace authz', will reconnect again
balchu
04/12/2022, 1:21 PMbalchu
04/12/2022, 1:21 PMromil
04/12/2022, 2:16 PMbalchu
04/12/2022, 2:21 PMromil
04/12/2022, 2:36 PMmissing required field "apiGroup" in io.k8s.api.rbac.v1.RoleRef; if you choose to ignore these errors, turn validation off with --validate=false
balchu
04/12/2022, 2:39 PMbalchu
04/12/2022, 2:41 PMauthz
namespaceromil
04/12/2022, 2:45 PM