Last active
December 9, 2021 10:45
-
-
Save bhubr/cc4da0b8b29a98012ee8841827a2c789 to your computer and use it in GitHub Desktop.
Kubernetes
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: nginx-deployment | |
labels: | |
app: nginx | |
spec: | |
replicas: 3 | |
selector: | |
matchLabels: | |
app: nginx | |
template: | |
metadata: | |
labels: | |
app: nginx | |
spec: | |
containers: | |
- name: nginx | |
image: nginx:1.14.2 | |
ports: | |
- containerPort: 80 |
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
kind: Pod | |
apiVersion: v1 | |
metadata: | |
name: testk8s-app | |
labels: | |
app: testk8s-app | |
spec: | |
containers: | |
- name: testk8s-app | |
image: hashicorp/http-echo:0.2.3 | |
args: | |
- "-text=Hello World! This is a testk8s Kubernetes with kind App" | |
--- | |
kind: Service | |
apiVersion: v1 | |
metadata: | |
name: testk8s-service | |
spec: | |
selector: | |
app: testk8s-app | |
ports: | |
# Default port used by the image | |
- port: 5678 | |
--- | |
apiVersion: networking.k8s.io/v1 | |
kind: Ingress | |
metadata: | |
name: testk8s-ingress | |
spec: | |
rules: | |
- http: | |
paths: | |
- pathType: Prefix | |
path: "/testk8s" | |
backend: | |
service: | |
name: testk8s-service | |
port: | |
number: 5678 | |
--- |
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: v1 | |
kind: Pod | |
metadata: | |
name: nginx | |
spec: | |
containers: | |
- name: nginx | |
image: nginx:1.14.2 | |
ports: | |
- containerPort: 80 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment