Slackbot
02/13/2023, 11:00 AMXipeng Guan
02/13/2023, 11:04 AMkubectl run test-network --rm --tty -i --restart='Never' \
--namespace default \
--image curlimages/curl \
--command -- sh -c 'curl <http://yatai.yatai-system.svc.cluster.local/api/v1/current_org>'
The above command should return:
{"message":"username in cookie is empty"}pod "test-network" deleted
Junsu Lee
02/13/2023, 11:09 AMJunsu Lee
02/13/2023, 11:23 AM ~/yatai kubectl run test-network --rm --tty -i --restart='Never' \
--namespace default \
--image curlimages/curl \
--command -- sh -c 'curl <http://yatai.yatai-system.svc.cluster.local/api/v1/current_org>'
curl: (6) Could not resolve host: yatai.yatai-system.svc.cluster.local
pod "test-network" deleted
pod default/test-network terminated (Error)
Junsu Lee
02/13/2023, 11:24 AM.
Junsu Lee
02/13/2023, 11:26 AMyatai-system
in the URL means the yatai-system-namespace
. If I make a request below, you get a normal response.
'curl <http://yatai|http://yatai>.<yatai-system-namespace>.svc.cluster.local/api/v1/current_org'
kubectl run test-network --rm --tty -i --restart='Never' \
--namespace default \
--image curlimages/curl \
--command -- sh -c 'curl <http://yatai.yatai-system-beta.svc.cluster.local/api/v1/current_org|http://yatai.yatai-system-beta.svc.cluster.local/api/v1/current_org>'
{"message":"username in cookie is empty"}pod "test-network" deleted
Junsu Lee
02/13/2023, 11:52 AMyatai-deployment
if I change the namespace of yatai-system
?Xipeng Guan
02/13/2023, 12:15 PMyatai-system.namespace
to the correct value:
helm -n yatai-deployment get values yatai-deployment > yatai-deployment-values.yaml
helm upgrade yatai-deployment bentoml/yatai-deployment -n yatai-deployment --values ./yatai-deployment-values.yaml --set yataiSystem.namespace=yatai-system-beta
kubectl -n yatai-deployment rollout restart deploy/yatai-deployment
Junsu Lee
02/13/2023, 12:23 PMXipeng Guan
02/13/2023, 12:23 PMJunsu Lee
02/13/2023, 12:26 PMhelm upgrade --install yatai-image-builder yatai-image-builder \
--set yataiSystem.namespace=$SYSTEM_NAMESPACE \
--repo <https://bentoml.github.io/helm-charts> \
-n $IMAGE_BUILDER_NAMESPACE \
--set dockerRegistry.server=$DOCKER_REGISTRY_SERVER \
--set dockerRegistry.inClusterServer=$DOCKER_REGISTRY_IN_CLUSTER_SERVER \
--set dockerRegistry.username=$DOCKER_REGISTRY_USERNAME \
--set dockerRegistry.password=$DOCKER_REGISTRY_PASSWORD \
--set dockerRegistry.secure=$DOCKER_REGISTRY_SECURE \
--set dockerRegistry.bentoRepositoryName=$DOCKER_REGISTRY_BENTO_REPOSITORY_NAME
Xipeng Guan
02/13/2023, 12:27 PMJunsu Lee
02/13/2023, 12:30 PMXipeng Guan
02/13/2023, 12:31 PMhelm get values yatai-image-builder -n yatai-image-builder
Junsu Lee
02/13/2023, 12:32 PMyataiSystem:
namespace: yatai-system-beta
Xipeng Guan
02/13/2023, 12:32 PMkubectl -n yatai-system get secret yatai-common-env -o jsonpath='{.data.YATAI_ENDPOINT}' | base64 -d
Junsu Lee
02/13/2023, 12:33 PM ~/yatai helm get values yatai-deployment -n $DEPLOYMENT_NAMESPACE
USER-SUPPLIED VALUES:
USER-SUPPLIED VALUES: null
bentoDeploymentNamespaces:
- yatai-beta
layers:
network:
ingressClass: alb
yataiServiceAccount:
namespace: yatai-system-beta
yataiSystem:
namespace: yatai-system-beta
Junsu Lee
02/13/2023, 12:34 PMkubectl -n yatai-system get secret yatai-common-env -o jsonpath='{.data.YATAI_ENDPOINT}' | base64 -d
~/yatai kubectl -n $SYSTEM_NAMESPACE get secret yatai-common-env -o jsonpath='{.data.YATAI_ENDPOINT}' | base64 -d
<http://yatai.yatai-system.svc.cluster.local>
Xipeng Guan
02/13/2023, 4:17 PMkubectl -n yatai-system-beta get secret yatai-common-env -o jsonpath='{.data.YATAI_ENDPOINT}' | base64 -d
Xipeng Guan
02/13/2023, 4:50 PMJunsu Lee
02/13/2023, 9:56 PMhelm upgrade yatai-image-builder bentoml/yatai-image-builder -n $IMAGE_BUILDER_NAMESPACE --values ./yatai-image-builder-values.yaml --set yataiSystem.namespace=$SYSTEM_NAMESPACE --set yatai.endpoint=<http://yatai>.$SYSTEM_NAMESPACE.svc.cluster.local
After applying, the yatai.endpoint has changed. However, it seems that there is a permission problem to get the api token. The error log says " `in the namespace \\\"yatai-system\\\"\"`".
1.6763248225944798e+09 ERROR registerYataiComponent {"func": "registerYataiComponent", "error": "DoJsonRequest Error: [POST]<http://yatai.yatai-system-beta.svc.cluster.local/api/v1/clusters/default/yatai_components>: POST <http://yatai.yatai-system-beta.svc.cluster.local/api/v1/clusters/default/yatai_components> status=403, {\"message\":\"get api token: failed to get yatai config in cluster default in organization default: secrets \\\"yatai-common-env\\\" is forbidden: User \\\"system:serviceaccount:yatai-system-beta:yatai\\\" cannot get resource \\\"secrets\\\" in API group \\\"\\\" in the namespace \\\"yatai-system\\\"\"}"
Xipeng Guan
02/14/2023, 4:15 AMJunsu Lee
02/14/2023, 4:49 AMkubectl -n $DEPLOYMENT_NAMESPACE rollout restart deploy/yatai-deployment
kubectl -n $IMAGE_BUILDER_NAMESPACE rollout restart deploy/yatai-image-builder
kubectl -n $DEPLOYMENT_NAMESPACE logs -f deploy/yatai-deployment
Xipeng Guan
02/14/2023, 8:49 AMkubectl -n yatai-system-beta get secret yatai-common-env
Xipeng Guan
02/14/2023, 8:50 AMyatai
deployment in yatai-system-beta
namespaceJunsu Lee
02/14/2023, 12:13 PM$ kubectl -n yatai-system-beta get secret yatai-common-env
NAME TYPE DATA AGE
yatai-common-env Opaque 2 36h
Junsu Lee
02/14/2023, 12:15 PMJunsu Lee
02/14/2023, 12:32 PMkubectl -n yatai-system-beta get secret yatai-common-env
Junsu Lee
02/14/2023, 12:49 PMJunsu Lee
02/14/2023, 12:49 PM