Skip to content

Instantly share code, notes, and snippets.

@visualdensity
Last active May 24, 2019 04:47
Show Gist options
  • Save visualdensity/da9be9196f4bce467a7f665f1a05a243 to your computer and use it in GitHub Desktop.
Save visualdensity/da9be9196f4bce467a7f665f1a05a243 to your computer and use it in GitHub Desktop.
for testing
apiVersion: v1
kind: Service
metadata:
creationTimestamp: 2018-09-05T05:46:14Z
labels:
app: web
name: public-web-svc
namespace: default
resourceVersion: "14972"
selfLink: /api/v1/namespaces/default/services/public-web-svc
uid: 000fa04f-b0cf-11e8-8484-021d76b33cfe
spec:
clusterIP: 10.101.120.176
externalIPs:
- 10.16.1.20
externalTrafficPolicy: Cluster
ports:
- nodePort: 30928
port: 80
protocol: TCP
targetPort: 80
selector:
app: web
sessionAffinity: None
type: LoadBalancer
status:
loadBalancer: {}
apiVersion: apps/v1 # for versions before 1.9.0 use apps/v1beta2
kind: Deployment
metadata:
name: web-dc
spec:
selector:
matchLabels:
app: web
replicas: 2 # tells deployment to run 2 pods matching the template
template:
metadata:
labels:
app: web
spec:
containers:
- name: nginx
image: nginx:1.7.9
ports:
- containerPort: 80
apiVersion: autoscaling/v2beta2
kind: HorizontalPodAutoscaler
metadata:
name: web-hpa
namespace: default
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: web-dc
minReplicas: 1
maxReplicas: 10
metrics:
- type: Resource
resource:
name: cpu
target:
type: Utilization
averageUtilization: 5
kind: Service
apiVersion: v1
metadata:
name: web-svc
spec:
selector:
app: web
ports:
- protocol: TCP
port: 8080
targetPort: 80
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment