89 lines
1.9 KiB
YAML
89 lines
1.9 KiB
YAML
---
|
|
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: nginx-deployment
|
|
labels:
|
|
app: aplication_front_portefolio
|
|
spec:
|
|
replicas: 1
|
|
selector:
|
|
matchLabels:
|
|
app: aplication_front_portefolio
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: aplication_front_portefolio
|
|
spec:
|
|
containers:
|
|
- name: nginx
|
|
image: front_portefolio:latest
|
|
imagePullPolicy: Always
|
|
ports:
|
|
- name: http
|
|
containerPort: 80
|
|
protocol: TCP
|
|
- name: https
|
|
containerPort: 443
|
|
protocol: TCP
|
|
---
|
|
apiVersion: v1
|
|
kind: Service
|
|
metadata:
|
|
name: serveur-portefolio-service
|
|
spec:
|
|
# On supprime type: LoadBalancer. Le type par défaut est ClusterIP.
|
|
selector:
|
|
app: aplication_front_portefolio
|
|
ports:
|
|
- name: http
|
|
protocol: TCP
|
|
port: 80
|
|
targetPort: 80
|
|
- name: https
|
|
protocol: TCP
|
|
port: 443
|
|
targetPort: 443
|
|
|
|
---
|
|
apiVersion: networking.k8s.io/v1
|
|
kind: Ingress
|
|
metadata:
|
|
name: portefolio-ingress
|
|
annotations:
|
|
cert-manager.io/cluster-issuer: "letsencrypt-prod"
|
|
# L'annotation kubernetes.io/ingress.class est obsolète, on utilise spec.ingressClassName à la place
|
|
spec:
|
|
ingressClassName: traefik
|
|
tls:
|
|
- hosts:
|
|
- portefolio.sylvaintrouilh.fr
|
|
secretName: portefolio-tls-secret
|
|
rules:
|
|
- host: portefolio.sylvaintrouilh.fr
|
|
http:
|
|
paths:
|
|
- path: /
|
|
pathType: Prefix
|
|
backend:
|
|
service:
|
|
name: serveur-portefolio-service
|
|
port:
|
|
number: 80
|
|
|
|
---
|
|
apiVersion: cert-manager.io/v1
|
|
kind: ClusterIssuer
|
|
metadata:
|
|
name: letsencrypt-prod
|
|
spec:
|
|
acme:
|
|
server: https://acme-v02.api.letsencrypt.org/directory
|
|
email: sylvain.trouilh@hotmail.com
|
|
privateKeySecretRef:
|
|
name: letsencrypt-prod
|
|
solvers:
|
|
- http01:
|
|
ingress:
|
|
class: traefik
|