Docker compone per Kubernetes
Manifesti da Docker Compose a Kubernetes
1
2
3
4
5
6
7
8
9
version: '3.3'
services:
nginx:
ports:
- '80:80'
volumes:
- '/var/run/docker.sock:/tmp/docker.sock:ro'
restart: always
image: nginx
---
apiVersion: v1
kind: Service
metadata:
namespace: default
name: nginx-80
labels:
app: nginx
spec:
ports:
- appProtocol: TCP
targetPort: 80
port: 80
selector:
app: nginx
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx
namespace: default
labels:
app: nginx
annotations: {}
spec:
selector:
matchLabels:
app: nginx
template:
metadata:
labels:
app: nginx
spec:
containers:
- name: nginx
image: nginx
volumeMounts:
- name: var-run-docker-sock
mountPath: /tmp/docker.sock
readOnly: true
ports:
- containerPort: 80
protocol: TCP
env: []
volumes:
- name: var-run-docker-sock
emptyDir: {}
replicas: 1