Skip to content

Instantly share code, notes, and snippets.

View Dakuan's full-sized avatar
💭
😆

Dakuan

💭
😆
View GitHub Profile
spec:
containers:
- image: invoices_svc:v2
imagePullPolicy: IfNotPresent
name: invoices-svc
env:
- name: EXPECTED_DATE_URI
value: http://expected-date-svc.default.svc.cluster.local
spec:
containers:
- image: invoices_svc:v2
imagePullPolicy: IfNotPresent
name: invoices-svc
@Dakuan
Dakuan / index.js
Last active January 8, 2018 12:57
const express = require("express")
const request = require("request-promise")
const app = express()
const addExpectedDate = async invoice => {
try {
const { expectedDate } = await request(`${process.env.EXPECTED_DATE_URI}/api/expected-date/${invoice.id}`, {
json: true
})
---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
labels:
run: expected-date-svc
name: expected-date-svc
namespace: default
spec:
replicas: 3
const express = require("express")
const moment = require("moment")
const app = express()
app.get("/api/expected-date/:invoiceId", (req, res) => {
const invoiceId = parseInt(req.params.invoiceId)
// ¯\_(ツ)_/¯
const bump = Math.floor(Math.random() * 10) + 1
---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
labels:
run: auth-svc
name: auth-svc
namespace: default
spec:
replicas: 3
const express = require("express")
const app = express()
app.use((req, res) => {
if (req.get('authorization') === process.env.TOKEN) {
res.json({
ok: true
})
} else {
---
apiVersion: v1
kind: Service
metadata:
labels:
run: invoices-svc
name: invoices-svc
namespace: default
annotations:
getambassador.io/config: |
---
apiVersion: v1
kind: Service
metadata:
labels:
service: ambassador-admin
name: ambassador-admin
spec:
type: NodePort
ports:
---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
labels:
run: invoices-svc
name: invoices-svc
namespace: default
spec:
replicas: 3