SREWorks icon indicating copy to clipboard operation
SREWorks copied to clipboard

install error

Open justzx2011 opened this issue 3 years ago • 8 comments

my k8s version is v1.25.6+k3s1 error message: helm install sreworks ./ --create-namespace --namespace sreworks --set global.accessMode="nodePort" --set appmanager.home.url="http://127.0.0.1:30767" --set saas.onlyBase=true Error: INSTALLATION FAILED: rendered manifests contain a resource that already exists. Unable to continue with install: ClusterRole "local-path-provisioner-role" in namespace "" exists and cannot be imported into the current release: invalid ownership metadata; label validation error: missing key "app.kubernetes.io/managed-by": must be set to "Helm"; annotation validation error: missing key "meta.helm.sh/release-name": must be set to "sreworks"; annotation validation error: missing key "meta.helm.sh/release-namespace": must be set to "sreworks"

justzx2011 avatar Feb 28 '23 09:02 justzx2011

看起来默认的storageclass供应方案和您已安装的local-path-provisioner冲突了。 请使用您集群已有的storageclass即可。

--set global.storageClass="***"

Twwy avatar Feb 28 '23 09:02 Twwy

k get storageclass -A NAME PROVISIONER RECLAIMPOLICY VOLUMEBINDINGMODE ALLOWVOLUMEEXPANSION AGE local-path (default) rancher.io/local-path Delete WaitForFirstConsumer false 81m

helm install sreworks ./ --create-namespace --namespace sreworks --set global.accessMode="nodePort" --set appmanager.home.url="http://127.0.0.1:30767" --set saas.onlyBase=true --set global.storageClass="local-path" Error: INSTALLATION FAILED: rendered manifests contain a resource that already exists. Unable to continue with install: ClusterRole "local-path-provisioner-role" in namespace "" exists and cannot be imported into the current release: invalid ownership metadata; label validation error: missing key "app.kubernetes.io/managed-by": must be set to "Helm"; annotation validation error: missing key "meta.helm.sh/release-name": must be set to "sreworks"; annotation validation error: missing key "meta.helm.sh/release-namespace": must be set to "sreworks"

justzx2011 avatar Mar 01 '23 03:03 justzx2011

my k8s create by rancher desktop on mac m1,

after delete storageClass、clusterrole,i can install,but:

k logs sreworks-core-init-job-7fnkn -n sreworks Error: Post "http://sreworks-appmanager/oauth/token": dial tcp 10.43.92.52:80: connect: connection refused

  • read line
  • python3 /root/plugins/pack.py -f /root/plugins/traits/service-gateway.trait.sreworks.io/v1beta1/ -t /tmp/plugin /tmp/plugin.zip
  • /root/swcli plugin upload --config /swcli/swcli.yaml '--filepath=/tmp/plugin.zip' '--overwrite=true' Error: Post "http://sreworks-appmanager/oauth/token": dial tcp 10.43.92.52:80: connect: connection refused
  • rm /tmp/plugin.zip
  • cat /root/plugins/traits/service-gateway.trait.sreworks.io/v1beta1//definition.yaml
  • awk '{print $NF}'
  • awk -F '"' '{print $2}'
  • grep definition.oam.dev/version
  • version=1.0.7
  • echo traits/service-gateway.trait.sreworks.io/v1beta1/
  • awk -F / '{print $2"/"$3}' 1.0.7
  • name=service-gateway.trait.sreworks.io/v1beta1
  • echo 1.0.7
  • echo service-gateway.trait.sreworks.io/v1beta1 service-gateway.trait.sreworks.io/v1beta1
  • /root/swcli plugin operate --config /swcli/swcli.yaml '--name=service-gateway.trait.sreworks.io/v1beta1' '--version=1.0.7' '--operation=enable' Error: Post "http://sreworks-appmanager/oauth/token": dial tcp 10.43.92.52:80: connect: connection refused
  • read line
  • echo 'all the plugins upload to the appmanager' all the plugins upload to the appmanager
  • cd /root/saas/swcore/api/core/
  • cat /run/secrets/kubernetes.io/serviceaccount/namespace
  • export 'NAMESPACE_ID=sreworks'
  • '[[' false '==' true ]]
  • python /app/patch_meta_yaml.py /root/saas/swcore/build
  • python /app/pack.py --src /root/saas/swcore/build --dest /root/saas/swcore/build.zip
  • '[[' nodePort '==' ingress ]]
  • envsubst
  • /root/swcli --config /swcli/swcli.yaml app-package import '--app-id=flycore' --filepath /root/saas/swcore/build.zip '--print-only-app-package-id=true' '--reset-version=true' Error: Post "http://sreworks-appmanager/oauth/token": dial tcp 10.43.92.52:80: connect: connection refused
  • result= bjzhangxin@MacBook-Pro-3 sreworks-chart % k get pod -n sreworks|egrep -v "Running" NAME READY STATUS RESTARTS AGE sreworks-core-init-job-7fnkn 0/1 CrashLoopBackOff 5 (106s ago) 4m53s sreworks-appmanager-cluster-initjob-lbk7r 0/1 CrashLoopBackOff 8 (87s ago) 31m

k logs sreworks-appmanager-cluster-initjob-lbk7r -n sreworks

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/app/sbin/cluster_init.py", line 165, in init_cluster(AppManagerClient(ENDPOINT, CLIENT_ID, CLIENT_SECRET, USERNAME, PASSWORD).client) File "/app/sbin/cluster_init.py", line 75, in init self._token = self._fetch_token() File "/app/sbin/cluster_init.py", line 86, in _fetch_token return oauth.fetch_token( File "/usr/local/lib/python3.9/site-packages/requests_oauthlib/oauth2_session.py", line 341, in fetch_token r = self.request( File "/usr/local/lib/python3.9/site-packages/requests_oauthlib/oauth2_session.py", line 521, in request return super(OAuth2Session, self).request( File "/usr/local/lib/python3.9/site-packages/requests/sessions.py", line 587, in request resp = self.send(prep, **send_kwargs) File "/usr/local/lib/python3.9/site-packages/requests/sessions.py", line 701, in send r = adapter.send(request, **kwargs) File "/usr/local/lib/python3.9/site-packages/requests/adapters.py", line 565, in send raise ConnectionError(e, request=request) requests.exceptions.ConnectionError: HTTPConnectionPool(host='sreworks-appmanager', port=80): Max retries exceeded with url: /oauth/token (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x400364a340>: Failed to establish a new connection: [Errno 111] Connection refused'))

curl http://127.0.0.1:30767/ curl: (7) Failed to connect to 127.0.0.1 port 30767 after 4 ms: Connection refused

justzx2011 avatar Mar 01 '23 04:03 justzx2011

k get storageclass -A NAME PROVISIONER RECLAIMPOLICY VOLUMEBINDINGMODE ALLOWVOLUMEEXPANSION AGE local-path (default) rancher.io/local-path Delete WaitForFirstConsumer false 81m

helm install sreworks ./ --create-namespace --namespace sreworks --set global.accessMode="nodePort" --set appmanager.home.url="http://127.0.0.1:30767" --set saas.onlyBase=true --set global.storageClass="local-path" Error: INSTALLATION FAILED: rendered manifests contain a resource that already exists. Unable to continue with install: ClusterRole "local-path-provisioner-role" in namespace "" exists and cannot be imported into the current release: invalid ownership metadata; label validation error: missing key "app.kubernetes.io/managed-by": must be set to "Helm"; annotation validation error: missing key "meta.helm.sh/release-name": must be set to "sreworks"; annotation validation error: missing key "meta.helm.sh/release-namespace": must be set to "sreworks"

不好意思,还差个参数

--set global.storageClass="***" \
--set localPathProvisioner=false

Twwy avatar Mar 01 '23 06:03 Twwy

my k8s create by rancher desktop on mac m1,

after delete storageClass、clusterrole,i can install,but:

k logs sreworks-core-init-job-7fnkn -n sreworks Error: Post "http://sreworks-appmanager/oauth/token": dial tcp 10.43.92.52:80: connect: connection refused

  • read line
  • python3 /root/plugins/pack.py -f /root/plugins/traits/service-gateway.trait.sreworks.io/v1beta1/ -t /tmp/plugin /tmp/plugin.zip
  • /root/swcli plugin upload --config /swcli/swcli.yaml '--filepath=/tmp/plugin.zip' '--overwrite=true' Error: Post "http://sreworks-appmanager/oauth/token": dial tcp 10.43.92.52:80: connect: connection refused
  • rm /tmp/plugin.zip
  • cat /root/plugins/traits/service-gateway.trait.sreworks.io/v1beta1//definition.yaml
  • awk '{print $NF}'
  • awk -F '"' '{print $2}'
  • grep definition.oam.dev/version
  • version=1.0.7
  • echo traits/service-gateway.trait.sreworks.io/v1beta1/
  • awk -F / '{print $2"/"$3}' 1.0.7
  • name=service-gateway.trait.sreworks.io/v1beta1
  • echo 1.0.7
  • echo service-gateway.trait.sreworks.io/v1beta1 service-gateway.trait.sreworks.io/v1beta1
  • /root/swcli plugin operate --config /swcli/swcli.yaml '--name=service-gateway.trait.sreworks.io/v1beta1' '--version=1.0.7' '--operation=enable' Error: Post "http://sreworks-appmanager/oauth/token": dial tcp 10.43.92.52:80: connect: connection refused
  • read line
  • echo 'all the plugins upload to the appmanager' all the plugins upload to the appmanager
  • cd /root/saas/swcore/api/core/
  • cat /run/secrets/kubernetes.io/serviceaccount/namespace
  • export 'NAMESPACE_ID=sreworks'
  • '[[' false '==' true ]]
  • python /app/patch_meta_yaml.py /root/saas/swcore/build
  • python /app/pack.py --src /root/saas/swcore/build --dest /root/saas/swcore/build.zip
  • '[[' nodePort '==' ingress ]]
  • envsubst
  • /root/swcli --config /swcli/swcli.yaml app-package import '--app-id=flycore' --filepath /root/saas/swcore/build.zip '--print-only-app-package-id=true' '--reset-version=true' Error: Post "http://sreworks-appmanager/oauth/token": dial tcp 10.43.92.52:80: connect: connection refused
  • result= bjzhangxin@MacBook-Pro-3 sreworks-chart % k get pod -n sreworks|egrep -v "Running" NAME READY STATUS RESTARTS AGE sreworks-core-init-job-7fnkn 0/1 CrashLoopBackOff 5 (106s ago) 4m53s sreworks-appmanager-cluster-initjob-lbk7r 0/1 CrashLoopBackOff 8 (87s ago) 31m

k logs sreworks-appmanager-cluster-initjob-lbk7r -n sreworks

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/app/sbin/cluster_init.py", line 165, in init_cluster(AppManagerClient(ENDPOINT, CLIENT_ID, CLIENT_SECRET, USERNAME, PASSWORD).client) File "/app/sbin/cluster_init.py", line 75, in init self._token = self._fetch_token() File "/app/sbin/cluster_init.py", line 86, in _fetch_token return oauth.fetch_token( File "/usr/local/lib/python3.9/site-packages/requests_oauthlib/oauth2_session.py", line 341, in fetch_token r = self.request( File "/usr/local/lib/python3.9/site-packages/requests_oauthlib/oauth2_session.py", line 521, in request return super(OAuth2Session, self).request( File "/usr/local/lib/python3.9/site-packages/requests/sessions.py", line 587, in request resp = self.send(prep, **send_kwargs) File "/usr/local/lib/python3.9/site-packages/requests/sessions.py", line 701, in send r = adapter.send(request, **kwargs) File "/usr/local/lib/python3.9/site-packages/requests/adapters.py", line 565, in send raise ConnectionError(e, request=request) requests.exceptions.ConnectionError: HTTPConnectionPool(host='sreworks-appmanager', port=80): Max retries exceeded with url: /oauth/token (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x400364a340>: Failed to establish a new connection: [Errno 111] Connection refused'))

curl http://127.0.0.1:30767/ curl: (7) Failed to connect to 127.0.0.1 port 30767 after 4 ms: Connection refused

先看一下内置mysql是否起来,然后appmanager这个pod有没有running。这里大概需要等待5-10分钟左右。在appmanager pod running了之后,这个sreworks-core-init-job才能够成功注入底座应用。如果还有问题。麻烦kubectl get pod -nsrewors截取贴一下。

Twwy avatar Mar 01 '23 06:03 Twwy

image k logs sreworks-appmanager-cluster-initjob-qfmbt -n sreworks image

justzx2011 avatar Mar 01 '23 08:03 justzx2011

image

justzx2011 avatar Mar 02 '23 01:03 justzx2011

image

看起来是appmanager启动有问题,您方便把appmanager的日志dump出来发一下吗?

Twwy avatar Mar 02 '23 07:03 Twwy