Skip to content
This repository was archived by the owner on Mar 27, 2023. It is now read-only.

Commit c356d78

Browse files
committed
wip add minikube resource definitions
1 parent 62c6113 commit c356d78

File tree

7 files changed

+92
-7
lines changed

7 files changed

+92
-7
lines changed

documentation/docs/topics/minikube/README.md

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,4 +268,34 @@ DNS will be easier since we are building static assets outside of the context of
268268
{"message": "Root"}
269269
```
270270
271-
We need to set the `DOMAIN_NAME` environment variable to `kubernetes-django-service`, and also set the port, and we should be able to access the backend from frontend AJAX calls.
271+
This works from inside of a pod, but we can't use this for our static site since `localhost` won't know how to resolve `kubernetes-django-service`. One solution for this is to get the `port:ip` of the backend service from minikube, and then use this value for the `baseUrl` in our frontend application:
272+
273+
**minikube/Dockerfile**
274+
275+
```Dockerfile
276+
# build stage
277+
FROM node:10-alpine as build-stage
278+
WORKDIR /app/
279+
ENV DOMAIN_NAME 192.168.99.101:30958 <-- this is the nodePort for the backend service
280+
ENV HTTP_PROTOCOL http
281+
COPY quasar/package.json /app/
282+
RUN npm cache verify
283+
RUN npm install -g @quasar/cli
284+
RUN npm install --progress=false
285+
COPY quasar /app/
286+
RUN quasar build -m pwa
287+
288+
# minikube stage
289+
FROM nginx:1.13.12-alpine as minikube
290+
COPY nginx/minikube/minikube.conf /etc/nginx/nginx.conf
291+
COPY --from=build-stage /app/dist/pwa /dist/
292+
EXPOSE 80
293+
CMD ["nginx", "-g", "daemon off;"]
294+
```
295+
296+
We need to set the `DOMAIN_NAME` environment variable to `kubernetes-django-service`, and also set the port, and we should be able to access the backend from frontend AJAX calls.
297+
298+
## Troubleshooting and Misc
299+
300+
https://stackoverflow.com/questions/55573426/virtualbox-is-configured-with-multiple-host-only-adapters-with-the-same-ip-whe
301+

kubernetes/frontend/deployment.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@ spec:
1717
containers:
1818
- name: frontend
1919
imagePullPolicy: IfNotPresent
20-
image: frontend:5
20+
image: frontend:6

kubernetes/frontend/service.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ spec:
66
selector:
77
app: frontend-container
88
ports:
9-
- protocol: TCP
9+
- nodePort: 30001
10+
protocol: TCP
1011
port: 80
1112
targetPort: 80
1213
type: NodePort

kubernetes/redis/deployment.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
apiVersion: apps/v1beta2
2+
kind: Deployment
3+
metadata:
4+
name: redis
5+
labels:
6+
deployment: redis
7+
spec:
8+
selector:
9+
matchLabels:
10+
pod: redis
11+
replicas: 1
12+
template:
13+
metadata:
14+
labels:
15+
pod: redis
16+
spec:
17+
containers:
18+
- name: master
19+
image: redis
20+
resources:
21+
requests:
22+
cpu: 100m
23+
memory: 100Mi
24+
ports:
25+
- containerPort: 6379

kubernetes/redis/service.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
apiVersion: v1
2+
kind: Service
3+
metadata:
4+
name: redis-service
5+
spec:
6+
selector:
7+
pod: redis
8+
ports:
9+
- protocol: TCP
10+
port: 6379
11+
targetPort: 6379

nginx/minikube/Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
# build stage
22
FROM node:10-alpine as build-stage
33
WORKDIR /app/
4-
ENV DOMAIN_NAME 192.168.99.101:30958
4+
ENV DOMAIN_NAME 192.168.99.105:30958
5+
ENV GITHUB_KEY github123
6+
ENV GOOGLE_OAUTH2_KEY google123
57
ENV HTTP_PROTOCOL http
68
COPY quasar/package.json /app/
79
RUN npm cache verify

quasar/quasar.conf.js

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ module.exports = function(ctx) {
2323
// iconSet: "ionicons-v4",
2424
// lang: "de", // Quasar language
2525

26-
all: true, // --- includes everything; for dev only!
26+
// all: true, // --- includes everything; for dev only!
2727

2828
components: [
2929
"QLayout",
@@ -38,10 +38,26 @@ module.exports = function(ctx) {
3838
"QList",
3939
"QItem",
4040
"QItemSection",
41-
"QItemLabel"
41+
"QItemLabel",
42+
"QDialog",
43+
"QCard",
44+
"QCardActions",
45+
"QTab",
46+
"QTabs",
47+
"QTabPanel",
48+
"QTabPanels",
49+
"QInput",
50+
"QToggle",
51+
"QExpansionItem",
52+
"QAjaxBar",
53+
"QChip",
54+
"QCheckbox",
55+
"QCarousel",
56+
"QCarouselSlide",
57+
"QSelect"
4258
],
4359

44-
directives: ["Ripple"],
60+
directives: ["Ripple", "ClosePopup"],
4561

4662
// Quasar plugins
4763
plugins: ["Notify", "Cookies"]

0 commit comments

Comments
 (0)