Skip to content

Instantly share code, notes, and snippets.

@Jeffwan
Created April 2, 2017 18:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save Jeffwan/570f265cfcc59a3cc6e8a73ad8e32943 to your computer and use it in GitHub Desktop.
Save Jeffwan/570f265cfcc59a3cc6e8a73ad8e32943 to your computer and use it in GitHub Desktop.
kubernetes-service.yaml
apiVersion: v1
kind: Service
metadata:
name: nginxsvc
labels:
app: nginx
spec: 指定Service中的内容
ports: 映射列表
- port: 80 service的端口
porotocal: TCP 映射的协议类型,支持TCP/UDP
targetPort: 80 映射到pod的端口
name: www.baidu.com 该映射的名字
selector: 匹配器
port: 80
app: nginx 匹配label中app为nginx,port为80的pod
@vignesh-v3
Copy link

typo in line 10
also could you tell what this means app: nginx 匹配label中app为nginx,port为80的pod

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment