Skip to content

Instantly share code, notes, and snippets.

View reyhansofian's full-sized avatar

Reyhan Sofian reyhansofian

View GitHub Profile
# 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
# path: hello-world/base/kustomization.yaml
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- deployment.yaml
- service.yaml
# 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:

Effective Engineer - Notes

What's an Effective Engineer?

  • They are the people who get things done. Effective Engineers produce results.

Adopt the Right Mindsets

@reyhansofian
reyhansofian / app.js
Last active September 1, 2020 13:26
Using environment variable on NodeJS app
const http = require('http');
const PORT = 8080;
const server = http.createServer((req, res) => {
const MYSQL_CONNECTION = process.env.MYSQL_CONNECTION;
const MYSQL_USER = process.env.MYSQL_USER;
const MYSQL_PASSWORD = process.env.MYSQL_PASSWORD;
});
apiVersion: v1
kind: Service
metadata:
name: hello-world-service
spec:
ports:
- name: public
port: 80
targetPort: 80
type: NodePort
hello-world/
├── base
│ ├── deployment.yaml
│ ├── kustomization.yaml
│ └── service.yaml
└── overlays
├── prod
│ ├── kustomization.yaml
│ └── patch.yaml
└── staging
apiVersion: v1
kind: Service
metadata:
name: hello-world-service
spec:
ports:
- name: public
port: 80
targetPort: 80
type: NodePort