-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsearch.xml
More file actions
153 lines (94 loc) · 8.71 KB
/
search.xml
File metadata and controls
153 lines (94 loc) · 8.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
<?xml version="1.0" encoding="utf-8"?>
<search>
<entry>
<title>1</title>
<url>/2025/06/08/01-1/</url>
<content><![CDATA[]]></content>
</entry>
<entry>
<title>01.md</title>
<url>/2025/06/08/01/</url>
<content><![CDATA[环境如下:
服务名称/主机名
IP
系统
资源
版本
mysql
云服务器 49.235.64.11
2c2g
v5.7.29
jenkins
192.168.6.12
4c4g
v2.460
gitea
192.168.6.18
2c2g
v2.38.1
harbor
192.168.6.19
2c2g
v2.3.1
k8s-master
192.168.6.4
ubuntu22.04.5
4c4g
v1.28.2
k8s-node1
192.168.6.5
ubuntu22.04.5
4c6g
v1.28.2
k8s-node2
192.168.6.6 资源不够可关闭这台
ubuntu22.04.5
4c6g
v1.28.2
部署gitlab这里使用的是[Centos7.9]安装Docker环境 ,这里不说了,参考:https://www.cnblogs.com/wei325/p/15139701.html
gitlab有ce版和ee版,ce版为免费版本;ee版为企业版本,需要收费;这里用ce版。
安装dockerhostnamectl set-hostname gitlab[root@gitlab gitlab]# vim /etc/docker/daemon.json {"registry-mirrors": [ "https://0vmzj3q6.mirror.aliyuncs.com", "https://docker.m.daocloud.io", "https://mirror.baidubce.com", "https://dockerproxy.com", "https://mirror.iscas.ac.cn", "https://huecker.io", "https://dockerhub.timeweb.cloud", "https://noohub.ru", "https://vlgh0kqj.mirror.aliyuncs.com"], "proxies": { "http-proxy": "http://192.168.1.4:10795", "https-proxy": "socks5://192.168.1.4:10795"}}systemctl daemon-reload && systemctl restart docker
拉取Gitlab镜像docker pull gitlab/gitlab-ce
Docker-compose部署cd /usr/local/mkdir gitlab[root@gitlab gitlab]# vim docker-compose.yml services: web: # 镜像名 CE 是社区版 zh 中文 image: 'twang2218/gitlab-ce-zh' # 表示无论何时容器停止,Docker 都会自动重启该容器。这种策略适用于那些必须始终运行的服务,以确保服务的连续性和高可用性。 restart: always # 如果有域名推荐用域名 hostname: '192.168.6.18' environment: # 时区 Time Zone TZ: 'Asia/Shanghai' GITLAB_OMNIBUS_CONFIG: | external_url 'http://192.168.6.18' # Linux一般通过工具远程连接的(xshell等)是通过SSH协议,这个协议默认端口22,为了避免冲突,所以此处设置2222 gitlab_rails['gitlab_shell_ssh_port'] = '2222' # 内部的端口 unicorn['port'] ='8888' nginx['listen_port'] = '80' # ===== 可以配置邮箱=============== # gitlab_rails['smtp_enable']= true # gitlab_rails['smtp_address']= "smtp.exmail.qq.com" # gitlab_rails['smtp_port']= 465 # gitlab_rails['smtp_user_name']= "发送邮件的邮箱" # gitlab_rails['smtp_password']= "邮箱的密码" # gitlab_rails['smtp_authentication']= "login" # gitlab_rails['smtp_enable_starttls_auto']= true # gitlab_rails['smtp_tls']= true # gitlab_rails['gitlab_email_from']= "上面的邮箱" ports: - '80:80' - '443:443' - '2222:22' volumes: - ./config:/etc/gitlab - ./data:/var/opt/gitlab - ./logs:/var/log/gitlabdocker-compose up -d
》》访问直接跳转到修改 超级管理员密码的界面了 修改密码zhukang520
》》用超级管理员登录
gitlab 日志docker logs -f 容器 ID 如果gitlab启动不了 可以看下面日志
准备镜像mkdir /apps/{dadishu,xiangqi}[root@jenkins apps]# tree.├── dadishu│ ├── dadishu.war│ └── Dockerfile└── xiangji ├── Dockerfile └── xiangqi.war[root@jenkins dadishu]# ll总用量 20044-rw-r--r-- 1 root root 20519797 8月 21 2024 dadishu.war-rw-r--r-- 1 root root 788 6月 5 20:41 Dockerfile[root@jenkins dadishu]# cat Dockerfile # 使用更轻量的基础镜像 (减少约200MB)FROM eclipse-temurin:11-jre-alpine# 设置元数据LABEL maintainer="zhukang" \ app="dadishu"# 设置时区和字符集 (替代复制Shanghai文件)ENV TZ=Asia/Shanghai \ LANG=C.UTF-8# 设置工作目录和环境变量WORKDIR /appENV JAVA_HOME=/opt/java/openjdk \ PATH=$JAVA_HOME/bin:$PATH \ CLASSPATH=.:$JAVA_HOME/lib:$JAVA_HOME/jre/lib:$JAVA_HOME/lib/tools.jar# 添加应用程序 (单层操作减少镜像层)COPY --chown=1000:1000 dadishu.war /app/dadishu.war# 使用非root用户运行 (安全最佳实践)RUN addgroup -S appgroup && adduser -S appuser -G appgroupUSER appuser# 暴露端口EXPOSE 8080# 启动命令 (使用exec形式)CMD ["java", "-Dserver.port=8080", "-jar", "dadishu.war"]docker build -t daqingwa:v1 .[root@jenkins dadishu]# docker tag dadishu:v1 harbor.zhu.com/apps/dadishu:v1[root@jenkins dadishu]# docker push harbor.zhu.com/apps/dadishu:v1
准备象棋小游戏
[root@jenkins xiangji]# ll总用量 18716-rw-r--r-- 1 root root 788 6月 5 20:47 Dockerfile-rw-r--r-- 1 root root 19160990 2月 23 00:04 xiangqi.war[root@jenkins xiangji]# cat Dockerfile # 使用更轻量的基础镜像 (减少约200MB)FROM eclipse-temurin:11-jre-alpine# 设置元数据LABEL maintainer="zhukang" \ app="xiangqi"# 设置时区和字符集 (替代复制Shanghai文件)ENV TZ=Asia/Shanghai \ LANG=C.UTF-8# 设置工作目录和环境变量WORKDIR /appENV JAVA_HOME=/opt/java/openjdk \ PATH=$JAVA_HOME/bin:$PATH \ CLASSPATH=.:$JAVA_HOME/lib:$JAVA_HOME/jre/lib:$JAVA_HOME/lib/tools.jar# 添加应用程序 (单层操作减少镜像层)COPY --chown=1000:1000 xiangqi.war /app/xiangqi.war# 使用非root用户运行 (安全最佳实践)RUN addgroup -S appgroup && adduser -S appuser -G appgroupUSER appuser# 暴露端口EXPOSE 8080# 启动命令 (使用exec形式)CMD ["java", "-Dserver.port=8080", "-jar", "xiangqi.war"]docker build -t xiangqi:v1 .[root@jenkins dadishu]# docker tag xiangqi:v1 harbor.zhu.com/apps/xiangqi:v1[root@jenkins dadishu]# docker push harbor.zhu.com/apps/xiangqi:v1
安装helm安装helm: - 下载helm[root@k8s231.oldboyedu.com helm]# wget https://get.helm.sh/helm-v3.9.0-linux-amd64.tar.gz - 解压helm程序到指定目录(此处不解压README.MD文档及授权文件信息)[root@k8s231.oldboyedu.com helm]# tar xf helm-v3.9.0-linux-amd64.tar.gz -C /usr/local/sbin/ linux-amd64/helm --strip-components=1 "--strip-components": 跳过解压目录的前缀路径。 - 验证helm安装成功[root@k8s231.oldboyedu.com helm]# helm versionversion.BuildInfo{Version:"v3.9.0", GitCommit:"7ceeda6c585217a19a1131663d8cd1f7d641b2a7", GitTreeState:"clean", GoVersion:"go1.17.5"}[root@k8s231.oldboyedu.com helm]# - 配置helm命令的自动补全-新手必备[root@k8s231.oldboyedu.com helm]# helm completion bash > /etc/bash_completion.d/helm[root@k8s231.oldboyedu.com helm]# [root@k8s231.oldboyedu.com helm]# source /etc/bash_completion.d/helm[root@k8s231.oldboyedu.com helm]# [root@k8s231.oldboyedu.com helm]# helm # 连续按2次tab键,出现如下内容则成功completion (generate autocompletion scripts for the specified shell)create (create a new chart with the given name)dependency (manage a chart's dependencies)env (helm client environment information)get (download extended information of a named release)help (Help about any command)...
kubectl create ns helm-cicd 1.创建Chartroot@k8s-master:~/helm# helm create 01-cicdCreating 01-cicd
]]></content>
<categories>
<category>kubernetes</category>
</categories>
<tags>
<tag>kubernetes</tag>
</tags>
</entry>
<entry>
<title>My New Post</title>
<url>/2025/06/06/My-New-Post/</url>
<content><![CDATA[]]></content>
</entry>
<entry>
<title>Hello World</title>
<url>/2025/06/08/hello-world/</url>
<content><![CDATA[Welcome to Hexo! This is your very first post. Check documentation for more info. If you get any problems when using Hexo, you can find the answer in troubleshooting or you can ask me on GitHub.
Quick StartCreate a new post$ hexo new "My New Post"
More info: Writing
Run server$ hexo server
More info: Server
Generate static files$ hexo generate
More info: Generating
Deploy to remote sites$ hexo deploy
More info: Deployment
]]></content>
<categories>
<category>这是默认分类</category>
</categories>
<tags>
<tag>这是默认标签</tag>
</tags>
</entry>
</search>