Skip to content

Instantly share code, notes, and snippets.

@robotarmy
Created December 19, 2018 21:53
Show Gist options
  • Save robotarmy/98a6eb59fafacf079292a04688554fd8 to your computer and use it in GitHub Desktop.
Save robotarmy/98a6eb59fafacf079292a04688554fd8 to your computer and use it in GitHub Desktop.
function(namespace, name, selector, port, internal_port) {
kind: 'Service',
apiVersion: 'v1',
metadata: {
name: name,
namespace: namespace,
},
spec: {
selector: {
app: selector,
},
ports: [{
name: 'http',
protocol: 'TCP',
port: port,
targetPort: internal_port,
}],
type: 'NodePort',
},
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment