对于引用的第三方c代码库,常常出现这种警告,一个个去修改很麻烦,找到个办法可以忽略这种告警。
在XCode的 Build Phases > Compile Sources 中选择所有.c文件, 双击任一行c文件后面那一列,也就是compiler flags。
在里面添加-Wno-shorten-64-to-32
对于引用的第三方c代码库,常常出现这种警告,一个个去修改很麻烦,找到个办法可以忽略这种告警。
在XCode的 Build Phases > Compile Sources 中选择所有.c文件, 双击任一行c文件后面那一列,也就是compiler flags。
在里面添加-Wno-shorten-64-to-32
找了段解释如下:
Kubernetes Service vs Deployment What's the difference between a
Service and a Deployment in Kubernetes?A deployment is responsible for keeping a set of pods running.
A service is responsible for enabling network access to a set of pods.
We could use a deployment without a service to keep a set of identical
pods running in the Kubernetes cluster. The deployment could be scaled
up and down and pods could be replicated. Each pod could be accessed
individually via direct network requests (rather than abstracting them
behind a service), but keeping track of this for a lot of pods is
difficult.We could also use a service without a deployment. We'd need to create
each pod individually (rather than "all-at-once" like a deployment).
Then our service could route network requests to those pods via
selecting them based on their labels.
直接翻译下就是:
depoyment负责保持一组Pod运行。
service负责启用对一组Pod的网络访问。
我们可以使用没有服务的部署来保持一组相同的Pod在Kubernetes集群中运行。 可以按比例放大和缩小部署,还可以复制Pod。 可以通过直接的网络请求(而不是将它们抽象到服务之后)分别访问每个Pod,但是要跟踪很多Pod很难。
我们也可以在没有部署的情况下使用服务。 我们需要分别创建每个Pod(而不是像部署那样“一次全部”创建)。 然后,我们的服务便可以根据标签的标签选择网络请求,将网络请求路由到这些Pod。
服务和部署是不同的,但是它们可以很好地协同工作。
换个方式理解就是:depoyment就是用容器镜像创的实例, service负责访问这些实例,可以将deployment的端口通过端口暴露给其它服务或外界网络。
printf $(md5sum filename)
输出如
[root@localhost ~]# printf $(md5sum pull_k8s.sh)
4f402cff419c0da6c100c3c502e7f2d1[root@localhost ~]#
保存md5值到文件
printf $(md5sum pull_k8s.sh)>pull_k8s.sh.md5
上篇讲到在win10环境,vmware的虚拟机内安装minikube之后,发现在访问minikube dashboard是无法跳转的。
这里解决方法:
kubectl proxy --address='0.0.0.0' --disable-filter=true
http://your_api_server_ip:8001/api/v1/namespaces/kubernetes-dashboard/services/http:kubernetes-dashboard:/proxy/
your_api_server_ip 换成虚拟机的外部IP,如192.168.136.111
如果有开firewalld,可以通过firewall-cmd --zone=public --add-port=8081/tcp --permanent
添加例外,或直接关闭防火墙
in10环境,安装的VMware Workstation Pro,创建了一台Centos7.x的虚拟机。并启用虚拟化。
// v1.16.0版本可以从这里查 https://storage.googleapis.com/kubernetes-release/release/stable.txt
curl -LO https://storage.googleapis.com/kubernetes-release/release/v1.16.0/bin/linux/amd64/kubectl
chmod +x ./kubectl
sudo mv ./kubectl /usr/local/bin/kubectl
kubectl version
上述如果在墙内,需要http代理可以,先将代理设为环境变量 export http_proxy=http://ip:port
也可以从github上下载
https://github.com/kubernetes/kubernetes/blob/master/CHANGELOG.md#client-binaries-1
找到Current release如 https://github.com/kubernetes/kubernetes/blob/master/CHANGELOG-1.16.md
再找到Client Binaries如v1.16.0下的 https://github.com/kubernetes/kubernetes/blob/master/CHANGELOG-1.16.md#client-binaries
再找到合适的tar包如 https://dl.k8s.io/v1.16.0/kubernetes-client-linux-amd64.tar.gz
wget https://dl.k8s.io/v1.16.0/kubernetes-client-linux-amd64.tar.gz
tar -zxvf kubernetes-client-linux-amd64.tar.gz
cd kubernetes/client/bin
chmod +x ./kubectl
sudo mv ./kubectl /usr/local/bin/kubectl
kubectl version
inikube start时minikube logs中报
Error loading config file "/var/lib/minikube/kubeconfig": open
/var/lib/minikube/kubeconfig: permission denied
解决方法:
sudo setenforce 0
再次执行minikube start即可
注意 这个setenforce重启会失败,需要修改/etc/selinux/config 将SELINUX=enforcing
改为 SELINUX=disabled
然后重启即可。
//无需用户名和密码
export http_proxy=http://ip:port
export https_proxy=http://ip:port
//需要用户名和密码
export http_proxy=http://user:password@ip:port
export https_proxy=https://user:password@ip:port
curl -x <[protocol://][user:password@]proxyhost[:port]> url
--proxy <[protocol://][user:password@]proxyhost[:port]> url
--proxy http://user:password@Your-Ip-Here:Port url
-x http://user:password@Your-Ip-Here:Port url
如
curl -x http://mike:123456@api.baidu.com:3392 https://www.zixi.org
虚拟机内使用minikube start --vm-driver=none装minikube时,报的这个
[preflight] You can also perform this action in beforehand using 'kubeadm config images pull'
error execution phase preflight: [preflight] Some fatal errors occurred:
[ERROR ImagePull]: failed to pull image k8s.gcr.io/kube-apiserver:v1.16.0: output: Trying to pull repository k8s.gcr.io/kube-apiserver ...
Get https://k8s.gcr.io/v1/_ping: dial tcp 64.233.189.82:443: connect: connection refused
, error: exit status 1
实际上就是这个域名k8s.gcr.io不通。
可以执行minikube start --vm-driver=none --image-mirror-country=cn;
来指定国内镜像源。
我的macbook是2011款,曾经换成固态硬盘,内存从2Gx2升到2G+8G,现在基本上还能应付一般开发。
10.14开始就已经不支持这台2011年款macbook。不过也是从某个网站下的patch工具,将10.14的镜像打上补丁可以升级上来。
10.15也有这样的工具,将macOS Catalina的镜像打上补丁支持旧款macbook. 这个工具网站http://dosdude1.com/catalina/
先查这个再看兼容列表是否支持。
ping -6 [IPV6 address]
ping6 -c [Count] -I [Interface] [Destination Address/Hostname]