Skip to content

Instantly share code, notes, and snippets.

@vishnups1
Created May 9, 2024 14:30
Show Gist options
  • Save vishnups1/2855ee2a9c2e939066a3e9322d3e117c to your computer and use it in GitHub Desktop.
Save vishnups1/2855ee2a9c2e939066a3e9322d3e117c to your computer and use it in GitHub Desktop.
eks.yaml
apiVersion: v1
kind: Namespace
metadata:
name: bluegreen
labels:
type: dev
---
apiVersion: apps/v1
kind: Deployment #object type
metadata:
name: green
namespace: bluegreen
labels:
app: httpd
env: green
spec: # deployment spec
replicas: 17
selector:
matchLabels:
app: httpd
env: green
template:
metadata:
labels:
app: httpd
env: green
spec: # pod spec
topologySpreadConstraints:
- maxSkew: 1
topologyKey: "topology.kubernetes.io/zone"
whenUnsatisfiable: ScheduleAnyway
labelSelector:
matchLabels:
app: httpd
env: green
containers:
- name: httpd
image: httpd:latest
ports:
- containerPort: 80
---
apiVersion: v1
kind: Service
metadata:
name: webservice
namespace: bluegreen
labels:
app: webservice
env: dev
spec:
selector:
app: httpd
env: green
ports:
- protocol: TCP
port: 80
targetPort: 80
type: LoadBalancer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment