67 lines
		
	
	
		
			1.4 KiB
		
	
	
	
		
			YAML
		
	
	
	
	
	
			
		
		
	
	
			67 lines
		
	
	
		
			1.4 KiB
		
	
	
	
		
			YAML
		
	
	
	
	
	
| apiVersion: apps/v1
 | |
| kind: Deployment
 | |
| metadata:
 | |
|   name: portfolio-app
 | |
|   namespace: my-portfolio
 | |
|   labels:
 | |
|     app: portfolio-app
 | |
| spec:
 | |
|   replicas: 1
 | |
|   selector:
 | |
|     matchLabels:
 | |
|       app: portfolio-app
 | |
|   template:
 | |
|     metadata:
 | |
|       labels:
 | |
|         app: portfolio-app
 | |
|     spec:
 | |
|       imagePullSecrets:
 | |
|         - name: docker-registry-credentials
 | |
|       containers:
 | |
|         - name: portfolio-app
 | |
|           image: "${DOCKER_REGISTRY_HOST}/taqi/portfolio/my-portfolio-app:latest"
 | |
|           imagePullPolicy: Always
 | |
|           ports:
 | |
|             - containerPort: 80
 | |
|       restartPolicy: Always
 | |
|       terminationGracePeriodSeconds: 30
 | |
| ---
 | |
| apiVersion: v1
 | |
| kind: Service
 | |
| metadata:
 | |
|   name: portfolio-app-svc
 | |
|   namespace: my-portfolio
 | |
| spec:
 | |
|   type: ClusterIP
 | |
|   ports:
 | |
|     - port: 80
 | |
|       targetPort: 80
 | |
|   selector:
 | |
|     app: portfolio-app
 | |
| 
 | |
| ---
 | |
| apiVersion: networking.k8s.io/v1
 | |
| kind: Ingress
 | |
| metadata:
 | |
|   name: portfolio
 | |
|   namespace: my-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
 |