当前位置: 首页 > news >正文

apisix部署

使用k8s部署前打包镜像:

FROM centos:7

ARG APISIX_VERSION=2.11.0
LABEL apisix_version=“${APISIX_VERSION}”

RUN yum install -y https://repos.apiseven.com/packages/centos/apache-apisix-repo-1.0-1.noarch.rpm
&& yum install -y https://repos.apiseven.com/packages/centos/7/x86_64/apisix-$APISIX_VERSION-0.el7.x86_64.rpm
&& yum clean all \

WORKDIR /usr/local/apisix
ADD jdk-8u311-linux-x64.tar.gz /opt/
EXPOSE 9080 9443 9180
ENV JAVA_HOME=/opt/jdk1.8.0_311
ENV PATH=PATH:PATH:PATH:JAVA_HOME/bin/
CMD [“sh”, “-c”, “/usr/bin/apisix init && /usr/bin/apisix init_etcd && /usr/local/openresty/bin/openresty -p /usr/local/apisix -g ‘daemon off;’”]

config.yaml:

    apisix:node_listen: 9080             # APISIX listening portenable_heartbeat: trueenable_admin: trueenable_admin_cors: trueenable_debug: falseenable_dev_mode: false          # Sets nginx worker_processes to 1 if set to trueenable_reuseport: true          # Enable nginx SO_REUSEPORT switch if set to true.enable_ipv6: trueconfig_center: etcd             # etcd: use etcd to store the config value# yaml: fetch the config value from local yaml file `/your_path/conf/apisix.yaml`#proxy_protocol:                 # Proxy Protocol configuration#  listen_http_port: 9181        # The port with proxy protocol for http, it differs from node_listen and port_admin.# This port can only receive http request with proxy protocol, but node_listen & port_admin# can only receive http request. If you enable proxy protocol, you must use this port to# receive http request with proxy protocol#  listen_https_port: 9182       # The port with proxy protocol for https#  enable_tcp_pp: true           # Enable the proxy protocol for tcp proxy, it works for stream_proxy.tcp option#  enable_tcp_pp_to_upstream: true # Enables the proxy protocol to the upstream serverproxy_cache:                     # Proxy Caching configurationcache_ttl: 10s                 # The default caching time if the upstream does not specify the cache timezones:                         # The parameters of a cache- name: disk_cache_one         # The name of the cache, administrator can be specify# which cache to use by name in the admin apimemory_size: 50m             # The size of shared memory, it's used to store the cache indexdisk_size: 1G                # The size of disk, it's used to store the cache datadisk_path: "/tmp/disk_cache_one" # The path to store the cache datacache_levels: "1:2"           # The hierarchy levels of a cache#  - name: disk_cache_two#    memory_size: 50m#    disk_size: 1G#    disk_path: "/tmp/disk_cache_two"#    cache_levels: "1:2"allow_admin:                  # http://nginx.org/en/docs/http/ngx_http_access_module.html#allow- 127.0.0.1/24#   - "::/64"port_admin: 9180# Default token when use API to call for Admin API.# *NOTE*: Highly recommended to modify this value to protect APISIX's Admin API.# Disabling this configuration item means that the Admin API does not# require any authentication.admin_key:# admin: can everything for configuration data- name: "admin"key: edd1c9f034335f136f87ad84b625c8f1role: admin# viewer: only can view configuration data- name: "viewer"key: 4054f7cf07e344346cd3f287985e76a2role: viewerrouter:http: 'radixtree_uri'         # radixtree_uri: match route by uri(base on radixtree)# radixtree_host_uri: match route by host + uri(base on radixtree)ssl: 'radixtree_sni'          # radixtree_sni: match route by SNI(base on radixtree)# dns_resolver:##   - 127.0.0.1##   - 172.20.0.10##   - 114.114.114.114##   - 223.5.5.5##   - 1.1.1.1##   - 8.8.8.8#dns_resolver_valid: 30resolver_timeout: 5ssl:enable: falseenable_http2: truelisten_port: 9443ssl_protocols: "TLSv1 TLSv1.1 TLSv1.2 TLSv1.3"ssl_ciphers: "ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:DHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES256-SHA256:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:DES-CBC3-SHA"nginx_config:                     # config for render the template to genarate nginx.conferror_log: "/usr/local/apisix/logs/error.log"error_log_level: "warn"         # warn,errorworker_rlimit_nofile: 20480     # the number of files a worker process can open, should be larger than worker_connectionsevent:worker_connections: 10620http:access_log: "/usr/local/apisix/logs/access.log"keepalive_timeout: 60s         # timeout during which a keep-alive client connection will stay open on the server side.client_header_timeout: 60s     # timeout for reading client request header, then 408 (Request Time-out) error is returned to the clientclient_body_timeout: 60s       # timeout for reading client request body, then 408 (Request Time-out) error is returned to the clientsend_timeout: 10s              # timeout for transmitting a response to the client.then the connection is closedunderscores_in_headers: "on"   # default enables the use of underscores in client request header fieldsreal_ip_header: "X-Real-IP"    # http://nginx.org/en/docs/http/ngx_http_realip_module.html#real_ip_headerreal_ip_from:                  # http://nginx.org/en/docs/http/ngx_http_realip_module.html#set_real_ip_from- 127.0.0.1- 'unix:'etcd:host:                                 # it's possible to define multiple etcd hosts addresses of the same etcd cluster.- "http://apisix-etcd.default.svc.cluster.local:2379"(如果使用的是k8s集群里面的使用这种格式,如果是自建的直接使用IP+端口)prefix: "/apisix"     # apisix configurations prefixtimeout: 30   # 30 secondsplugins:                          # plugin list- api-breaker- authz-keycloak- basic-auth- batch-requests- consumer-restriction- cors- echo- fault-injection- grpc-transcode- hmac-auth- http-logger- ip-restriction- ua-restriction- jwt-auth- kafka-logger- key-auth- limit-conn- limit-count- limit-req- node-status- openid-connect- authz-casbin- prometheus- proxy-cache- proxy-mirror- proxy-rewrite- redirect- referer-restriction- request-id- request-validation- response-rewrite- serverless-post-function- serverless-pre-function- sls-logger- syslog- tcp-logger- udp-logger- uri-blocker- wolf-rbac- zipkin- server-info- traffic-split- gzip- real-ipstream_plugins:- mqtt-proxy- ip-restriction- limit-connplugin_attr:server-info:report_interval: 60report_ttl: 3600

学习时间:

相关文章:

apisix部署

使用k8s部署前打包镜像: FROM centos:7 ARG APISIX_VERSION2.11.0 LABEL apisix_version“${APISIX_VERSION}” RUN yum install -y https://repos.apiseven.com/packages/centos/apache-apisix-repo-1.0-1.noarch.rpm && yum install -y https://repos…...

无聊小知识01.serialVersionUID的作用

什么是serialVersionUIDJava(TM)对象序列化规范中描述到:serialVersionUID用作Serializable类中的版本控件。如果您没有显式声明serialVersionUID,JVM将根据您的Serializable类的各个方面自动为您执行此操作。(http://docs.oracle…...

pytorch搭建手写数字识别LeNet-5网络,并用tensorRT部署

pytorch搭建手写数字识别LeNet-5网络,并用tensorRT部署前言1、pytorch 搭建LeNet-5,并转为ONNX格式1.1 LeNet-5网络介绍1.2 ONNX(Open Neural Network Exchange)介绍1.3 pytorch 搭建 LeNet5网络2、将onnx转为tensorRT2.1 tensorRT 介绍2.1 onnx 转为 te…...

扬帆优配|五千亿巨头一度涨停! 4天3倍,港股又现“狂飙”股!

周一,A股三大指数走势分化。到午间收盘,沪指震荡走高涨近1%,深证成指涨0.75%,创业板指继续弱势调整。 盘面上,钢铁、煤炭、大金融等权重板块团体走强,三大通讯运营商一同拉升,其间我国电信盘中一…...

RocketMQ之(一)RocketMQ入门

一、RocketMQ入门一、RocketMQ 介绍1.1 RocketMQ 是什么?1.2 RocketMQ 应用场景01、应用解耦02、流量削峰03、数据分发1.3 RocketMQ 核心组成01、NameServer02、Broker03、Producer04、Consumer1.6 运转流程1.5 RocketMQ 架构01、NameServer 集群02、Broker 集群03、…...

推荐系统[三]:粗排算法常用模型汇总(集合选择和精准预估),技术发展历史(向量內积,WideDeep等模型)以及前沿技术

1.前言:召回排序流程策略算法简介 推荐可分为以下四个流程,分别是召回、粗排、精排以及重排: 召回是源头,在某种意义上决定着整个推荐的天花板;粗排是初筛,一般不会上复杂模型;精排是整个推荐环节的重中之重,在特征和模型上都会做的比较复杂;重排,一般是做打散或满足…...

vue3 + vite 使用 svg 可改变颜色

文章目录vue3 vite 使用 svg安装插件2、配置插件 vite.config.js3、根据vite配置的svg图标文件夹,建好文件夹,把svg图标放入4、在 src/main.js内引入注册脚本5、创建一个公共SvgIcon.vue组件6.1 全局注册SvgIcon.vue组件6.2、在想要引入svg的vue组件中引…...

SQL82 返回 2020 年 1 月的所有订单的订单号和订单日期

描述Orders订单表order_numorder_datea00012020-01-01 00:00:00a00022020-01-02 00:00:00a00032020-01-01 12:00:00a00042020-02-01 00:00:00a00052020-03-01 00:00:00【问题】编写 SQL 语句,返回 2020 年 1 月的所有订单的订单号(order_num)…...

vulnhub zico2

总结:脏牛提权 目录 下载地址 漏洞分析 信息收集 木马上传 反弹shell 提权 下载地址 zico2.ova (Size: 828 MB)Download: https://www.dropbox.com/s/dhidaehguuhyv9a/zico2.ovaDownload (Mirror): https://download.vulnhub.com/zico/zico2.ova使用方法&…...

处理窗口的常用API函数及窗口处理经验总结(附源码)

目录 1、检测窗口状态 2、将窗口前置显示 2.1、将窗口拉到最前面显示 2.2、将窗口置顶显示 2.3、将窗口设置到指定窗口的上面 3、将不显示的窗口强行显示出来 4、获取窗口的信息 5、通过窗口信息去查找窗口 5.1、调用GetClassName接口去比对窗口的类名 5.2、调用Find…...

@TableId注解详细介绍

TableId注解是专门用在主键上的注解,如果数据库中的主键字段名和实体中的属性名,不一样且不是驼峰之类的对应关系,可以在实体中表示主键的属性上加Tableid注解,并指定Tableid注解的value属性值为表中主键的字段名既可以对应上。 …...

kubectl常用的命令

目录 安装 kubectl 一、命令自动补全 二、常用命令 1、查看所有pod列表 2、查看RC和service列表 3、显示Node的详细信息 4、显示Pod的详细信息, 特别是查看Pod无法创建的时候的日志 5、 根据yaml创建资源, apply可以重复执行,create不行 6、基于nginx.yaml…...

Linux 配置远程SSH服务(密码+密钥)

环境准备: 将虚拟机1恢复快照,然后手动配置一个NAT模式IP为192.168.200.100,hostname设置为fuwu1 将虚拟机1复制为虚拟机2,然后手动配置一个NAT模式IP为192.168.200.200,hostname设置为fuwu2 windows准备 xshell 或 pu…...

WuThreat身份安全云-TVD每日漏洞情报-2023-02-20

漏洞名称:Microsoft Exchange Server 远程执行代码漏洞 漏洞级别:高危 漏洞编号:CVE-2023-21529,CNNVD-202302-1075 相关涉及:Microsoft Exchange Server 2016 Cumulative Update 23 漏洞状态:POC 参考链接:https://tvd.wuthreat.com/#/listDetail?TVD_IDTVD-2023-03822 漏洞…...

面试经常被问悲观锁和乐观锁?什么是cas?来我花3分钟时间告诉你

锁大家都知道吧,多线程访问资源会存在竞争,那么就需要加锁进而让多个线程一个一个访问。 比如有一个房间,一次只能进一个人,现在有十个人都想进去怎么办? 对,加锁。拿一把钥匙,谁抢到钥匙谁就…...

React源码分析3-render阶段(穿插scheduler和reconciler)

本章将讲解 react 的核心阶段之一 —— render阶段,我们将探究以下部分内容的源码: 更新任务的触发更新任务的创建reconciler 过程同步和异步遍历及执行任务scheduler 是如何实现帧空闲时间调度任务以及中断任务的 触发更新 触发更新的方式主要有以下几…...

3功能测试心得分享

1. 登陆、添加、删除、查询模块是我们经常遇到的,这些模块的测试点该如何考虑 (1)登陆 ① 用户名和密码都符合要求(格式上的要求) ② 用户名和密码都不符合要求(格式上的要求) ③ 用户名符合要求,密码不符合要求(格式上的要求) ④ 密码符合要求&#xff…...

Python-推导式

Python 推导式 Python 推导式是一种独特的数据处理方式,可以从一个数据序列构建另一个新的数据序列的结构体。 Python 支持各种数据结构的推导式: 列表(list)推导式 字典(dict)推导式 集合(set)推导式 元组(tuple)推导式 列表推导式 列表推导式格式…...

操作系统线程

进程那一章,我们留下了一个问题 第一个cpu调用进程,进程调用i/o设备,主动进入ready 队列 第二个cpu将程序执行时间平均分时,进程执行时间到 第三个fork函数,我们上一章的lab有实践,可以看出是父进程主动条用…...

vue3中如何定义响应式变量

vue2中定义方式&#xff1a; 熟悉vue2的前端开发小伙伴&#xff0c;都知道定义变量的方式是属于 选项式写法&#xff0c;所有的变量名全都定义在 data(){return { title:‘hello world’}},里&#xff0c;如下图所示&#xff1a; <template><div><h1>{{tit…...

LBE-LEX系列工业语音播放器|预警播报器|喇叭蜂鸣器的上位机配置操作说明

LBE-LEX系列工业语音播放器|预警播报器|喇叭蜂鸣器专为工业环境精心打造&#xff0c;完美适配AGV和无人叉车。同时&#xff0c;集成以太网与语音合成技术&#xff0c;为各类高级系统&#xff08;如MES、调度系统、库位管理、立库等&#xff09;提供高效便捷的语音交互体验。 L…...

未来机器人的大脑:如何用神经网络模拟器实现更智能的决策?

编辑&#xff1a;陈萍萍的公主一点人工一点智能 未来机器人的大脑&#xff1a;如何用神经网络模拟器实现更智能的决策&#xff1f;RWM通过双自回归机制有效解决了复合误差、部分可观测性和随机动力学等关键挑战&#xff0c;在不依赖领域特定归纳偏见的条件下实现了卓越的预测准…...

网络六边形受到攻击

大家读完觉得有帮助记得关注和点赞&#xff01;&#xff01;&#xff01; 抽象 现代智能交通系统 &#xff08;ITS&#xff09; 的一个关键要求是能够以安全、可靠和匿名的方式从互联车辆和移动设备收集地理参考数据。Nexagon 协议建立在 IETF 定位器/ID 分离协议 &#xff08;…...

【Python】 -- 趣味代码 - 小恐龙游戏

文章目录 文章目录 00 小恐龙游戏程序设计框架代码结构和功能游戏流程总结01 小恐龙游戏程序设计02 百度网盘地址00 小恐龙游戏程序设计框架 这段代码是一个基于 Pygame 的简易跑酷游戏的完整实现,玩家控制一个角色(龙)躲避障碍物(仙人掌和乌鸦)。以下是代码的详细介绍:…...

调用支付宝接口响应40004 SYSTEM_ERROR问题排查

在对接支付宝API的时候&#xff0c;遇到了一些问题&#xff0c;记录一下排查过程。 Body:{"datadigital_fincloud_generalsaas_face_certify_initialize_response":{"msg":"Business Failed","code":"40004","sub_msg…...

简易版抽奖活动的设计技术方案

1.前言 本技术方案旨在设计一套完整且可靠的抽奖活动逻辑,确保抽奖活动能够公平、公正、公开地进行,同时满足高并发访问、数据安全存储与高效处理等需求,为用户提供流畅的抽奖体验,助力业务顺利开展。本方案将涵盖抽奖活动的整体架构设计、核心流程逻辑、关键功能实现以及…...

【Linux】C语言执行shell指令

在C语言中执行Shell指令 在C语言中&#xff0c;有几种方法可以执行Shell指令&#xff1a; 1. 使用system()函数 这是最简单的方法&#xff0c;包含在stdlib.h头文件中&#xff1a; #include <stdlib.h>int main() {system("ls -l"); // 执行ls -l命令retu…...

django filter 统计数量 按属性去重

在Django中&#xff0c;如果你想要根据某个属性对查询集进行去重并统计数量&#xff0c;你可以使用values()方法配合annotate()方法来实现。这里有两种常见的方法来完成这个需求&#xff1a; 方法1&#xff1a;使用annotate()和Count 假设你有一个模型Item&#xff0c;并且你想…...

抖音增长新引擎:品融电商,一站式全案代运营领跑者

抖音增长新引擎&#xff1a;品融电商&#xff0c;一站式全案代运营领跑者 在抖音这个日活超7亿的流量汪洋中&#xff0c;品牌如何破浪前行&#xff1f;自建团队成本高、效果难控&#xff1b;碎片化运营又难成合力——这正是许多企业面临的增长困局。品融电商以「抖音全案代运营…...

基于数字孪生的水厂可视化平台建设:架构与实践

分享大纲&#xff1a; 1、数字孪生水厂可视化平台建设背景 2、数字孪生水厂可视化平台建设架构 3、数字孪生水厂可视化平台建设成效 近几年&#xff0c;数字孪生水厂的建设开展的如火如荼。作为提升水厂管理效率、优化资源的调度手段&#xff0c;基于数字孪生的水厂可视化平台的…...