hello-app-deployment.yml:
apiVersion: apps/v1
kind: Deployment
metadata:
name: hello-app-deployment
labels:
app: hello-app
spec:
replicas: 1
selector:
matchLabels:
app: hello-app
template:
metadata:
labels:
app: hello-app
spec:
containers:
- name: hello-app
image: gcr.io/google-samples/hello-app:1.0
ports:
- containerPort: 8080
apiVersion: v1
kind: Service
metadata:
name: hello-app-service
spec:
selector:
app: hello-app
type: NodePort
ports:
- protocol: TCP
port: 8082
targetPort: 8080
Deploy:
kubectl apply -f hello-app-deployment.yml
kubectl apply -f hello-app-service.yml
Acces via web:
minikube service hello-app-service