在命令行输入kind create cluster --config kind.config,启动kind集群。 集群成功启动以后,输入如下指令安装kind专用的ingress-nginx: kubectl apply --filename https://raw.githubusercontent.com/kubernetes/ingress-nginx/master/deploy/static/provider/kind/deploy.yaml 输入如下指令,等待ingress-nginx controller就绪:...
kind: Ingress metadata:name: ingress-wildcard-host spec:rules:- host: "foo.bar.com"http:paths:- pathType: Prefix path: "/bar"backend:service:name: service1 port:number: 80 可以看到,通常我们会通过使用基于不用的域名和路径的策略,来访问不同的后端服务。所以配置文件中我们填写了 host、path ...
kind: Service metadata: name: tomnamespace:defaultspec: selector: app: tom release: canary ports:-name: http port:8080targetPort:8080-name: ajp port:8009targetPort:8009---apiVersion: apps/v1 kind: Deployment metadata: name: tom spec: replicas:3selector: matchLabels: app: tom release: ca...
kubectl explain --api-version=networking.k8s.io/v1beta1 ingress.spec.rules.http.paths # KIND: Ingress # VERSION: networking.k8s.io/v1 # (1) 创建Ingresss对象 ~/K8s/Day7/demo2$ kubectl create -f ingress-nginx-virtual-host.yaml # ingress.networking.k8s.io/ingress-nginx-virtual-host create...
---kind:DeploymentapiVersion:extensions/v1beta1metadata:name:web02namespace:test-nsspec:replicas:3template:metadata:labels:app:tomcat01spec:containers:-name:tomcatimage:192.168.171.151:5000/tomcat:v1---apiVersion:v1kind:Servicemetadata:name:tomcat-svcnamespace:test-nsspec:selector:app:tomcat01ports...
kind: Ingress metadata: name: new-nginx-ingress namespace: nginx-gray annotations: # 开启Canary。 nginx.ingress.kubernetes.io/canary:"true"#请求头为foo。 nginx.ingress.kubernetes.io/canary-by-header:"foo"# 请求头foo的值为bar时,请求才会被路由到新版本服务new-nginx中。
kind: Secret metadata: name: example-tls namespace: foo data: tls.crt: tls.key: type: kubernetes.io/tls [root@master231~]#7.查看创建的创建的资源 [root@master231manifests]# kubectl get all -n yinzhengjie-ingress -o wideNAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS ...
kind: Ingress metadata: name: auth-nginxbar-org namespace: default annotations: # 设置认证类型 nginx.ingress.kubernetes.io/auth-type: basic # 关联账号和密码 nginx.ingress.kubernetes.io/auth-secret: basic-auth # 显示认证提示信息 nginx.ingress.kubernetes.io/auth-realm: 'Authentication Required for...
kind: Ingress metadata: name: ingress-nginx spec: rules: - host: www2.westos.org http: paths: - path: / backend: serviceName: nginx-svc servicePort: 80 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16.
kind: Ingress metadata: annotations: nginx.ingress.kubernetes.io/configuration-snippet: > more_set_headers 'X-Content-Type-Options: nosniff' 'X-Frame-Options: SAMEORIGIN' "X-XSS-Protection : 1 mode=block " 'Set-Cookie: $sent_http_set_cookie; secure; HttpOnly' 'Strict-Transport-Security:max-...