forked from cncamp/101
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
194 additions
and
3 deletions.
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: nginx-deployment | ||
spec: | ||
replicas: 3 | ||
selector: | ||
matchLabels: | ||
app: nginx | ||
template: | ||
metadata: | ||
labels: | ||
app: nginx | ||
spec: | ||
containers: | ||
- name: nginx | ||
image: nginx |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
apiVersion: policy/v1 | ||
kind: PodDisruptionBudget | ||
metadata: | ||
name: nginx-deployment | ||
spec: | ||
minAvailable: 0 | ||
selector: | ||
matchLabels: | ||
app: nginx |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
-----BEGIN CERTIFICATE----- | ||
MIIDITCCAgmgAwIBAgIIM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L416TGcEetdNScKCPFEYMuJYsODon/5S0sUzjhOihO76aQ== | ||
-----END CERTIFICATE----- |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
-----BEGIN RSA PRIVATE KEY----- | ||
MIIEpAIBAAKCAQEAx9KleJn34dmuLP+++FNJLgvF5g3wfwuT/2cyFBLqwybZcXZD | ||
/E+G/fF0aV8JN/eYOj9Ijp2YxzLsszqx6Fp7dga2huDaGsmFWjVwXxBQdeINNKAd | ||
XAv0VeY0HKS260uJaRFy3Aje2/Sow1VWPn6tULMofIh4MVA970qALdVsTAaKYfIq | ||
Nc3ebu1PdRflN6IaiA+nqC/WkZS8G6j7+yeLbEwrEd5mT9xaZsEllTl5z9CVxs1S | ||
EZIJaIRPfxxOTI5e30/QrXk9e78IWoLRcvu88ruXq+h8/Ow1tL4CXjQvHcBRcQri | ||
XHDtiFMnzLY3REMV3ufpmB1rm76rGNNLraCsPQIDAQABAoIBAQCwRbVs9z4BgTqy | ||
PYVkoGv876vLLt7J5BfRhWJa7Pkl4F6PRcnhiPJHkDmmPozuTz99mpfSH1pH1zeR | ||
QCTzGOayjmd0AmTEnqNBmcSgR88Cvr/xfZGIwo7vO90aq38lgAQeqKLPUg/urxw0 | ||
/FHRXYRcnT8I5IZK0kNglTMPu6cGRGsQygPkohmh2vpZ4MxOoAvrPFCGtrDjyJCU | ||
1TgHbEoFlFZaurp2a5l8ccgjzoghNdsu50wzp8jsl6yK1kL28/pd/DAo6bbPTMFg | ||
Q/i9lHxUrg5gJVJwotmGWJqMTORVH9+U/OGuGuCxHat1MdsEp3clhmuntkadUy4i | ||
okX6+fbtAoGBAO/mpSjT+wpC907lVD/zsZAWs69kX8iN6w//Q0T5ApjWKuTnVRw7 | ||
RzKIZ+q1B1StZOLje1sPeuzo4WOFmAK3XIjmoT6FCbCK5Og3WgnuFdiGI3v+jwtr | ||
WNVlYNNi9duYvRKbCTW6cESefyuMxImluGOe+1+gOcDdoDD2fnDLi53zAoGBANU7 | ||
e6yalkYVgge2qyl1iE028pLsiNS8MRTA2Q2tF82Zb6fYOzwlBPTALvB34qKJ3WoP | ||
gXkhsqmUY1xUi6RtN+M4aaSYkp9BWPFFQ0N9RrwMXtk3IU+R82cSIK3It5zaT0bW | ||
jbaplv5iT1A7r/Jt43CrhyqVKnK+HHFL56EoX6kPAoGBALq5aR/oLuODz/5GnVbR | ||
lQkzwlPn6m2tmKJw6qkKsCzJtcVJEYPR187LQSb8FGKiO34l1WPBHsq7UIMn/nNO | ||
yOV9rU9+OVaCJT1hp+FGwRYxAfmG30viF9iw+bZOtlJgBfovVfHN1YhzXURGYstI | ||
g8Z2fe2mRo2Jcx/pG+0rYNZlAoGABIxuSPJLPld7HJsC77F4JN2FMykkihUxntW2 | ||
S5pjpZkeTqBIMzI+9tGarrp/9SOnu3l1M5ZKb1+g9vk+uVUzGf+8ESzIA+mq8gqe | ||
MrRba+t/onaQmVftr0ctt0dO02O8yTAOedUISYjjVDzRtgQuE9s02O2xqBzyEmCi | ||
IkfwMnUCgYBAHvQf7F+s5n0D5ogblx52V6nNb4jGW8T6Y8N4F4bVjDfIo0RRU0Dm | ||
qMzrR7tb4X9HYIBlDXSkTfTjbwmvfazo0dwoYGu0WYKBsMr+EXdkK9OUBPVtA5UP | ||
zWf+WLddkKMPn6ADtwOl50ijxKkxkN+/mboQqtfaUtTV38JzeoNadQ== | ||
-----END RSA PRIVATE KEY----- |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: nginx-deployment | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: nginx | ||
template: | ||
metadata: | ||
labels: | ||
app: nginx | ||
spec: | ||
containers: | ||
- name: nginx | ||
image: nginx | ||
resources: | ||
limits: | ||
cncamp.com/reclaimed-cpu: 3 | ||
requests: | ||
cncamp.com/reclaimed-cpu: 3 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
``` | ||
curl --key admin.key --cert admin.crt --header "Content-Type: application/json-patch+json" \ | ||
--request PATCH -k \ | ||
--data '[{"op": "add", "path": "/status/capacity/cncamp.com~1reclaimed-cpu", "value": "2"}]' \ | ||
https://192.168.34.2:6443/api/v1/nodes/cadmin/status | ||
``` |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
|
||
echo "task docker:7 blocked for more than 300 seconds." |systemd-cat -t kernel | ||
|
||
echo "Error trying v2 registry: failed to register layer: rename /var/lib/docker/image/test /var/lib/docker/image/ddd: directory not empty.*" |systemd-cat -t docker |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
apiVersion: apps/v1 | ||
kind: DaemonSet | ||
metadata: | ||
name: node-problem-detector-v0.1 | ||
namespace: kube-system | ||
labels: | ||
k8s-app: node-problem-detector | ||
version: v0.1 | ||
kubernetes.io/cluster-service: "true" | ||
spec: | ||
selector: | ||
matchLabels: | ||
k8s-app: node-problem-detector | ||
version: v0.1 | ||
kubernetes.io/cluster-service: "true" | ||
template: | ||
metadata: | ||
labels: | ||
k8s-app: node-problem-detector | ||
version: v0.1 | ||
kubernetes.io/cluster-service: "true" | ||
spec: | ||
hostNetwork: true | ||
containers: | ||
- name: node-problem-detector | ||
image: cncamp/node-problem-detector:v0.8.10 | ||
securityContext: | ||
privileged: true | ||
resources: | ||
limits: | ||
cpu: "200m" | ||
memory: "100Mi" | ||
requests: | ||
cpu: "20m" | ||
memory: "20Mi" | ||
volumeMounts: | ||
- name: log | ||
mountPath: /log | ||
readOnly: true | ||
volumes: | ||
- name: log | ||
hostPath: | ||
path: /var/log/ |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: ssh | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: ssh | ||
template: | ||
metadata: | ||
labels: | ||
app: ssh | ||
spec: | ||
containers: | ||
- name: alpine | ||
image: alpine | ||
stdin: true | ||
tty: true | ||
hostNetwork: true | ||
nodeName: cadmin |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
针对使用systemd拉起的服务 | ||
``` | ||
journalctl -afu kubelet -S "2019-08-26 15:00:00" | ||
-u unit,对应的systemd拉起的组件,如kubelet | ||
-f follow,跟踪最新日志 | ||
-a show all,现实所有日之列 | ||
-S since,从某一时间开始 -S "2019-08-26 15:00:00" | ||
``` | ||
对于标准的容器日志 | ||
``` | ||
kubectl logs -f -c <containername> <podname> | ||
kubectl logs -f --all-containers <podname> | ||
kubectl logs -f -c <podname> --previous | ||
``` | ||
如果容器日志被shell转储到文件,则需通过exec | ||
``` | ||
kubectl exec -it xxx -- tail -f /path/to/log | ||
``` |