diff --git a/README.md b/README.md index 9458779ce9..b0f5a6ef8c 100644 --- a/README.md +++ b/README.md @@ -97,6 +97,37 @@ yarn add react react-dom @excalidraw/excalidraw Check out our [documentation](https://docs.excalidraw.com/docs/@excalidraw/excalidraw/installation) for more details! +## Deploy on Minikube + +- 1. ```git clone git@github.com:rescenic/excalidraw.git``` +- 2. ```cd excalidraw``` +- 3. ```docker build -t excalidraw:v1.0.0 .``` +- 4. ```minikube image load excalidraw:v1.0.0``` +- 5. ```minikube image ls``` +- 6. ```minikube addons enable ingress``` +- 7. Add rescenic.com to system hosts: + +```host +127.0.0.1 rescenic.com +::1 rescenic.com +``` + +- 8. ```kubectl apply -f deployment.yaml``` +- 9. Check service in the pod: + +```zsh + kubectl get pod +NAME READY STATUS RESTARTS AGE +excalidraw-7f4cbc69b4-dqkbt 1/1 Running 0 17m + kubectl exec -it excalidraw-7f4cbc69b4-dqkbt -- /bin/sh +/ # curl localhost +/ # exit +``` + +- 10. ```kubectl port-forward svc/excalidraw-service 9991:80``` +- 11. ```minikube tunnel``` +- 12. Check in host browser: http://rescenic.com + ## Contributing - Missing something or found a bug? [Report here](https://github.com/excalidraw/excalidraw/issues). diff --git a/deployment.yaml b/deployment.yaml new file mode 100644 index 0000000000..aa5f78f1e3 --- /dev/null +++ b/deployment.yaml @@ -0,0 +1,57 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: excalidraw +spec: + selector: + matchLabels: + app: excalidraw + template: + metadata: + labels: + app: excalidraw + spec: + containers: + - name: excalidraw + image: excalidraw:v1.0.0 + resources: + limits: + memory: "128Mi" + cpu: "500m" + ports: + - containerPort: 80 + + +--- +apiVersion: v1 +kind: Service +metadata: + name: excalidraw-service +spec: + selector: + app: excalidraw + ports: + - port: 80 + targetPort: 80 + +# https://kubernetes.io/docs/concepts/services-networking/ingress/#the-ingress-resource +--- + +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: excalidraw-ingress + labels: + name: excalidraw-ingress +spec: + rules: + - host: rescenic.com + http: + paths: + - path: / + pathType: Prefix + backend: + service: + name: excalidraw-service + port: + number: 80