IT漫步

技术生活札记©Yaohui

Follow the official document to install docker on debian/jessie meets an error

Update the apt package index and install packages to allow apt to use repository over HTTPS: apt-get update apt-get install \ ca-certificates \ curl \ gnupg \ lsb-release Add Docker’s official GPG key: curl -fsSL https://download.docker.com/linux/debian/gpg | gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg Use the following command to set up the stable repository echo \ "deb [arch=$(dpkg …


How to install specific hotfix on Windows Server

Windows容器环境有个特点, Host与Container的OS Builder Number必须匹配, 有点场景甚至要求Revision Number匹配, 所以经常要为K8s Node安装指定Revision 的hotfix,  用powershell在线安装时下载过程缓慢而不可控, 体验最好的路径还是直接找到相应Revision Number的msu安装包,直接安装: 1. 从Windows Update History网站找到版本对应的KB. 如: Windows Server 1809 OS Build 10.0.17763.1158 https://support.microsoft.com/en-us/help/4549949 2. 在Windows Update Catelog按KB搜索: https://www.catalog.update.microsoft.com/ 找到相应的下载包. 如17763.1158对应的KB4549949: https://www.catalog.update.microsoft.com/Search.aspx?q=KB4549949 3. 下载msu安装包后使用wusa指令安装即可: wusa windows10.0-kb4549949-x64_90e8805e69944530b8d4d4877c7609b9a9e68d81.msu 附: 为了防止Windows Node版本变更, 还要关闭Windows Auto Update, 防止Node OS自己变更版本: a). 查看Auto Update 状态: %systemroot%\system32\Cscript %systemroot%\system32\scregedit.wsf /AU /v b). 禁用 Windows …


Customize hosts record on docker and kubernetes

Docker: docker run -it --rm --add-host=host1:172.17.0.2 --add-host=host2:192.168.1.3 busybox use “–add-host” to add entries to /etc/hosts   Kubernetes: apiVersion: v1 kind: Pod metadata: name: hostaliases-pod spec: hostAliases: - ip: "127.0.0.1" hostnames: - "foo.local" - "bar.local" - ip: "10.1.2.3" hostnames: - "foo.remote" - "bar.remote" containers: - name: cat-hosts image: busybox command: - cat args: - "/etc/hosts" use …


遇到了传说中的container runtime is down PLEG is not healthy

在一次异常断电后, 开发环境的一个小kubernetes cluster中不幸遭遇了PLEG is not healthy问题, 表现是k8s中的pod状态变成Unknown或ContainerCreating, k8s节点状态变成NotReady: # kubectl get nodes NAME STATUS ROLES AGE VERSION EXTERNAL-IP OS-IMAGE KERNEL-VERSION CONTAINER-RUNTIME k8s-dev-master Ready master 1y v1.10.0 <none> CentOS Linux 7 (Core) 3.10.0-957.21.3.el7.x86_64 docker://17.3.0 k8s-dev-node1 NotReady node 1y v1.10.0 <none> CentOS Linux 7 (Core) 3.10.0-957.21.3.el7.x86_64 docker://Unknown k8s-dev-node2 NotReady node 1y v1.10.0 <none> CentOS Linux 7 (Core) 3.10.0-957.21.3.el7.x86_64 …


Getting real client IP in Docker Swarm

在Docker Swarm中通过Stack Deploy部署Service的时候,在Service中默认无法获取到客户端的IP地址, Github中有一个issue在track这个问题:Unable to retrieve user’s IP address in docker swarm mode 目前的解决方法或Workaround是把port改成host模式, 以kong为例. 默认的port发布模式: version: "3.7" services: kong-proxy: image: kong:1.0.3-alpine deploy: mode: global labels: - "tier=frontend" restart_policy: condition: any ports: - "80:8000" - "443:8443" depends_on: - database-postgresql environment: KONG_ADMIN_LISTEN: 0.0.0.0:8001, 0.0.0.0:8444 ssl KONG_DATABASE: postgres KONG_PG_DATABASE: kong KONG_PG_USER: kong KONG_PG_PASSWORD: PaSsW0rd KONG_PG_HOST: database-postgresql KONG_PG_PORT: "5432" …


Docker for Windows 18.06.0-ce released

18.06.0-ce-win70 (19075) Upgrades Docker 18.06.0-ce Docker Machine 0.15.0 Docker compose 1.22.0 LinuxKit v0.4 Linux Kernel 4.9.93 with CEPH, DRBD, RBD, MPLS_ROUTING and MPLS_IPTUNNEL enabled New Kubernetes Support. You can now run a single-node Kubernetes cluster from the “Kubernetes” Pane in Docker for Windows settings and use kubectl commands as well as docker commands. See https://docs.docker.com/docker-for-windows/kubernetes/ …


License for OS (Windows) inside Docker [reshipment]

How does licensing work? For production, licensing is at the host level, i.e. each machine or VM which is running Docker. Your Windows licence on the host allows you to run any number of Windows Docker containers on that host. With Windows Server 2016 you get the commercially supported version of Docker included in the …


CentOS 7 中安装配置Docker

1. 通过下载Binary包安装docker 在CentOS中,由于相关组件比较齐全,可直接下载docker的发布包直接启动,可以从下面的网页中找到下载链接: https://docs.docker.com/install/linux/docker-ce/binaries/ https://download.docker.com/linux/static/stable/x86_64/ 下载: # curl -#O https://download.docker.com/linux/static/stable/`uname -m`/docker-17.12.1-ce.tgz 解压并Copy到/usr/bin/: # tar xzvf docker-17.12.1-ce.tgz # cp docker/* /usr/bin/ 其他机器不用重复下载,sftp到第一台机器直接copy过来: #sftp [email protected]:/root/download/ sftp> get docker/* sftp> exit   直接运行dockerd 测试一下看能否成功启动docker daemon: 接下来需要把dockerd配置成系统服务自动启动。 参照官方文档:https://docs.docker.com/config/daemon/systemd/#manually-create-the-systemd-unit-files 从https://github.com/moby/moby/tree/master/contrib/init/systemd把docker.service和docker.socket下载到/etc/systemd/system/目录 # curl -o /etc/systemd/system/docker.service https://raw.githubusercontent.com/moby/moby/master/contrib/init/systemd/docker.service # curl -o /etc/systemd/system/docker.socket https://raw.githubusercontent.com/moby/moby/master/contrib/init/systemd/docker.socket # systemctl daemon-reload # systemctl enable docker 然后通过# systemctl start …

Proudly powered by WordPress