Last active
February 4, 2024 15:35
-
-
Save Thakurvaibhav/6514f4b374cd419a39382d8de1c2d6c7 to your computer and use it in GitHub Desktop.
Demo Nginx Deployment and Service Manifest
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: Namespace | |
metadata: | |
name: nginx | |
--- | |
apiVersion: extensions/v1beta1 | |
kind: Deployment | |
metadata: | |
namespace: nginx | |
name: nginx-deployment | |
spec: | |
replicas: 1 | |
template: | |
metadata: | |
annotations: | |
prometheus.io/path: "/status/format/prometheus" | |
prometheus.io/scrape: "true" | |
prometheus.io/port: "80" | |
labels: | |
app: nginx-server | |
spec: | |
affinity: | |
podAntiAffinity: | |
preferredDuringSchedulingIgnoredDuringExecution: | |
- weight: 100 | |
podAffinityTerm: | |
labelSelector: | |
matchExpressions: | |
- key: app | |
operator: In | |
values: | |
- nginx-server | |
topologyKey: kubernetes.io/hostname | |
containers: | |
- name: nginx-demo | |
image: vaibhavthakur/nginx-demo:1.0-SNAPSHOT | |
imagePullPolicy: Always | |
resources: | |
limits: | |
cpu: 2500m | |
requests: | |
cpu: 2000m | |
ports: | |
- containerPort: 80 | |
name: http | |
--- | |
apiVersion: v1 | |
kind: Service | |
metadata: | |
namespace: nginx | |
name: nginx-service | |
annotations: | |
cloud.google.com/load-balancer-type: Internal | |
spec: | |
ports: | |
- port: 80 | |
targetPort: 80 | |
name: http | |
selector: | |
app: nginx-server | |
type: LoadBalancer |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment