Created
May 28, 2020 20:22
-
-
Save slavahatnuke/8540b8ed2d961c81fc4648c24083a2c0 to your computer and use it in GitHub Desktop.
deployment.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
apiVersion: apps/v1 | |
kind: Deployment | |
metadata: | |
name: hello | |
spec: | |
replicas: 2 | |
template: | |
metadata: | |
labels: | |
app: hello | |
spec: | |
containers: | |
- name: hello | |
image: slavahatnuke/node-hello-app:1.0.0 | |
ports: | |
- containerPort: 3000 | |
selector: | |
matchLabels: | |
app: hello | |
--- | |
kind: Service | |
apiVersion: v1 | |
metadata: | |
name: hello | |
spec: | |
selector: | |
app: hello | |
ports: | |
- protocol: "TCP" | |
# Port accessible inside cluster | |
port: 8080 | |
# Port to forward to inside the pod | |
targetPort: 3000 | |
# Port accessible outside cluster (optional) | |
nodePort: 30001 | |
type: LoadBalancer | |
# https://kubernetes.io/docs/tasks/access-application-cluster/ingress-minikube/ | |
--- | |
apiVersion: networking.k8s.io/v1beta1 | |
kind: Ingress | |
metadata: | |
name: hello | |
annotations: | |
nginx.ingress.kubernetes.io/rewrite-target: /$1 | |
spec: | |
rules: | |
- http: | |
paths: | |
- path: / | |
pathType: Prefix | |
backend: | |
serviceName: hello | |
servicePort: 8080 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment