-
-
Save juzn01/8675141973d446efd884b3901a18b924 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