当前位置: 首页 > 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…...

构建高效用户行为分析系统:Este全栈应用监控与性能追踪终极指南

构建高效用户行为分析系统&#xff1a;Este全栈应用监控与性能追踪终极指南 【免费下载链接】este This repo is suspended. 项目地址: https://gitcode.com/gh_mirrors/es/este 在当今快速发展的应用开发领域&#xff0c;用户行为分析系统和应用性能监控已成为每个成功…...

Android compose 可见性动画未执行问题修复

接着修改待办事项demo&#xff0c; 动画有问题&#xff0c; 导致初始不显示数据&#xff0c;其实数据库是有数据的。原代码如下&#xff1a;package com.example.testcompose1import androidx.compose.animation.AnimatedVisibility import androidx.compose.animation.core.Fa…...

7张图看懂Claude Code:从架构图解到工程实现

这篇文章用7张图架构图解的方式&#xff0c;系统讲解Claude Code的工程实现。 为什么要关注Claude Code&#xff1f; 2026年3月31日&#xff0c;Anthropic的Claude Code CLI工具因npm发布包意外暴露了.map文件&#xff0c;导致完整源码泄露。 这虽然说不是一次主动的开源&am…...

DOM DocumentImpl:深入解析文档对象模型的核心实现

DOM DocumentImpl:深入解析文档对象模型的核心实现 引言 在Web开发领域,DOM(文档对象模型)是前端开发的基础,它允许开发者通过JavaScript操作HTML文档。DOM DocumentImpl是DOM的核心实现之一,它提供了丰富的API来操作文档结构。本文将深入解析DOM DocumentImpl,帮助开…...

Windows HEIC缩略图扩展:让苹果照片在PC上清晰呈现

Windows HEIC缩略图扩展&#xff1a;让苹果照片在PC上清晰呈现 【免费下载链接】windows-heic-thumbnails Enable Windows Explorer to display thumbnails for HEIC/HEIF files 项目地址: https://gitcode.com/gh_mirrors/wi/windows-heic-thumbnails 问题场景&#xf…...

植物大战僵尸游戏辅助工具:解锁9大隐藏功能提升玩家效率的完整指南

植物大战僵尸游戏辅助工具&#xff1a;解锁9大隐藏功能提升玩家效率的完整指南 【免费下载链接】pvztoolkit 植物大战僵尸 PC 版综合修改器 项目地址: https://gitcode.com/gh_mirrors/pv/pvztoolkit 在游戏辅助工具领域&#xff0c;开源项目往往能提供最具创新性的解决…...

Pytest参数化测试中文乱码?这2个隐藏技巧让你的测试报告清晰可读

Pytest参数化测试中文乱码&#xff1f;这2个隐藏技巧让你的测试报告清晰可读 在Python自动化测试领域&#xff0c;Pytest凭借其简洁的语法和强大的功能已成为开发者的首选工具。特别是它的参数化测试功能&#xff0c;能够高效验证多组输入数据下的代码行为。但当我们尝试用中文…...

人脸检测新突破:cv_resnet101_face-detection_cvpr22papermogface对戴口罩人脸识别率达91.3%

人脸检测新突破&#xff1a;cv_resnet101_face-detection_cvpr22papermogface对戴口罩人脸识别率达91.3% 你还在为人脸检测工具在复杂场景下“掉链子”而烦恼吗&#xff1f;比如合影里远处的小脸、侧脸&#xff0c;或者戴着口罩、被遮挡的人脸&#xff0c;传统工具常常识别不出…...

C++ 子数组位运算结果 题型

或运算 898. 子数组按位或操作 - 力扣&#xff08;LeetCode&#xff09; 我们直接看题&#xff0c;意思很明显&#xff0c;就是找出所有子数组&#xff0c;然后将子数组各个数相或得到的结果有多少个不同。 这里我们首先想到的就是直接把所有子数组求出来在或起来&#xff0c…...

seo优化专业如何做移动端优化_seo优化专业如何做关键词优化

SEO优化专业如何做移动端优化 随着互联网的发展&#xff0c;移动端已经成为了人们获取信息和服务的主要渠道。对于SEO优化专业人员而言&#xff0c;如何进行有效的移动端优化成为了一个重要的课题。本文将从问题分析、原因说明、解决方法和注意事项四个方面&#xff0c;帮助SE…...