WSL2改为桥接
需求
在docker容器内部程序自己获取的ip是172开头的。我需要跟宿主机同样网段的ip。
问题
win10系统wsl2 不支持桥接
更简单的解决方案
使用vmware虚拟机,直接启动一个linux镜像,然后使用桥接网络模式也能实现需求。
……在docker容器内部程序自己获取的ip是172开头的。我需要跟宿主机同样网段的ip。
win10系统wsl2 不支持桥接
使用vmware虚拟机,直接启动一个linux镜像,然后使用桥接网络模式也能实现需求。
……mkdir -p conf
mkdir -p logs
mkdir -p mysql
cd conf/
vi my.cnf
# Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#
# The MySQL Server configuration file.
#
# For explanations see
# http://dev.mysql.com/doc/mysql/en/server-system-variables.html
[mysqld]
pid-file = /var/run/mysqld/mysqld.pid
socket = /var/run/mysqld/mysqld.sock
datadir = /var/lib/mysql
#log-error = /var/log/mysql/error.log
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0
max_connections = 2000
max_user_connections = 1900
max_connect_errors = 100000
max_allowed_packet = 50M
lower_case_table_names=1
[mysqld]
skip-name-resolve
sql_mode=STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
#保存后退出
docker命令直接启动
……参考链接: https://learn.microsoft.com/zh-cn/windows/wsl/install
wsl --update
wsl -v -l
wsl --install
WSL发行版默认都是安装在C盘,在%LOCALAPPDATA%/Docker/wsl目录
docker的运行数据、镜像文件都存在%LOCALAPPDATA%/Docker/wsl/data/ext4.vhdx中,这对C盘空间紧张的人非常不友好。。。
ACTION_ACCESS_TOKEN和第一步生成的 token,保存.github/workflows/hugo.yml
……-------- -------- ---------
|stage1| -> |stage2| -> | stage3|
-------- -------- ---------
------ ------ -------
|job1| |job2| | job3|
------ ------ -------
--------- --------- ---------
|runner1| |runner2| -> |runner3|
--------- --------- ---------
gitlab runner是运行job的环境。需要安装一个可以执行gitlab runner命令的环境.
-------- -------- ---------
|stage1| -> |stage2| -> | stage3|
-------- -------- ---------
------ ------ -------
|job1| |job2| | job3|
------ ------ -------
--------- --------- ---------
|runner1| |runner2| -> |runner3|
--------- --------- ---------
gitlab runner是运行job的环境。需要安装一个可以执行gitlab runner命令的环境.
$ docker ps --filter "status=exited"
$ docker inspect container-id --format='{<!-- -->{.State.ExitCode}}'
resources.limits),一般是内存溢出(OOM),CPU达到限制只需要不分时间片给程序就可以。因为限制资源是通过 linux 的 cgroup 实现的,所以 cgroup 会将此容器强制杀掉,类似于kill -9作为应用与Kubernetes的监控体系,Prometheus具备诸多的优势,如:
下载prometheus所需文件:
……看了statefulset基础教程的基础教程,并且把环境搭建起来后。pod内部是可以连通了。但是我不知道怎么去从外部访问。在网上搜索一番,通过Ingress可以作为集群的入口。遂记录之。
结合Statefulset的示例进行配置。这是未配置Ingress之前的Statefulset示例: