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 # What kind of object you want to create | |
| metadata: | |
| name: simple-express-js-server | |
| spec: | |
| selector: | |
| app: simple-express-js-server | |
| ports: | |
| - port: 80 | |
| targetPort: 3000 |
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 # for versions before 1.9.0 use apps/v1beta2 | |
| kind: Deployment # What kind of object you want to create | |
| metadata: | |
| name: simple-express-js-server | |
| spec: | |
| replicas: 1 # tells deployment to run 1 pods matching the template | |
| selector: | |
| matchLabels: | |
| app: simple-express-js-server | |
| template: # content from this line is pod spec , which image to use, lables for the pods , and the container info |
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
| const express = require("express") | |
| const app = express() | |
| app.get("/", function(req, res) { | |
| res.send("Hello World") | |
| }) | |
| app.listen(3000, function(req,res){ | |
| console.log("App is listening at port : 3000! ") | |
| }) |
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
| # using base image with node version 12 installed | |
| FROM node:12 | |
| # Create working app directory | |
| WORKDIR /usr/src/app | |
| # copy packages | |
| # Install app dependencies | |
| COPY package*.json ./ | |
| RUN npm install | |
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: simple-express-js-server | |
| spec: | |
| replicas: 1 | |
| selector: | |
| matchLabels: | |
| app: simple-express-js-server | |
| template: |
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
| -- Create a group | |
| CREATE ROLE readaccess; | |
| -- Grant access to existing tables | |
| GRANT USAGE ON SCHEMA public TO readaccess; | |
| GRANT SELECT ON ALL TABLES IN SCHEMA public TO readaccess; | |
| -- Grant access to future tables | |
| ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT ON TABLES TO readaccess; |