Skip to content

Instantly share code, notes, and snippets.

@viktortnk
Created June 20, 2018 07:22
Show Gist options
  • Save viktortnk/68479ac6786ef218f9d20a76d7266c6f to your computer and use it in GitHub Desktop.
Save viktortnk/68479ac6786ef218f9d20a76d7266c6f to your computer and use it in GitHub Desktop.
k8s service example
# service-example.yml
kind: Service
apiVersion: v1
metadata:
name: my-service-name
namespace: default
labels:
app: my-service-name
env: dev
spec:
type: LoadBalancer
ports:
- name: http
port: 80
targetPort: service # name or number of target port in your deployment
selector: # selector should match labes from your deployment
app: my-service-name
env: dev
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment