Last active
March 27, 2021 05:30
-
-
Save mightyhorst/96712d11fcb8e63faffeb3777de62160 to your computer and use it in GitHub Desktop.
Hello Kubernetes
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: hello-kubernetes-first | |
spec: | |
type: ClusterIP | |
ports: | |
- port: 80 | |
targetPort: 8080 | |
selector: | |
app: hello-kubernetes-first | |
--- | |
apiVersion: apps/v1 | |
kind: Deployment | |
metadata: | |
name: hello-kubernetes-first | |
spec: | |
replicas: 1 | |
selector: | |
matchLabels: | |
app: hello-kubernetes-first | |
template: | |
metadata: | |
labels: | |
app: hello-kubernetes-first | |
spec: | |
containers: | |
- name: hello-kubernetes | |
image: paulbouwer/hello-kubernetes:1.8 | |
ports: | |
- containerPort: 8080 | |
env: | |
- name: MESSAGE | |
value: Hello from the first deployment! |
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: networking.k8s.io/v1 | |
kind: Ingress | |
metadata: | |
name: hello-kubernetes-ingress | |
annotations: | |
kubernetes.io/ingress.class: nginx | |
spec: | |
rules: | |
- host: "hw1.how-to-code-airbnb.online" | |
http: | |
paths: | |
- pathType: Prefix | |
path: "/" | |
backend: | |
service: | |
name: hello-kubernetes-first | |
port: | |
number: 80 | |
- host: "hw2.how-to-code-airbnb.online" | |
http: | |
paths: | |
- pathType: Prefix | |
path: "/" | |
backend: | |
service: | |
name: hello-kubernetes-second | |
port: | |
number: 80 | |
- host: "ssh.how-to-code-airbnb.online" | |
http: | |
paths: | |
- pathType: Prefix | |
path: "/" | |
backend: | |
service: | |
name: dev-service | |
port: | |
number: 22 |
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: hello-kubernetes-second | |
spec: | |
type: ClusterIP | |
ports: | |
- port: 80 | |
targetPort: 8080 | |
selector: | |
app: hello-kubernetes-second | |
--- | |
apiVersion: apps/v1 | |
kind: Deployment | |
metadata: | |
name: hello-kubernetes-second | |
spec: | |
replicas: 1 | |
selector: | |
matchLabels: | |
app: hello-kubernetes-second | |
template: | |
metadata: | |
labels: | |
app: hello-kubernetes-second | |
spec: | |
containers: | |
- name: hello-kubernetes | |
image: paulbouwer/hello-kubernetes:1.8 | |
ports: | |
- containerPort: 8080 | |
env: | |
- name: MESSAGE | |
value: Hello from the second deployment! |
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: apps/v1 | |
kind: Deployment | |
metadata: | |
labels: | |
app: hostport | |
name: hostport | |
spec: | |
replicas: 1 | |
selector: | |
matchLabels: | |
app: hostport | |
template: | |
metadata: | |
labels: | |
app: hostport | |
spec: | |
containers: | |
- image: nginx:latest | |
name: nginx | |
securityContext: | |
privileged: true | |
ports: | |
- name: http | |
containerPort: 80 | |
hostPort: 80 | |
hostNetwork: true |
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: ConfigMap | |
metadata: | |
name: tcp-services | |
namespace: ingress-nginx | |
# namespace: default | |
data: | |
22: "default/dev-service:22" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment