first import
All checks were successful
Web/cv/pipeline/head This commit looks good
web/cv/pipeline/head This commit looks good

This commit is contained in:
Julien Cabillot
2021-12-29 15:17:36 -05:00
parent b34c788581
commit b819ec86c9
10 changed files with 205 additions and 0 deletions

35
kustomize/depl.yml Normal file
View File

@@ -0,0 +1,35 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: "cv"
labels:
app: "front"
spec:
template:
metadata:
name: "front-apache"
labels:
owner: "jcabillot"
app: "front"
spec:
automountServiceAccountToken: false
containers:
- name: "front-apache"
image: "jcabillot/cv"
ports:
- name: "http"
containerPort: 8080
protocol: "TCP"
livenessProbe:
httpGet:
path: "/"
port: "http"
readinessProbe:
httpGet:
path: "/"
port: "http"
replicas: 1
selector:
matchLabels:
app: "front"

25
kustomize/ingress.yml Normal file
View File

@@ -0,0 +1,25 @@
---
#apiVersion: networking.k8s.io/v1
#kind: Ingress
#metadata:
# name: "cv"
# annotations:
# kubernetes.io/ingress.class: "traefik"
# traefik.ingress.kubernetes.io/router.entrypoints: "web,websecure"
# cert-manager.io/cluster-issuer: "letsencrypt-prod"
#spec:
# tls:
# - hosts:
# - "cv.opti.cabillot.eu"
# secretName: "cvcabilloteu-tls"
# rules:
# - host: "cv.opti.cabillot.eu"
# http:
# paths:
# - path: "/"
# pathType: "Prefix"
# backend:
# service:
# name: "cv"
# port:
# name: "http"

View File

@@ -0,0 +1,50 @@
---
# TODO: Named port for service
# but currently unsupported on my k3s cluster https://github.com/traefik/traefik/pull/7668
apiVersion: traefik.containo.us/v1alpha1
kind: IngressRoute
metadata:
name: "cv-websecure"
spec:
entryPoints:
- "websecure"
routes:
- kind: Rule
match: Host(`cv.opti.cabillot.eu`)
middlewares: []
priority: 10
services:
- kind: Service
name: "cv"
port: 80
tls:
secretName: "cvcabilloteu-tls"
---
apiVersion: traefik.containo.us/v1alpha1
kind: IngressRoute
metadata:
name: "cv-web"
spec:
entryPoints:
- "web"
routes:
- match: Host(`cv.opti.cabillot.eu`)
kind: Rule
priority: 10
services:
# in this IngressRoute the service will be never called
# because of the redirect middleware BUT DO NOT REMOVE !
- kind: Service
name: "cv"
port: 80
middlewares:
- name: "httpsredirect"
---
apiVersion: traefik.containo.us/v1alpha1
kind: Middleware
metadata:
name: "httpsredirect"
spec:
redirectScheme:
scheme: https
permanent: true

View File

@@ -0,0 +1,7 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- depl.yml
- ingress.yml
- ingressroute.yml
- svc.yml

13
kustomize/svc.yml Normal file
View File

@@ -0,0 +1,13 @@
apiVersion: v1
kind: Service
metadata:
name: 'cv'
spec:
type: "ClusterIP"
ports:
- name: "http"
port: 80
protocol: "TCP"
targetPort: "http"
selector:
app: "front"