我需要能够运行 shell 脚本(我的脚本用于初始化我的数据库集群)来初始化 Kubernetes 中的 pod,
我不想在 dockerfile 中创建脚本,因为我直接从网络获取图像,所以我不想碰它。
所以我想知道是否有办法将我的脚本放入我的其中一卷中,以便我可以像这样执行它:
spec:
containers:
- name: command-demo-container
image: debian
command: ["./init.sh"]
restartPolicy: OnFailure
Run Code Online (Sandbox Code Playgroud) 我知道在TeamCity中我可以查看某个构建和跟随他的构建之间的更改,甚至可以查看某个构建到上一个成功构建之间的更改.
我想知道我是否可以看到我选择的两个TeamCity版本之间的更改(git提交).
示例:构建1.0.2以构建1.0.97
谢谢.
我正在使用 HELM 升级我的 k8s 环境,我想知道,我可以使用升级命令(或任何其他方式)更改已经启动的图表的图表名称吗?
示例图表名称:
helm upgrade --set image.tag='12.55.6-2' zk-chart /path/to/helm/files
Run Code Online (Sandbox Code Playgroud)
这样zk-chart将更改为new-zk-chart,无需停机,所以我不想删除图表并再次创建它。
我开始使用 python 和 boto3 编写 lambda 函数,
我设法分别在每个区域工作,但我不知道如何在几个区域一起工作。
这是我宣布我的客户的方式:
region= 'ap-southeast-2'
ec2 = boto3.client('ec2', region_name=region)
Run Code Online (Sandbox Code Playgroud)
如果我不给它一个区域,它将在您创建 lambda 函数的区域上运行,这是我不想要的。
以前有人这样做过吗?
我和archiva合作已经有一年了,
我通过archiva GUI 手动上传我的罐子,它运行正常.
现在我想通过maven deploy上传一个工件,问题是我得到401-Unauthorized.请记住:
1.)我可以从这个存储库下载没有问题.
2.)我使用管理员用户.
3.)我可以手动上传此用户.
这是我得到的日志:
[com:apinterface.parent] Downloading: http://xx.xx.xx.xx:9080/archiva/repository/snapshots/com/apinterface.parent/1.0-SNAPSHOT/maven-metadata.xml
[11:43:39][Step 1/3] [INFO] ------------------------------------------------------------------------
[11:43:39][Step 1/3] [ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy (default-deploy) on project apinterface.parent: Failed to deploy artifacts: Could not transfer artifact com:apinterface.parent:pom:1.0-20140924.084338-1 from/to snapshots (http://xx.xx.xx.xx:9080/archiva/repository/snapshots): Failed to transfer file: http://xx.xx.xx.xx:9080/archiva/repository/snapshots/com/apinterface.parent/1.0-SNAPSHOT/apinterface.parent-1.0-20140924.084338-1.pom. Return code is: 401, ReasonPhrase: Unauthorized. -> [Help 1]
Run Code Online (Sandbox Code Playgroud) 我需要使用 sed 更改 JSON 文件的值,
我看到很多人建议使用 jq、python 或 Perl。
但是我在一个容器内工作,我希望它尽可能简单,所以只有 sed 是我需要的解决方案。
JSON 文件是:
{
"useCaseName" : "rca",
"algorithm" : "log-clustering-train",
"mainClass" : "com.hp.analytics.logclustering.MainTrainer",
"applicationJar" : "log-clustering-train-1.0.0-SNAPSHOT-jar-with-dependencies.jar",
"conf" : {
"spark.driver.memory" : "3gb",
"spark.executor.memory" : "9gb",
"spark.executor.userClassPathFirst" : "true",
"spark.cores.max": "8"
},
"schedule" : {
"period" : "10",
"timeUnit" : "hours",
"timeoutPeriodSeconds" : "10800"
}
}
Run Code Online (Sandbox Code Playgroud)
我想更改其中的 4 个值:
"spark.driver.memory" : "1gb",
"spark.executor.memory" : "1gb",
“spark.cores.max”:“1”
“期间”:“15”,
所以输出将是:
{
"useCaseName" : "rca",
"algorithm" : "log-clustering-train",
"mainClass" : "com.hp.analytics.logclustering.MainTrainer",
"applicationJar" : …Run Code Online (Sandbox Code Playgroud) 我需要检查 Bash 文件是否为空,
如果它是空的,请继续跟踪他,直到写入内容为止。
如果写入了某些内容,则将其回显到屏幕上并停止检查文件内容。
for [ -s diff.txt ]; do
echo "file is empty - keep checking it "
done
echo "file is not empty "
cat diff.txt
Run Code Online (Sandbox Code Playgroud) 伙计们,我在从 otf 文件导入字体时遇到问题
主文件
@font-face {
font-family: 'testfont';
src: url('fonts/test.otf');
}
.fonttest {
font-family: 'testfont';
}
Run Code Online (Sandbox Code Playgroud)
主文件
<p class="fonttest">TESTtest</p>
Run Code Online (Sandbox Code Playgroud)
但是当我尝试启动主页时,它仍然显示 html 的标准字体。当我在我的浏览器opera和chrome上使用检查器时,它说字体已被接受
我正在与 GitHub enterprise 合作,但无权将新的预接收挂钩上传到我们的存储库。
我尝试将我的钩子作为预推送钩子进行测试,它的工作方式就像一个魅力,但是当我将我的钩子发送给我们的管理员时,他说:“GitHub pre-receive-hook 脚本与 git pre-receive-hook 不同脚本。 git symbolic-ref --short HEAD 可能无法按您的预期工作”
所以我需要找到一种方法来替换这个命令:
current_branch=$(git symbolic-ref --short HEAD) || exit 1
Run Code Online (Sandbox Code Playgroud)
将我当前的分支保存在“current_branch”参数中的命令?
如果没有能力测试,我该如何做到这一点?
我创建了一个在我们的系统中运行的 systemd 服务,我想使用已安装在实例上的 telegraf 代理来监视它。代理当前正在监视基本的基础设施,我需要向新服务添加监视。
我找不到任何关于如何做到这一点的示例,这很奇怪,我希望 telegraf 有某种用于基本功能的插件。
我的服务正在运行一个不公开任何端口的 python 脚本,因此我可以进行正常的 HTTP 运行状况检查。
任何帮助将不胜感激。