ns
apiVersion: v1
kind: Namespace
metadata:
name: database
service
kind: Service
apiVersion: v1
metadata:
name: redis
spec:
type: NodePort
ports:
- name: redis
port: 6379
nodePort: 30379
targetPort: 6379
protocol: TCP
selector:
name: redis
Deployment
apiVersion: apps/v1
kind: Deployment
metadata:
name: redis
spec:
replicas: 1
selector:
matchLabels:
name: redis
template:
metadata:
labels:
name: redis
spec:
containers:
- name: redis
image: redis
imagePullPolicy: IfNotPresent
ports:
- containerPort: 6379
name: redis
protocol: TCP