-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcontent.json
More file actions
1 lines (1 loc) · 10.8 KB
/
content.json
File metadata and controls
1 lines (1 loc) · 10.8 KB
1
{"meta":{"title":"Hexo","subtitle":"","description":"","author":"John Doe","url":"https://devopskenny.github.io","root":"/"},"pages":[{"title":"categories","date":"2025-06-08T05:11:33.000Z","updated":"2025-06-08T05:11:56.923Z","comments":true,"path":"categories/index.html","permalink":"https://devopskenny.github.io/categories/index.html","excerpt":"","text":""},{"title":"search","date":"2025-06-08T05:13:51.000Z","updated":"2025-06-08T05:14:03.854Z","comments":true,"path":"search/index.html","permalink":"https://devopskenny.github.io/search/index.html","excerpt":"","text":""},{"title":"tags","date":"2025-06-08T05:12:04.000Z","updated":"2025-06-08T05:12:15.628Z","comments":true,"path":"tags/index.html","permalink":"https://devopskenny.github.io/tags/index.html","excerpt":"","text":""}],"posts":[{"title":"1","slug":"01-1","date":"2025-06-08T07:36:16.000Z","updated":"2025-06-08T07:37:39.274Z","comments":true,"path":"2025/06/08/01-1/","permalink":"https://devopskenny.github.io/2025/06/08/01-1/","excerpt":"","text":"","categories":[],"tags":[]},{"title":"Hello World","slug":"hello-world","date":"2025-06-08T06:46:17.883Z","updated":"2025-06-08T06:46:17.883Z","comments":true,"path":"2025/06/08/hello-world/","permalink":"https://devopskenny.github.io/2025/06/08/hello-world/","excerpt":"","text":"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 post1$ hexo new "My New Post" More info: Writing Run server1$ hexo server More info: Server Generate static files1$ hexo generate More info: Generating Deploy to remote sites1$ hexo deploy More info: Deployment","categories":[{"name":"这是默认分类","slug":"这是默认分类","permalink":"https://devopskenny.github.io/categories/%E8%BF%99%E6%98%AF%E9%BB%98%E8%AE%A4%E5%88%86%E7%B1%BB/"}],"tags":[{"name":"这是默认标签","slug":"这是默认标签","permalink":"https://devopskenny.github.io/tags/%E8%BF%99%E6%98%AF%E9%BB%98%E8%AE%A4%E6%A0%87%E7%AD%BE/"}]},{"title":"01.md","slug":"01","date":"2025-06-08T06:46:05.763Z","updated":"2025-06-08T06:46:05.763Z","comments":true,"path":"2025/06/08/01/","permalink":"https://devopskenny.github.io/2025/06/08/01/","excerpt":"","text":"环境如下: 服务名称/主机名 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版。 安装docker123456789101112131415161718192021hostnamectl 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镜像1docker pull gitlab/gitlab-ce Docker-compose部署1234567891011121314151617181920212223242526272829303132333435363738394041cd /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启动不了 可以看下面日志 准备镜像1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950mkdir /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 准备象棋小游戏 123456789101112131415161718192021222324252627282930313233343536373839[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 安装helm1234567891011121314151617181920212223242526272829303132安装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)... 12345kubectl create ns helm-cicd 1.创建Chartroot@k8s-master:~/helm# helm create 01-cicdCreating 01-cicd","categories":[{"name":"kubernetes","slug":"kubernetes","permalink":"https://devopskenny.github.io/categories/kubernetes/"}],"tags":[{"name":"kubernetes","slug":"kubernetes","permalink":"https://devopskenny.github.io/tags/kubernetes/"}]},{"title":"My New Post","slug":"My-New-Post","date":"2025-06-06T13:46:11.000Z","updated":"2025-06-06T13:46:11.464Z","comments":true,"path":"2025/06/06/My-New-Post/","permalink":"https://devopskenny.github.io/2025/06/06/My-New-Post/","excerpt":"","text":"","categories":[],"tags":[]}],"categories":[{"name":"这是默认分类","slug":"这是默认分类","permalink":"https://devopskenny.github.io/categories/%E8%BF%99%E6%98%AF%E9%BB%98%E8%AE%A4%E5%88%86%E7%B1%BB/"},{"name":"kubernetes","slug":"kubernetes","permalink":"https://devopskenny.github.io/categories/kubernetes/"}],"tags":[{"name":"这是默认标签","slug":"这是默认标签","permalink":"https://devopskenny.github.io/tags/%E8%BF%99%E6%98%AF%E9%BB%98%E8%AE%A4%E6%A0%87%E7%AD%BE/"},{"name":"kubernetes","slug":"kubernetes","permalink":"https://devopskenny.github.io/tags/kubernetes/"}]}