首页 > 系统相关 >创建一个nginx资源清单

创建一个nginx资源清单

时间:2022-10-27 12:14:48浏览次数:43  
标签:protocol name 创建 nginx test 清单 80 port

注意selector一定要书写正确,否则通过集群IP:端口 或者是节点ip:外部访问端口 都无法访问

apiVersion: v1
kind: Pod
metadata:
  name: test-pod
  namespace: test
  labels:
    environment: stg
spec:  
  containers:
  - name: my-nginx-container
    image: nginx:latest
    imagePullPolicy: IfNotPresent
    ports:
    - name: nginx-port
      containerPort: 80
      protocol: TCP
---
apiVersion: v1
kind: Service
metadata:
  name: svc-nginx
  namespace: test
spec:
  ports:
  - port: 80
    protocol: TCP
    targetPort: 80
  selector:
    environment: stg
  type: NodePort

标签:protocol,name,创建,nginx,test,清单,80,port
From: https://www.cnblogs.com/bangbangzoutianya/p/16831760.html

相关文章

  • nginxssl证书配置
    nginx可以用openssl自建的CA证书反向代理互联网的https网站吗?当然不行呀,证书是由权威机构颁发的文件,自己生成的证书并不具备可信度,所以必须要向CA申请证书。这样才能在互联......
  • nginxlocation优先级
    nginx反向代理一个server下配置多个location域名问题当你设置两个location/时,当然只会匹配第一个了。你的意思是不是要配置两个域名?server{listen80;server_namewww.1.com;......
  • nginx源码编译安装
    window版本的nginx能重新编译吗?如何添加新的模块呢找到安装nginx的源码根目录,如果没有的话下载新的源码xvzfnginx-1.3.2.tar.gz查看ngixn版本极其编译参数/usr/local/ngin......
  • nginxhttp转到https没有带端口
    nginxhttps自动跳转成http怎么解决您关闭301跳转,HTTPS自然就无法访问,如果您要HTTPS跳转HTTP,这个是不正确的行为,如果设置会导致搜索引擎蜘蛛混乱,无法确定实际网站,目前搜索......
  • nginxkeepalived和tomcat整合
    最前面两台NGINX+keepalived可不可以同时承担WEB的高可用负载均衡和图片服务器并实现高可用?完全可以实现的nginx可以设置多个server,相互之间互不影响,用keepalived做负载的应......
  • nginxipv6转ipv4
    ipv6only事什么意思IPv6only=on的意思:打开IPv6only网络;IPv6only=off的意思:关闭IPv6only网络;通常在nginx开启IPV6支持配置,使用“nginxipv6only=on”景安网络作为全国首家IP......
  • nginx错误日志解析
    nginx错误日志在哪访问日志的话没有指定路径,在安装目录的logs目录下,指定的话就看到指定什么路径了另外NGINX+PHP的话,错误日志不好找,要开启PHP的日志,可以使用系统日志(/var/......
  • nginx转发到页面白屏
    laravel安装完成后,访问public目录,显示一片空白怎么回事白屏没有错误提示一般是php.ini的display_errors没有启用的问题所以首先确保display_errors已经是On的状态然后打开De......
  • docker安装nginx配置
    编译安装nginx的配置文件的路径在哪这个版本不同,位置还是不同的。我的是nginx-1.9.9版本源码安装,配置文件在conf这个目录里面:/usr/local/nginx/conf/nginx.conf如果你找不见......
  • nginx没有权限
    nginx.conf配置的root目录要什么权限你可以修改nginx配置里的root,比如下面的代码路径是到/data/www读取:server{listen80;server_nametest.abc.com;root/data/www;indexindex......