Skip to content

Instantly share code, notes, and snippets.

@wang-zhijun
Last active August 16, 2018 04:23
Show Gist options
  • Save wang-zhijun/cf45be5865f5917de32ad610abde8ca4 to your computer and use it in GitHub Desktop.
Save wang-zhijun/cf45be5865f5917de32ad610abde8ca4 to your computer and use it in GitHub Desktop.
kubernetes-sample

簡単なnginx pod

# tee pod-nginx.yaml <<-'EOF'
apiVersion: v1
kind: Pod 
metadata:
  name: nginx
  labels:
    app: my-nginx  
spec:
  containers:
  - name: nginx
    image: nginx:1.7.9
    ports:
    - containerPort: 80
EOF

Service

tee service-nginx.yaml <<-'EOF'
kind: Service
apiVersion: v1
metadata:
  name: my-service   
spec:
  selector:
    app: my-nginx
  ports:
  - protocol: TCP
    port: 80
EOF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment