Skip to content

Instantly share code, notes, and snippets.

@chhib
Created January 10, 2019 18:43
Show Gist options
  • Save chhib/588bf4e5324c62f39526c8032a484d84 to your computer and use it in GitHub Desktop.
Save chhib/588bf4e5324c62f39526c8032a484d84 to your computer and use it in GitHub Desktop.
Companion files used in the episode "Trying Kubernetes for the First Time" on the DevTips channel: https://youtu.be/ZSuh_nNPGls
var http = require('http'); var handleRequest = function(request, response) { console.log('Received request for URL: ' + request.url); response.writeHead(200); response.end('Hello World!'); }; var www = http.createServer(handleRequest); www.listen(8080);
apiVersion: apps/v1
kind: Deployment
metadata:
name: helloworlddeployment
spec:
selector:
matchLabels:
app: helloworldlabel
replicas: 2
template:
spec:
containers:
- name: node
imagePullPolicy: Never
image: helloworld:latest
ports:
- containerPort: 8080
metadata:
labels:
app: helloworldlabel
FROM node
EXPOSE 8080
COPY app.js .
CMD node app.js
apiVersion: v1
kind: Service
metadata:
name: helloworldservice
spec:
type: LoadBalancer
ports:
- port: 80
targetPort: 8080
selector:
app: helloworldlabel
externalIPs:
- 192.168.99.100
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment