shaikhsalman commited on
Commit
045d722
·
verified ·
1 Parent(s): b5a9bba

Upload platform/golden-paths/microservice/template.yaml with huggingface_hub

Browse files
platform/golden-paths/microservice/template.yaml ADDED
@@ -0,0 +1,123 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Golden Path - Microservice Template
2
+ # Replace: SERVICE_NAME, SERVICE_NAMESPACE, REGISTRY, IMAGE, TAG
3
+ apiVersion: apps/v1
4
+ kind: Deployment
5
+ metadata:
6
+ name: SERVICE_NAME
7
+ namespace: SERVICE_NAMESPACE
8
+ labels:
9
+ app: SERVICE_NAME
10
+ version: v1
11
+ golden-path: "true"
12
+ spec:
13
+ replicas: 3
14
+ selector:
15
+ matchLabels:
16
+ app: SERVICE_NAME
17
+ strategy:
18
+ rollingUpdate:
19
+ maxSurge: 1
20
+ maxUnavailable: 0
21
+ template:
22
+ metadata:
23
+ labels:
24
+ app: SERVICE_NAME
25
+ version: v1
26
+ annotations:
27
+ sidecar.istio.io/inject: "true"
28
+ prometheus.io/scrape: "true"
29
+ prometheus.io/port: "8080"
30
+ spec:
31
+ serviceAccountName: SERVICE_NAME
32
+ securityContext:
33
+ runAsNonRoot: true
34
+ runAsUser: 1000
35
+ fsGroup: 1000
36
+ seccompProfile:
37
+ type: RuntimeDefault
38
+ containers:
39
+ - name: SERVICE_NAME
40
+ image: REGISTRY/IMAGE:TAG
41
+ ports:
42
+ - containerPort: 8080
43
+ envFrom:
44
+ - configMapRef:
45
+ name: SERVICE_NAME-config
46
+ - secretRef:
47
+ name: SERVICE_NAME-secrets
48
+ resources:
49
+ requests:
50
+ cpu: 100m
51
+ memory: 128Mi
52
+ limits:
53
+ cpu: 500m
54
+ memory: 256Mi
55
+ securityContext:
56
+ allowPrivilegeEscalation: false
57
+ readOnlyRootFilesystem: true
58
+ capabilities:
59
+ drop: ["ALL"]
60
+ livenessProbe:
61
+ httpGet:
62
+ path: /healthz
63
+ port: 8080
64
+ initialDelaySeconds: 10
65
+ periodSeconds: 15
66
+ readinessProbe:
67
+ httpGet:
68
+ path: /readyz
69
+ port: 8080
70
+ initialDelaySeconds: 5
71
+ periodSeconds: 10
72
+ volumeMounts:
73
+ - name: tmp
74
+ mountPath: /tmp
75
+ volumes:
76
+ - name: tmp
77
+ emptyDir: {}
78
+ ---
79
+ apiVersion: v1
80
+ kind: Service
81
+ metadata:
82
+ name: SERVICE_NAME
83
+ spec:
84
+ selector:
85
+ app: SERVICE_NAME
86
+ ports:
87
+ - port: 8080
88
+ targetPort: 8080
89
+ ---
90
+ apiVersion: v1
91
+ kind: ServiceAccount
92
+ metadata:
93
+ name: SERVICE_NAME
94
+ automountServiceAccountToken: false
95
+ ---
96
+ apiVersion: policy/v1
97
+ kind: PodDisruptionBudget
98
+ metadata:
99
+ name: SERVICE_NAME-pdb
100
+ spec:
101
+ minAvailable: 2
102
+ selector:
103
+ matchLabels:
104
+ app: SERVICE_NAME
105
+ ---
106
+ apiVersion: autoscaling/v2
107
+ kind: HorizontalPodAutoscaler
108
+ metadata:
109
+ name: SERVICE_NAME-hpa
110
+ spec:
111
+ scaleTargetRef:
112
+ apiVersion: apps/v1
113
+ kind: Deployment
114
+ name: SERVICE_NAME
115
+ minReplicas: 3
116
+ maxReplicas: 20
117
+ metrics:
118
+ - type: Resource
119
+ resource:
120
+ name: cpu
121
+ target:
122
+ type: Utilization
123
+ averageUtilization: 70