分类目录归档:Deploy

[ 部署到本地k8s[go-fastdfs] ]


部署到本地的kubesphere

一.docker参考命令

docker run --network=host --name fastdfs -v /data/fastdfs_data:/data -p 8080:8080 -e GO_FASTDFS_DIR=/data sjqzhang/go-fastdfs

二.k8s部署参考

pod.yaml

kind: Pod
apiVersion: v1
metadata:
  name: go-fast-pod-0
  generateName: go-fast-pod-
  namespace: chf-object
  labels:
   

< Read more >

[ 所有中间价部署[go-zero] ]


使用docker compose部署

version: '3'

######## 项目依赖的环境,启动项目之前要先启动此环境 #######
######## The environment that the project depends on, starting this environment before starting the project #######

services:
  #jaeger链路追踪 — Jaeger for tracing
  jaeger:
    image: jaegertracing/all-in-one:1.42.0
    c

< Read more >

[ Linux进程管理supervisor[基础] ]


supervisor进程管理

安装

apt-get install python3-pip

apt-get install supervisor

supervisord -h

配置文件

主服务启动文件

/etc/supervisor/supervisord.conf

需要读取的进程文件

/etc/supervisor/conf.d/*.conf

写了一个go-fastdfs服务的文件展示

  1. Log文件夹需要提前创建
  2. /etc/supervisor/conf.d/go_fastdfs_server.conf文件
[program:go_fastdfs_server]
direc

< Read more >

[ djangoblog项目搭建[kubesphere流水线] ]


djangoblog项目地址

本文使用了kubeshphere搭建的k8s平台并添加了devploy流水线部署

前端pod文件nginx_deploy.yaml - 39行volumeMounts为配置文件挂载, 需要提前创建好配置字典

kind: Deployment
apiVersion: apps/v1
metadata:
  name: django-blog-nginx
  namespace: chf-object
  labels:
    app: django-blog-nginx
spec:
  replicas: 1
  selector:
    matchLabels

< Read more >

[ nginx配置文件 ]


路由匹配规则

案例1:

输入: 127.0.0.1:8000/api/chf/

location ^~/api/ {
    proxy_pass http://11.11.11.11:8000/;
}

输出: http://11.11.11.11:8000/chf

案例2:

输入: 127.0.0.1:8000/api/chf/

location ^~/api {
    proxy_pass http://11.11.11.11:8000;
}

输出: http://11.11.11.11:8000/api/chf/

配置文件

default.conf

server {
    l

< Read more >

[ 创建pod服务 ]


一. 配置字典

  1. 配置字典 1. 配置字典

  2. 配置字典 - 名字 2. 名字

  3. 配置字典 - 文件 3. 字典配置

二. 配置副本集pod

  1. 有状态副本集 4. 有状态服务

  2. 有状态副本集 - 名字 5

  3. 有状态副本集 - 容器配置1 6

  4. 有状态副本集 - 容器配置2 7

  5. 有状态副本集 - 储存配置 8

  6. 有状态副本集 - 储存配置 - 挂载持久卷 9

  7. 有状态副本集 - 储存配置 - 挂载配置字典 10

  8. 创建服务 11

  9. 创建服务 - 指定工作负载 12

  10. 创建服务 - 名字 13

  11. 创建服务 - 服务配置(选择访问模式, 保留端口, 选择工作负载) 14

  12. 创建服务 - 高级设置 - 外部访问 15

  13. 查看创建完成的服务 16

  14. 使用服

< Read more >

[ kubesphere流水线 ]


jenkinsfile文件

  • REGISTRY环境变量为dockerhub私有仓库的ip地址
  • DOCKERHUB_NAMESPACE为dockerhub私有仓库的命名空间

1.前端vue3项目配置到nginx

  • 自己指定docker镜像node:latest容器
pipeline {
  agent {
    kubernetes {
      inheritFrom 'nodejs base'
      containerTemplate {
        name 'nodejs'
        image 'node:latest&#

< Read more >