Skip to content

Instantly share code, notes, and snippets.

@inyee786
inyee786 / Dockerfile
Last active May 1, 2023 08:45
Deploy SPA on Kubernetes
# Stage 0, "build-stage", based on Node.js, to build and compile the frontend
FROM node:10.8.0 as build-stage
WORKDIR /app
COPY package*.json /app/
RUN npm install
COPY ./ /app/
ARG configuration=production
RUN npm run build -- --output-path=./dist/out --configuration $configuration
# Stage 1, based on Nginx, to have only the compiled app, ready for production with Nginx
# Expires map
map $sent_http_content_type $expires {
default off;
text/html epoch;
text/css max;
application/json max;
application/javascript max;
~image/ max;
}
apiVersion: v1
kind: Service
metadata:
labels:
service-label-key: service-label-value
name: service-name-loadbalancer
spec:
type: LoadBalancer
ports:
- name: service-port-name
@inyee786
inyee786 / .yamllint.yaml
Created August 31, 2019 17:01
lint rule for travis.yml chart.yaml and values.yaml
---
extends: default
rules:
comments:
min-spaces-from-content: 1
line-length:
max: 150
braces:
min-spaces-inside: 0
max-spaces-inside: 0
@inyee786
inyee786 / .tavis.yml
Last active August 31, 2019 16:55
travis file to build and package the helm chart
---
language: python
env:
global:
- HELM_URL=https://storage.googleapis.com/kubernetes-helm
- HELM_TGZ=helm-v2.4.2-linux-amd64.tar.gz
- REPO_DIR=/home/travis/build/inyee786/test-helm
- YAMLLINT_VERSION=1.8.1
- HARBOR_CHART_URL=https://{***domain***}/chartrepo
@inyee786
inyee786 / grafana-dashboard.json
Created April 23, 2019 11:49
mongodb exporter with openebs volume
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": "-- Grafana --",
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
@inyee786
inyee786 / PMM-mysql-grafana-dashboard.json
Last active April 11, 2019 07:54
percona-mysql expoter
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": "-- Grafana --",
"enable": true,
"hide": false,
"iconColor": "#e0752d",
"limit": 100,
# Stage 0, "build-stage", based on Node.js, to build and compile the frontend
FROM node:10.8.0 as build-stage
WORKDIR /app
COPY package*.json /app/
RUN npm install
COPY ./ /app/
ARG configuration=production
RUN npm run build -- --output-path=./dist/out --configuration $configuration
# Stage 1, based on Nginx, to have only the compiled app
apiVersion: apps/v1beta1
kind: Deployment
metadata:
name: deployment-name
spec:
replicas: 1
template:
metadata:
labels:
label-key : label-value
apiVersion: v1
kind: Service
metadata:
labels:
service-label-key: service-label-value
name: service-name
spec:
type: ClusterIP
ports:
- name: service-port-name