我关注了这篇文章Kubernetes configMap - 只有一个文件将配置文件传递给部署,但出现错误。为什么?
配置文件config-prom-prometheus.yml
:
scrape_configs:
- job_name: job-leo-prometheus
kubernetes_sd_configs:
- role: endpoints
Run Code Online (Sandbox Code Playgroud)
.yaml 文件prom-prometheus.yaml
:
apiVersion: apps/v1
kind: Deployment
metadata:
name: prom-prometheus-deployment
spec:
selector:
matchLabels:
app: prom-prometheus
replicas: 1
template:
metadata:
labels:
app: prom-prometheus
spec:
containers:
- name: prom-prometheus
image: 127.0.0.1:30400/prom/prometheus
ports:
- name: port9090
containerPort: 9090
volumeMounts:
- name: volume-prometheus
mountPath: /etc/prometheus/prometheus.yml
subPath: prometheus.yml
volumes:
- name: volume-prometheus
configMap:
name: config-prom
---
apiVersion: v1
kind: Service
metadata:
name: prom-prometheus
spec:
type: NodePort
ports: …
Run Code Online (Sandbox Code Playgroud) 我想使用Base64.java来编码和解码文件.Encode.wrap(InputStream)
并且decode.wrap(InputStream)
工作但是慢慢地跑了.所以我使用了以下代码.
public static void decodeFile(String inputFileName,
String outputFileName)
throws FileNotFoundException, IOException {
Base64.Decoder decoder = Base64.getDecoder();
InputStream in = new FileInputStream(inputFileName);
OutputStream out = new FileOutputStream(outputFileName);
byte[] inBuff = new byte[BUFF_SIZE]; //final int BUFF_SIZE = 1024;
byte[] outBuff = null;
while (in.read(inBuff) > 0) {
outBuff = decoder.decode(inBuff);
out.write(outBuff);
}
out.flush();
out.close();
in.close();
}
Run Code Online (Sandbox Code Playgroud)
然而,它总是抛出
Exception in thread "AWT-EventQueue-0" java.lang.IllegalArgumentException: Input byte array has wrong 4-byte ending unit
at java.util.Base64$Decoder.decode0(Base64.java:704)
at java.util.Base64$Decoder.decode(Base64.java:526)
at Base64Coder.JavaBase64FileCoder.decodeFile(JavaBase64FileCoder.java:69)
...
Run Code Online (Sandbox Code Playgroud)
之后我换 …
我注意到阻塞 gPRC 调用可能会被阻塞很长时间,如果不是永远的话。
我检查并找到了以下页面:https : //grpc.io/docs/guides/concepts.html#deadlines
但是,该页面不会告诉 Java 的默认截止日期/超时值。所以,我想知道是否有默认的 java 值。
如果没有,我可能必须为所有调用设置一个截止日期值。哪个不方便...
我遇到了 Vuetify v-carousel 的问题。左右箭头在左侧重叠的地方。
图片
Vue文件
<template>
<v-card v-if="propertyThis">
<v-carousel
cycle
hide-delimiters
>
<v-carousel-item
v-for="(item,i) in propertyThis.pictures"
:key="i"
:src="item"
/>
</v-carousel>
Run Code Online (Sandbox Code Playgroud)
package.json 文件
"dependencies": {
"vue": "^2.6.10",
"vue-class-component": "^7.0.2",
"vue-property-decorator": "^8.3.0",
"vue-router": "^3.1.3",
"vuetify": "^2.1.0",
"vuex": "^3.0.1",
"vuex-class": "^0.3.2"
},
Run Code Online (Sandbox Code Playgroud)
我没有看到这个页面上的代码有明显的不同。如何解决?
任何帮助将不胜感激。
更新:
我注释掉了 .css 文件中的所有行以及 .vue 文件中“style”标签之间的所有行。但问题仍然存在。
这是页面中的 html 部分:
<div class="v-window__prev">
<button type="button" class="v-btn v-btn--flat v-btn--icon v-btn--round theme--dark v-size--default" aria-label="Previous visual">
<span class="v-btn__content">
<i aria-hidden="true" class="v-icon notranslate mdi mdi-chevron-left theme--dark" style="font-size: 36px;"/>
</span>
</button>
</div>
<div …
Run Code Online (Sandbox Code Playgroud) java ×2
api ×1
base64 ×1
css ×1
docker ×1
frontend ×1
grpc ×1
java-8 ×1
kubectl ×1
kubernetes ×1
minikube ×1
prometheus ×1
vue.js ×1
vuejs2 ×1
vuetify.js ×1