说我有这些价值观
grafana:
...
ingress:
enabled: true
annotations: {}
# kubernetes.io/ingress.class: nginx
# kubernetes.io/tls-acme: "true"
hosts:
- host: chart-example.local
paths: ["/grafana"]
Run Code Online (Sandbox Code Playgroud)
这是标准的头盔。出于这个原因,我想保留hosts为一个数组(即使它使接下来的移动有点棘手)。我怎样才能获得第一个.host(我不介意任何可能的其他)才能使env.value动态
containers:
- name: {{ .Chart.Name }}-grafana
env:
- name: GF_DOMAIN
value: chart-example.local
Run Code Online (Sandbox Code Playgroud)
我试过
env:
- name: GF_DOMAIN
{{- range .Values.grafana.ingress.hosts }}
value: {{ .host }}
{{- end }}
Run Code Online (Sandbox Code Playgroud)
env:
{{- range .Values.grafana.ingress.hosts }}
- name: GF_DOMAIN
value: {{ .host }}
{{- end }}
Run Code Online (Sandbox Code Playgroud)
按照这个建议,我也尝试过
env:
{{- with .Values.grafana.ingress.hosts 0}} …Run Code Online (Sandbox Code Playgroud) 我创建了两个数据类来处理表元数据。TableMetadata适用于任何类型的表,同时RestTableMetadata包含与从 REST api 提取的数据相关的信息
@dataclass
class TableMetadata:
"""
- entity: business entity represented by the table
- origin: path / query / url from which data withdrawn
- id: field to be used as ID (unique)
- historicity: full, delta
- upload: should the table be uploaded
"""
entity: str
origin: str
view: str
id: str = None
historicity: str = "full"
upload: bool = True
columns: list = field(default_factory=list)
@dataclass
class RestTableMetadata(TableMetadata):
"""
- …Run Code Online (Sandbox Code Playgroud) 我正在使用MariaDB构建Django应用程序的基于Alpine的图像,但我无法弄清楚应该添加哪个依赖项,以便我的应用程序可以正确连接到数据库。Dockerfile
django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module.
Did you install mysqlclient?
Run Code Online (Sandbox Code Playgroud)
好吧,我以为我做到了。从我在这篇文章中读到的,在这个讨论中,mariadb-dev在Alpine中相当于default-libmysqlclient-dev在基于Debian的系统中。此外,Alpine 中的mysql-client 包只是一个虚拟包(包含mariadb-dev、mariadb-client等)。这是Dockerfile:
# pull official base image
FROM python:3.7-alpine
# set environment variables
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
# set work directory
WORKDIR /usr/src/cms
# install mysqlclient
RUN apk update \
&& apk add --virtual build-deps gcc python3-dev musl-dev \
&& …Run Code Online (Sandbox Code Playgroud) 我正在尝试在Alpine容器中安排一些摄取作业。我花了一段时间才明白为什么我的cron 作业没有启动:crond 似乎没有运行
rc-service -l | grep crond
Run Code Online (Sandbox Code Playgroud)
根据Alpine 的文档, crond 必须首先以openrc(即某种systemctl)开头。这是 Dockerfile
FROM python:3.7-alpine
# set work directory
WORKDIR /usr/src/collector
RUN apk update \
&& apk add curl openrc
# ======>>>> HERE !!!!!
RUN rc-service crond start && rc-update add crond
# install dependencies
RUN pip install --upgrade pip
RUN pip install pipenv
COPY ./Pipfile /usr/src/collector/Pipfile
RUN pipenv install --skip-lock --system --dev
# copy …Run Code Online (Sandbox Code Playgroud) [环境]
我有一个失败cerbot一个内(让我们加密客户端)泊坞窗容器。看起来acme-v02.api.letsencrypt.org不能从容器解析,但可以从主机解析(最可能的原因)。我已经习惯了容器从主机的 DNS 参数继承的事实,但是对于 AWS EC2 实例,似乎有一些微妙之处
[ec2-user@ip-172-31-32-243 ~]$ cat /etc/resolv.conf
# Generated by NetworkManager
search eu-west-2.compute.internal
nameserver 172.31.0.2
Run Code Online (Sandbox Code Playgroud)
基于此和AWS 控制台中的一些元素,我尝试手动添加这些地址
docker run --dns 172.31.0.2 --dns 172.65.32.248
Run Code Online (Sandbox Code Playgroud)
(我可能没有找到合适的 DNS)
使用主机的网络解决问题
docker run --network="host"
Run Code Online (Sandbox Code Playgroud)
但我只是不太明白为什么。是否与.net 中使用的网络接口有关--network="host"?以下是可用的:
[ec2-user@ip-172-31-32-243 ~]$ ip link show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group …Run Code Online (Sandbox Code Playgroud) 我有一个由22个分类变量(无序)组成的数据集。我想在一个不错的热图中可视化它们的相关性。自熊猫内置功能
DataFrame.corr(method='pearson', min_periods=1)
Run Code Online (Sandbox Code Playgroud)
仅实现数值变量的相关系数(Pearson,Kendall,Spearman),我必须自己对其进行汇总以执行卡方或类似操作,而且我不太确定哪个函数可以一步一步完成操作(而不是遍历所有cat1 * cat2对)。需要明确的是,这就是我想要的最终结果(一个dataframe):
cat1 cat2 cat3
cat1| coef coef coef
cat2| coef coef coef
cat3| coef coef coef
Run Code Online (Sandbox Code Playgroud)
有与pd.pivot_table相同的想法吗?
先谢谢了。
我面临着奇怪的问题。
我做了什么:
我部署了Rancher K3S集群,并且使用基于 debian 的映像进行 dns 解析时出现问题。域名未正确解析 - 它使用我们的域名之一添加后缀。
我发现了什么:
基于 Debian 的镜像在末尾添加了带有域的后缀。例如,我 ping google.com 及其 ping google.com.example.com。(example.com 是我们的域名之一 - 没有指定它,因为在我看来它并不重要)
同样,curl google.com 也会向 example.com 的 IP 地址发出请求。即使尝试了纯 Debian 映像,它仍然存在同样的问题。
基于 Alpine 的图像工作正常(ping 到 google.com ping google.com,nslookup 显示正确的 IP 地址)。
安装了 k3s 的主机服务器也可以正常工作(redhat os)。Ping 至 google.com ping google.com。
一些可能对您有帮助的附加数据:
CoreDNS configmap kubectl -n kube-system 获取 configmap coredns -o go-template={{.data.Corefile}}
.:53 {
errors
health
ready
kubernetes cluster.local in-addr.arpa ip6.arpa {
pods insecure
upstream
fallthrough …Run Code Online (Sandbox Code Playgroud) 我是一个完美的小白与K8S。我安装microk8s和头盔使用snap本地试验。我想知道我当前的问题是否来自使用snap(其目的是封装,据我所知)
Ubuntu 20.04LTS
helm version
version.BuildInfo{Version:"v3.2.4", GitCommit:"0ad800ef43d3b826f31a5ad8dfbb4fe05d143688", GitTreeState:"clean", GoVersion:"go1.13.12"}
kubectl version
Client Version: version.Info{Major:"1", Minor:"18+", GitVersion:"v1.18.4-1+6f17be3f1fd54a", GitCommit:"6f17be3f1fd54a88681869d1cf8bedd5a2174504", GitTreeState:"clean", BuildDate:"2020-06-23T21:16:24Z", GoVersion:"go1.14.4", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"18+", GitVersion:"v1.18.4-1+6f17be3f1fd54a", GitCommit:"6f17be3f1fd54a88681869d1cf8bedd5a2174504", GitTreeState:"clean", BuildDate:"2020-06-23T21:17:52Z", GoVersion:"go1.14.4", Compiler:"gc", Platform:"linux/amd64"}
Run Code Online (Sandbox Code Playgroud)
kubectl config get-contexts
CURRENT NAME CLUSTER AUTHINFO NAMESPACE
* microk8s microk8s-cluster admin
Run Code Online (Sandbox Code Playgroud)
microk8s enable helm3
Run Code Online (Sandbox Code Playgroud)
Kubernetes 已启动并运行
kubectl cluster-info
Kubernetes master is running at https://127.0.0.1:16443
CoreDNS is running at https://127.0.0.1:16443/api/v1/namespaces/kube-system/services/kube-dns:dns/proxy
Run Code Online (Sandbox Code Playgroud)
helm出现问题microk8shelm …Run Code Online (Sandbox Code Playgroud) 我正在寻找将数据帧列转换为 RDD 的最直接、最惯用的方法。假设列views包含浮点数。以下不是我要找的
views = df_filtered.select("views").rdd
Run Code Online (Sandbox Code Playgroud)
因为我最终得到的是 aRDD[Row]而不是 a RDD[Float],因此我无法将其提供给 mllib.stat 中的任何统计方法(如果我正确理解发生了什么):
corr = Statistics.corr(views, likes, method="pearson")
TypeError: float() argument must be a string or a number
Run Code Online (Sandbox Code Playgroud)
在 pandas 中,我会尝试.values()将 pandas Series 转换为其值数组,但 RDD.values()方法似乎无法以这种方式工作。我最终得出以下解决方案
views = df_filtered.select("views").rdd.map(lambda r: r["views"])
Run Code Online (Sandbox Code Playgroud)
但我想知道是否有更直接的解决方案
我在 gitlab 管道中使用amazon/aws-cli:2.2.40在 S3 上发布静态站点。
deploy_front:
image: amazon/aws-cli:2.2.40
variables:
AWS_ACCESS_KEY_ID: $AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY: $AWS_SECRET_ACCESS_KEY
AWS_DEFAULT_REGION: $AWS_DEFAULT_REGION
stage: publish
script:
- s3 sync ./front/build s3://some-bucket-name
Run Code Online (Sandbox Code Playgroud)
最终在
usage: aws [options] <command> <subcommand> [<subcommand> ...] [parameters]
To see help text, you can run:
aws help
aws <command> help
aws <command> <subcommand> help
aws: error: argument command: Invalid choice, valid choices are:
accessanalyzer | acm
acm-pca | alexaforbusiness
amp | amplify
amplifybackend | apigateway
....... ..........
Run Code Online (Sandbox Code Playgroud)
我设法通过docker run -it amazon/aws-cli:2.2.40 aws s3 …
Django 努力寻找Pillow,我不太确定为什么。
基于 Linux Alpine 的 Docker 镜像,Django 2.2。以下是相关部分:
RUN apk update \
&& apk add --virtual build-deps gcc python3-dev musl-dev jpeg-dev zlib-dev \
&& apk add --no-cache mariadb-dev mariadb-client
# install dependencies
RUN pip install --upgrade pip
RUN pip install pipenv
RUN pip install mysqlclient
COPY ./Pipfile /usr/src/cms/Pipfile
RUN pipenv install --skip-lock --system --dev
RUN apk del build-deps
Run Code Online (Sandbox Code Playgroud)
[[source]]
name = "pypi"
url = "https://pypi.org/simple"
verify_ssl = true
[dev-packages]
[packages]
django = "==2.2"
markdown …Run Code Online (Sandbox Code Playgroud) docker ×4
alpine-linux ×3
python ×3
django ×2
dns ×2
kubernetes ×2
amazon-s3 ×1
apache-spark ×1
aws-cli ×1
certbot ×1
cron ×1
dataframe ×1
gitlab-ci ×1
go-templates ×1
heatmap ×1
k3s ×1
mariadb ×1
microk8s ×1
mysql ×1
networking ×1
pandas ×1
pyspark ×1
rdd ×1
resolve ×1
statistics ×1
templating ×1
yaml ×1