我是一个完全的 Azure DevOps 菜鸟,尝试在 Azure DevOps 中设置 AKS 集群和发布管道,以使用 Helm 部署到它。
我创建了(禁用 RBAC,以简化流程)一个 AKS 集群,将发布管道连接到它,使用 Azure Cloud Shell 连接到 AKS 集群并运行 helm init,但发布因以下问题而失败:
2018-12-14T16:35:55.9461744Z ##[section]Starting: helm upgrade <REDACTED>
2018-12-14T16:35:55.9467164Z ==============================================================================
2018-12-14T16:35:55.9467299Z Task : Package and deploy Helm charts
2018-12-14T16:35:55.9467387Z Description : Deploy, configure, update your Kubernetes cluster in Azure Container Service by running helm commands.
2018-12-14T16:35:55.9467647Z Version : 0.138.14
2018-12-14T16:35:55.9467963Z Author : Microsoft Corporation
2018-12-14T16:35:55.9468016Z Help : [More Information](https://go.microsoft.com/fwlink/?linkid=851275)
2018-12-14T16:35:55.9468114Z ==============================================================================
2018-12-14T16:35:58.3023980Z [command]/opt/hostedtoolcache/helm/2.11.0/x64/linux-amd64/helm upgrade --namespace dev --install --recreate-pods --force --values …Run Code Online (Sandbox Code Playgroud) 好吧,您可以轻松安装应用程序,但是与 Kubernetes 中的普通 .yaml 文件相比,好处在哪里?有人可以给我举一个例子,说明使用 helm 很有用,以及为什么普通的 Kubernetes 还不够吗?另外,helm 和 Kubernetes 的对抗也不错。
我们正在使用keycloak 的 helm 图表,
我可以配置日志的内部视图(在网络界面中)。是否可以将这些日志也发送到logstash?
有没有办法将部署名称从 helm 公开到容器?它通常作为主机名的一部分提供,但如果我能帮上忙,我宁愿不解析它。
我知道您可以根据文档将某些元数据设置为特定的环境变量:https : //kubernetes.io/docs/tasks/inject-data-application/environment-variable-expose-pod-information/ 但是,这并没有似乎直接包含部署名称。有没有办法获得这些信息?
我正在尝试在 Elasticsearch 上设置基本身份验证。我发现还需要设置 SSL 证书。
关注本文:https ://pimwiddershoven.nl/entry/deploy-a-secure-instance-of-elasticsearch-on-kubernetes
使用 helm 在 Kubernetes 上启动并运行集群
但是发送的时候
curl -H "Authorization: Basic ZWxsdfasdfiojoijQw==" https://localhost:9200
Run Code Online (Sandbox Code Playgroud)
它给出了类似的错误
curl: (60) SSL certificate problem: self signed certificate in certificate chain
More details here: https://curl.haxx.se/docs/sslcerts.html
curl failed to verify the legitimacy of the server and therefore could not
establish a secure connection to it. To learn more about this situation and
how to fix it, please visit the web page mentioned above.
Run Code Online (Sandbox Code Playgroud)
但是当使用curl insecure模式发送请求时或者-k它工作正常并且可以看到集群运行状况
这是由于自签名证书。我错过了什么吗? …
elasticsearch kubernetes google-kubernetes-engine kubernetes-helm
我有一个预安装挂钩,它创建一个动态 PVC,如下所示
kind: PersistentVolumeClaim
metadata:
name: my-dynamic-pv
annotations:
"helm.sh/resource-policy": keep
"helm.sh/hook": "pre-install"
spec:
storageClassName: {{ .Values.persistence.storageClass }}
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
Run Code Online (Sandbox Code Playgroud)
我想在重新启动时保留相同的 PVC,这就是我提供"helm.sh/resource-policy": keep. 我能够在第一次启动服务时使用预安装挂钩创建 PVC。但随后的安装/重新启动失败并出现错误Error: persistentvolumeclaims "my-dynamic-pv" already exists。
有没有办法忽略此故障并继续 helm 安装?
我正在尝试使用输入参数从 kubernetes 运行 python 脚本(在 python 上使用 import argsparse),python 脚本在 kubernetes 上没有任何输入参数的情况下运行良好,以下命令在 dockerpython python_script.py -e $(date -d '2020/08/23') -d 7 -m映像上运行也没有问题。
我正在尝试构建我的 values.yaml 文件,以便 kubernetes 也可以运行它,但直到现在都没有成功。
我的 values.yaml 文件(仅与脚本相关的部分):
- name: python-script
command: ["python"]
args:
- "python_script.py"
- "-e $(date -d '2020/08/23')"
- "-d 7"
- "-m"
resources:
limits:
cpu: 50m
memory: 512Mi
requests:
cpu: 50m
memory: 512Mi
failedJobsHistoryLimit: 1
successfulJobsHistoryLimit: 3
concurrencyPolicy: Forbid
restartPolicy: Never
Run Code Online (Sandbox Code Playgroud)
在 kubernetes 上运行时的输出:python_script.py: error argument -e/--end_date: Not a valid date: …
对于 Kubernetes 部署,我们可以指定 imagePullSecrets 以允许它从我们的私有注册表中提取 Docker 镜像。但据我所知,StatefulSet 不支持这个?
如何向我的 StatefulSet 提供 pullsecret?
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: redis
namespace: {{ .Values.namespace }}
labels:
app: redis
spec:
replicas: 1
selector:
matchLabels:
app: redis
serviceName: redis-service
updateStrategy:
type: RollingUpdate
template:
metadata:
labels:
app: redis
spec:
terminationGracePeriodSeconds: 10
# imagePullSecrets not valid here for StatefulSet :-(
containers:
- image: {{ .Values.image }}
Run Code Online (Sandbox Code Playgroud) 如果另一个用户部署了舵图。如果我连接到该集群并使用 helm list 它不会显示版本。如何获取由另一个用户为同一集群部署的 helm 中的版本列表。
如果可以的话我们怎样才能做到这一点。
如何在循环内.Values.someVal从values.yaml文件获取或通过 cli 传递{{ range .Values.smtg\xc2\xa0}}?
例如。
\nspec:\n containers:\n {{ range $k, $v := .Values.smtg }}\n - name: {{ $k }}\n image: {{ printf "%s:%s" (required "no img" $v) (required "no tag" .Values.someVal) | quote }} <<<--- how can I get .Values.someVal from values.yaml or cli? \n {{- end }}\nRun Code Online (Sandbox Code Playgroud)\n如果我尝试让他们在一起,.Values.smtg我会得到:... at <.Values.someVal>: nil pointer evaluating interface {}
kubernetes-helm ×10
kubernetes ×9
azure ×1
azure-aks ×1
azure-devops ×1
bash ×1
docker ×1
keycloak ×1
logging ×1
logstash ×1
python-2.7 ×1