Skaffold + k8s configuration for development

This commit is contained in:
Erki Aas 2022-10-05 17:41:06 +03:00
parent 23471d5bb3
commit 5fe7f45728
3 changed files with 165 additions and 0 deletions

17
.dockerignore Normal file
View File

@ -0,0 +1,17 @@
.kpt-pipeline/
k8s/
skaffold.yaml
README.md
.git/
node_modules/
# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
*.kpt-pipeline

102
k8s/deployment.yaml Normal file
View File

@ -0,0 +1,102 @@
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: playground
annotations:
kubernetes.io/ingress.class: traefik
cert-manager.io/cluster-issuer: default
traefik.ingress.kubernetes.io/router.entrypoints: websecure
traefik.ingress.kubernetes.io/router.middlewares: traefik-sso@kubernetescrd
traefik.ingress.kubernetes.io/router.tls: "true"
external-dns.alpha.kubernetes.io/target: traefik.k-space.ee
spec:
rules:
- host: playground.k-space.ee
http:
paths:
- pathType: Prefix
path: "/"
backend:
service:
name: log-viewer-frontend
port:
number: 8080
- pathType: Prefix
path: "/events"
backend:
service:
name: log-viewer-backend
port:
number: 3002
tls:
- hosts:
- playground.k-space.ee
secretName: playground-tls
---
apiVersion: v1
kind: Service
metadata:
name: log-viewer-frontend
spec:
type: ClusterIP
selector:
app: log-viewer-frontend
ports:
- protocol: TCP
port: 8080
---
apiVersion: v1
kind: Service
metadata:
name: log-viewer-backend
spec:
type: ClusterIP
selector:
app: log-viewer-backend
ports:
- protocol: TCP
port: 3002
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: log-viewer-frontend
spec:
selector:
matchLabels:
app: log-viewer-frontend
template:
metadata:
labels:
app: log-viewer-frontend
spec:
containers:
- name: log-viewer-frontend
image: harbor.k-space.ee/playground/log-viewer-frontend
ports:
- containerPort: 8080
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: log-viewer-backend
spec:
selector:
matchLabels:
app: log-viewer-backend
template:
metadata:
labels:
app: log-viewer-backend
spec:
containers:
- name: log-viewer-backend
image: harbor.k-space.ee/playground/log-viewer-backend
ports:
- containerPort: 3002
env:
- name: MONGODB_HOST
valueFrom:
secretKeyRef:
name: mongodb-application-readwrite
key: connectionString.standard

46
skaffold.yaml Normal file
View File

@ -0,0 +1,46 @@
apiVersion: skaffold/v3alpha1
kind: Config
metadata:
name: log-viewer-backend
build:
artifacts:
- image: harbor.k-space.ee/playground/log-viewer-backend
context: backend
docker:
dockerfile: Dockerfile
- image: harbor.k-space.ee/playground/log-viewer-frontend
context: frontend
docker:
dockerfile: Dockerfile
profiles:
- name: dev
activation:
- command: dev
build:
artifacts:
- image: harbor.k-space.ee/playground/log-viewer-backend
context: backend
docker:
buildArgs:
ENV: development
sync:
manual:
- src: '**/*.js'
dest: .
- image: harbor.k-space.ee/playground/log-viewer-frontend
context: frontend
docker:
buildArgs:
ENV: development
sync:
manual:
- src: 'src/**/*.vue'
dest: .
- src: 'src/**/*.js'
dest: .
- src: 'src/**/*.css'
dest: .
- src: 'src/**/*.svg'
dest: .
- src: 'index.html'
dest: .