Skip to content

Instantly share code, notes, and snippets.

@tennix
Last active February 18, 2019 10:05
Show Gist options
  • Save tennix/fb7b7d02a29c8914a478e071929f5eab to your computer and use it in GitHub Desktop.
Save tennix/fb7b7d02a29c8914a478e071929f5eab to your computer and use it in GitHub Desktop.
apiVersion: apps/v1
kind: Deployment
metadata:
name: web
spec:
selector:
matchLabels:
app: nginx
replicas: 3
template:
metadata:
labels:
app: nginx
spec:
containers:
- name: nginx
image: nginx:1.11-alpine
---
apiVersion: v1
kind: Service
metadata:
name: nginx-svc
spec:
type: NodePort
selector:
app: nginx
ports:
- port: 80
targetPort: 80
apiVersion: v1
kind: Pod
metadata:
name: web
labels:
app: nginx
spec:
containers:
- name: nginx
image: nginx:1.11-alpine
resources:
requests:
cpu: 500m
memory: 200Mi
limits:
cpu: 600m
memory: 400Mi
---
apiVersion: v1
kind: Service
metadata:
name: nginx-svc
labels:
app: nginx
spec:
type: NodePort
selector:
app: nginx
ports:
- port: 80
targetPort: 80
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: web
spec:
selector:
matchLabels:
app: nginx
serviceName: nginx
replicas: 3
template:
metadata:
labels:
app: nginx
spec:
containers:
- name: nginx
image: nginx:1.11-alpine
volumeMounts:
- name: www
mountPath: /usr/share/nginx/html
volumeClaimTemplates:
- metadata:
name: www
spec:
accessModes: [ "ReadWriteOnce" ]
storageClassName: "rbd"
resources:
requests:
storage: 1Gi
---
apiVersion: v1
kind: Service
metadata:
name: nginx-svc
labels:
app: nginx
spec:
ports:
- port: 80
targetPort: 80
clusterIP: None
selector:
app: nginx
apiVersion: v1
kind: Pod
metadata:
name: tidb
labels:
app: tidb
spec:
containers:
- name: tidb
image: pingcap/tidb
args:
- -log-slow-query=/var/log/slow.log
volumeMounts:
- mountPath: /var/log
name: varlog
- name: slow-log
image: busybox
command:
- /bin/sh
- -ec
- |
touch /var/log/slow.log
tail -f /var/log/slow.log
volumeMounts:
- mountPath: /var/log
name: varlog
volumes:
- name: varlog
emptyDir: {}
---
apiVersion: v1
kind: Service
metadata:
name: tidb
labels:
app: tidb
spec:
selector:
app: tidb
ports:
- name: mysql
port: 4000
targetPort: 4000
- name: status
port: 10080
targetPort: 10080
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment