- By Edmond Lau
- Highly Recommended 👍
- http://www.theeffectiveengineer.com/
- They are the people who get things done. Effective Engineers produce results.
# 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: |
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 |