因为我想运行 Puppeteer@1.19 但在 page.pdf() 中遇到错误。
刚刚提到的一些 blob 将 Chromium 从版本 76 降级到 73。如何使用 node:alpine-12 在 Dockerfile 中做到这一点?谢谢
以下是我的设置(铬版本为 76):
FROM node:12-alpine
##########
## Setting for using Puppeteer (for using node:XX-alpine)
##########
ENV CHROME_BIN="/usr/bin/chromium-browser"\
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD="true"
##########
## Update and Install packages
##########
RUN set -x \
&& apk update \
&& apk upgrade \
&& echo "127.0.0.1 localhost" >> /etc/hosts \
&& echo "http://dl-cdn.alpinelinux.org/alpine/edge/testing" > /etc/apk/repositories \
&& echo "http://dl-cdn.alpinelinux.org/alpine/edge/community" >> /etc/apk/repositories \
&& echo "http://dl-cdn.alpinelinux.org/alpine/edge/main" >> /etc/apk/repositories \
# add …Run Code Online (Sandbox Code Playgroud) 我仅将资源分配给 1 个 pod,内存为 650MB/30%(使用其他内置 pod,限制内存仅为 69%)
但是在pod处理过程中,pod的使用率在650MB以内,但是node的整体使用率为94%。
为什么会发生,因为它的上限应该是 69%?是不是因为其他内置的 pod 没有设置限制?如果内存使用率 > 100%,有时我的 pod 会出错,如何防止这种情况发生?
我的分配设置 ( kubectl describe nodes):

Kubernetes Node 和 Pod 空闲时的内存使用情况:
kubectl top nodes

kubectl top pods

运行任务时 Kubernetes Node 和 Pod 的内存使用情况:
kubectl top nodes

kubectl top pods

进一步测试的行为:
1. 在命名空间test-ns下准备部署、pods 和服务
2. 由于只有kube-system和test-ns有 pods,所以分配 1000Mi 给它们每个 (from kubectl describe nodes) 目标是小于 2GB
3. 假设内存在kube-system和test-ns 中使用将小于 2GB 小于 100%,为什么内存使用率可以是 106%?
在.yaml …
在我可以运行此命令kubectl logs <pod>而没有问题很多天/版本之前。但是,在我最近推送另一个映像并部署后,我遇到了以下错误:
来自服务器的错误:获取https://aks-agentpool-xxx-0:10250/containerLogs/default/ <-pod->/<-service->: 拨号 tcp 10.240.0.4:10250: i/o 超时
我尝试重新构建和重新部署但失败了。
我尝试仅使用以下设置,但结果页眉和页脚位置将会更改。请指教。
await page.pdf({
path: FILENAME,
format: 'A4',
margin: {
top: "0px",
right: "0px",
bottom: "0px",
left: "0px"
},
printBackground: true // required for photos otherwise blank
});
Run Code Online (Sandbox Code Playgroud) 可以在 NodeJS 代码中使用 Azure Pipelines(构建/发布)中的变量吗?
如果没有,在 WebApp 中设置的变量是否也可以在 NodeJS 代码中使用?
我在管道的构建和发布中以及 .yaml 文件中的以下环境设置中设置了变量 TESTING & TESTING2:
spec:
containers:
- name: devops
env:
- name: TESTING
value: $(TESTING)
Run Code Online (Sandbox Code Playgroud)
然后只是尝试在 NodeJS 中打印:
process.env.TESTING --> $(TESTING)
process.env.TESTING2 --> 未定义
这对我不起作用。
我的指标服务器突然无法工作并得到以下信息:
$ kubectl get apiservices |egrep metrics
v1beta1.metrics.k8s.io kube-system/metrics-server False (MissingEndpoints)
Run Code Online (Sandbox Code Playgroud)
我尝试在下面实现但仍然不行:
$ git clone https://github.com/kubernetes-incubator/metrics-server.git
$ cd metrics-server
$ kubectl apply -f deploy/1.8+/
Run Code Online (Sandbox Code Playgroud)
请指教,谢谢。
Alpine 于 80 月 8 日支持 Chromium v77。
参考:https : //pkgs.alpinelinux.org/packages?name=chromium&branch=edge
尝试复制下载 Chromium v77 并运行 Puppeteer v1.20 的步骤,但在运行时出现错误:
Error for printPdf()
{}
Error: Failed to launch chrome!
Error relocating /usr/lib/chromium/chrome: _ZNSt7__cxx1118basic_stringstreamIcSt11char_traitsIcESaIcEEC1Ev: symbol not found
Error relocating /usr/lib/chromium/chrome: _ZNSt7__cxx1119basic_ostringstreamIcSt11char_traitsIcESaIcEEC1Ev: symbol not found
Error relocating /usr/lib/chromium/chrome: hb_subset_input_set_retain_gids: symbol not found
Error relocating /usr/lib/chromium/chrome: _ZNSt19_Sp_make_shared_tag5_S_eqERKSt9type_info: symbol not found
TROUBLESHOOTING: https://github.com/GoogleChrome/puppeteer/blob/master/docs/troubleshooting.md
at onClose (/usr/src/app/node_modules/puppeteer/lib/Launcher.js:348:14)
at Interface.<anonymous> (/usr/src/app/node_modules/puppeteer/lib/Launcher.js:337:50)
at Interface.emit (events.js:214:15)
at Interface.close (readline.js:403:8)
at Socket.onend (readline.js:180:10)
at Socket.emit (events.js:214:15)
at endReadableNT (_stream_readable.js:1178:12)
at …Run Code Online (Sandbox Code Playgroud) Web Services 定期出现错误日志:
错误 - 站点 YYY 的容器 XXX 未在预期时间限制内启动。经过的时间 = 230.3790706 秒
我设置了微软博客中已经提到的以下设置,但仍然失败:
1. Use the EXPOSE instruction in your Dockerfile to expose port 3000.
2. Use the WEBSITES_PORT app setting with a value of "3000" to expose that port.
Run Code Online (Sandbox Code Playgroud)
如何配置来防止此错误?
web-services timeout azure azure-web-app-service azure-web-app-for-containers
docker ×4
node.js ×4
azure-aks ×3
kubernetes ×3
puppeteer ×3
alpine-linux ×2
azure ×2
chromium ×2
timeout ×2
azure-devops ×1
azure-web-app-for-containers ×1
kubectl ×1
margin ×1
memory-limit ×1
metrics ×1
nodes ×1
scale ×1
tcp ×1
variables ×1
web-services ×1