Created
January 10, 2019 18:43
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM node | |
EXPOSE 8080 | |
COPY app.js . | |
CMD node app.js |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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