Skip to content

Instantly share code, notes, and snippets.

View reyhansofian's full-sized avatar

Reyhan Sofian reyhansofian

View GitHub Profile
apiVersion: v1
kind: Service
metadata:
name: hello-world-service
spec:
ports:
- name: public
port: 80
targetPort: 80
type: NodePort
# path: hello-world/overlays/staging/kustomization.yaml
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
bases:
- ../base
patchesStrategicMerge:
- patch-replicas.yaml
# path: hello-world/overlays/staging/patch-replicas.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: hello-world-deployment
spec:
replicas: 3
apiVersion: v1
kind: Service
metadata:
name: hello-world-service
spec:
ports:
- name: public
port: 80
targetPort: 80
type: NodePort
# path: hello-world/base/service.yaml
apiVersion: v1
kind: Service
metadata:
name: hello-world-service
spec:
type: NodePort
ports:
- name: public
port: 80
# path: hello-world/base/deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: hello-world-deployment
spec:
replicas: 1
template:
spec:
containers:
# path: hello-world/base/kustomization.yaml
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- deployment.yaml
- service.yaml
hello-world/
├── base
│ ├── deployment.yaml
│ ├── kustomization.yaml
│ └── service.yaml
└── overlays
├── prod
│ ├── kustomization.yaml
│ └── patch.yaml
└── staging
@reyhansofian
reyhansofian / k8s.yaml
Created February 24, 2019 11:04
Kubernetes manifest using configmap reload container
apiVersion: v1
kind: Service
metadata:
labels:
test-app: test
name: test
namespace: default
spec:
externalTrafficPolicy: Cluster
ports:
@reyhansofian
reyhansofian / app.js
Last active February 24, 2019 11:07
Application server using configmap reload
// @ts-check
const express = require("express");
const app = express();
const fs = require("fs");
const bodyParser = require('body-parser');
const mountPath = "/etc/config";
const configMapFile = "..data";