- added additional traefik ingress controller for accessing internal services via ingress.
		
			
				
	
	
		
			64 lines
		
	
	
		
			1.3 KiB
		
	
	
	
		
			YAML
		
	
	
	
	
	
			
		
		
	
	
			64 lines
		
	
	
		
			1.3 KiB
		
	
	
	
		
			YAML
		
	
	
	
	
	
| apiVersion: apps/v1
 | |
| kind: Deployment
 | |
| metadata:
 | |
|   name: portfolio-app
 | |
|   labels:
 | |
|     app: portfolio-app
 | |
| spec:
 | |
|   replicas: 1
 | |
|   selector:
 | |
|     matchLabels:
 | |
|       app: portfolio-app
 | |
|   template:
 | |
|     metadata:
 | |
|       labels:
 | |
|         app: portfolio-app
 | |
|     spec:
 | |
|       imagePullSecrets:
 | |
|         - name: my-registry-secret
 | |
|       containers:
 | |
|         - name: portfolio-app
 | |
|           image: "${DOCKER_REGISTRY_HOST}/my-portfolio-app:latest"
 | |
|           imagePullPolicy: Always
 | |
|           ports:
 | |
|             - containerPort: 80
 | |
|       restartPolicy: Always
 | |
|       terminationGracePeriodSeconds: 30
 | |
| ---
 | |
| apiVersion: v1
 | |
| kind: Service
 | |
| metadata:
 | |
|   name: portfolio-app-svc
 | |
| spec:
 | |
|   type: ClusterIP
 | |
|   ports:
 | |
|     - port: 80
 | |
|       targetPort: 80
 | |
|   selector:
 | |
|     app: portfolio-app
 | |
| 
 | |
| ---
 | |
| apiVersion: networking.k8s.io/v1
 | |
| kind: Ingress
 | |
| metadata:
 | |
|   name: portfolio
 | |
|   annotations:
 | |
|     traefik.ingress.kubernetes.io/router.entrypoints: websecure
 | |
|     cert-manager.io/cluster-issuer: "acme-issuer"
 | |
| spec:
 | |
|   tls:
 | |
|     - hosts:
 | |
|         - "${PORTFOLIO_HOST}"
 | |
|       secretName: portfolio-tls
 | |
|   rules:
 | |
|     - host: "${PORTFOLIO_HOST}"
 | |
|       http:
 | |
|         paths:
 | |
|           - path: /
 | |
|             pathType: Prefix
 | |
|             backend:
 | |
|               service:
 | |
|                 name: portfolio-app-svc
 | |
|                 port:
 | |
|                   number: 80
 |