Created
December 21, 2021 11:21
-
-
Save lucaam/190ce4e87dc5751cf805db7e7f3c6a91 to your computer and use it in GitHub Desktop.
This file contains 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: v1 | |
kind: Service | |
metadata: | |
name: hello1-svc | |
spec: | |
selector: | |
app: hello1 | |
ports: | |
- port: 81 | |
targetPort: 8080 | |
--- | |
apiVersion: v1 | |
kind: Service | |
metadata: | |
name: hello2-svc | |
spec: | |
selector: | |
app: hello2 | |
ports: | |
- port: 82 | |
targetPort: 8080 | |
--- | |
apiVersion: v1 | |
kind: Service | |
metadata: | |
name: nginx-svc | |
spec: | |
selector: | |
app: nginx | |
ports: | |
- port: 83 | |
targetPort: 80 | |
--- | |
apiVersion: apps/v1 | |
kind: Deployment | |
metadata: | |
name: hello1 | |
spec: | |
replicas: 1 | |
selector: | |
matchLabels: | |
app: hello1 | |
template: | |
metadata: | |
labels: | |
app: hello1 | |
spec: | |
containers: | |
- name: hello-app1 | |
image: gcr.io/google-samples/hello-app:1.0 | |
readinessProbe: | |
httpGet: | |
port: 8080 | |
path: / | |
livenessProbe: | |
initialDelaySeconds: 10 | |
httpGet: | |
port: 8080 | |
path: / | |
resources: | |
requests: | |
memory: "128Mi" | |
cpu: "80m" | |
limits: | |
memory: "128Mi" | |
cpu: "100m" | |
ports: | |
- containerPort: 8080 | |
--- | |
apiVersion: apps/v1 | |
kind: Deployment | |
metadata: | |
name: hello2 | |
spec: | |
replicas: 1 | |
selector: | |
matchLabels: | |
app: hello2 | |
template: | |
metadata: | |
labels: | |
app: hello2 | |
spec: | |
containers: | |
- name: hello-app2 | |
image: gcr.io/google-samples/hello-app:2.0 | |
readinessProbe: | |
httpGet: | |
port: 8080 | |
path: / | |
livenessProbe: | |
initialDelaySeconds: 10 | |
httpGet: | |
port: 8080 | |
path: / | |
resources: | |
requests: | |
memory: "128Mi" | |
cpu: "80m" | |
limits: | |
memory: "128Mi" | |
cpu: "100m" | |
ports: | |
- containerPort: 8080 | |
--- | |
apiVersion: apps/v1 | |
kind: Deployment | |
metadata: | |
name: nginx | |
spec: | |
replicas: 1 | |
selector: | |
matchLabels: | |
app: nginx | |
template: | |
metadata: | |
labels: | |
app: nginx | |
spec: | |
containers: | |
- name: nginx | |
image: nginx | |
readinessProbe: | |
httpGet: | |
port: 80 | |
path: / | |
livenessProbe: | |
initialDelaySeconds: 10 | |
httpGet: | |
port: 80 | |
path: / | |
resources: | |
requests: | |
memory: "128Mi" | |
cpu: "80m" | |
limits: | |
memory: "128Mi" | |
cpu: "100m" | |
ports: | |
- containerPort: 80 | |
--- | |
apiVersion: networking.k8s.io/v1 | |
kind: Ingress | |
metadata: | |
annotations: | |
nginx.ingress.kubernetes.io/rewrite-target: / | |
name: default-ingress | |
labels: | |
name: default-ingress | |
spec: | |
ingressClassName: nginx | |
rules: | |
- host: test.io | |
http: | |
paths: | |
- pathType: Prefix | |
path: "/hello-v1" | |
backend: | |
service: | |
name: hello1-svc | |
port: | |
number: 81 | |
- pathType: Prefix | |
path: "/hello-v2" | |
backend: | |
service: | |
name: hello2-svc | |
port: | |
number: 82 | |
- pathType: Prefix | |
path: "/nginx" | |
backend: | |
service: | |
name: nginx-svc | |
port: | |
number: 83 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment