Skip to content

Instantly share code, notes, and snippets.

@victorsteven
Last active September 9, 2019 15:37
Show Gist options
  • Save victorsteven/9609be1698586313c145e36f4347d88d to your computer and use it in GitHub Desktop.
Save victorsteven/9609be1698586313c145e36f4347d88d to your computer and use it in GitHub Desktop.
apiVersion: v1
kind: Service # Type of the kubernetes resource
metadata:
name: fullstack-app-postgres # Name of the Kubernetes resource
labels: # Labels that will be applied to the resource
app: fullstack-app-postgres
spec:
type: NodePort # Gives each node an external IP that’s accessible from outside the cluster and also opens a Port.
selector:
app: fullstack-app-postgres # Selects any Pod with labels `app=fullstack-app-postgres`
ports:
- name: http
port: 8080
targetPort: 8080
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment