Skip to content

Commit

Permalink
Fix code highlight
Browse files Browse the repository at this point in the history
  • Loading branch information
rootsongjc committed Jul 8, 2019
1 parent 6c1cb97 commit b5c3205
Show file tree
Hide file tree
Showing 17 changed files with 25 additions and 25 deletions.
2 changes: 1 addition & 1 deletion appendix/tricks.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ spec:

我们可以在 Pod 中为容器使用 command 为容器指定启动参数:

```Bash
```bash
command: ["/bin/bash","-c","bootstrap.sh"]
```

Expand Down
2 changes: 1 addition & 1 deletion concepts/cronjob.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ spec:
restartPolicy: OnFailure
```
```Bash
```bash
$ kubectl create -f cronjob.yaml
cronjob "hello" created
```
Expand Down
2 changes: 1 addition & 1 deletion concepts/garbage-collection.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ kubectl 也支持级联删除。 通过设置 `--cascade` 为 true,可以使

下面是一个例子,使一个 ReplicaSet 的 Dependent 对象成为孤儿 Dependent:

```Bash
```bash
kubectl delete replicaset my-repset --cascade=false
```

Expand Down
2 changes: 1 addition & 1 deletion concepts/ingress.md
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ Ingress controller启动时附带一些适用于所有Ingress的负载平衡策

假如你想要向已有的ingress中增加一个新的Host,你可以编辑和更新该ingress:

```Bash
```bash
$ kubectl get ing
NAME RULE BACKEND ADDRESS
test - 178.91.123.132
Expand Down
2 changes: 1 addition & 1 deletion concepts/init-containers.md
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ $ kubectl logs myapp-pod -c init-mydb # Inspect the second init container
一旦我们启动了 `mydb``myservice` 这两个 Service,我们能够看到 Init 容器完成,并且 `myapp-pod` 被创建:
```Bash
```bash
$ kubectl create -f services.yaml
service "myservice" created
service "mydb" created
Expand Down
4 changes: 2 additions & 2 deletions develop/client-go-sample.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

代码如下:

```Go
```go
package main

import (
Expand Down Expand Up @@ -154,7 +154,7 @@ New image -> harbor-001.jimmysong.io/library/analytics-docker-test:Build_9

查看Deployment的event。

```Bash
```bash
$ kubectl describe deployment filebeat-test
Name: filebeat-test
Namespace: default
Expand Down
2 changes: 1 addition & 1 deletion guide/authenticate-across-clusters-kubeconfig.md
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ users:

#### 示例文件相关操作命令

```Bash
```bash
$ kubectl config set preferences.colors true
$ kubectl config set-cluster cow-cluster --server=http://cow.org:8080 --api-version=v1
$ kubectl config set-cluster horse-cluster --server=https://horse.org:4443 --certificate-authority=path/to/my/cafile
Expand Down
2 changes: 1 addition & 1 deletion guide/configure-pod-service-account.md
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ namespace: 7 bytes

然后,确认已创建。如:

```Bash
```bash
$ kubectl get secrets myregistrykey
NAME TYPE DATA AGE
myregistrykey kubernetes.io/.dockerconfigjson 1 1d
Expand Down
2 changes: 1 addition & 1 deletion guide/docker-cli-to-kubectl.md
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ WARNING: No swap limit support
使用 kubectl 命令:
```Bash
```bash
$ kubectl cluster-info
Kubernetes master is running at https://108.59.85.141
KubeDNS is running at https://108.59.85.141/api/v1/namespaces/kube-system/services/kube-dns/proxy
Expand Down
2 changes: 1 addition & 1 deletion guide/managing-tls-in-a-cluster.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

通过运行以下命令生成私钥和证书签名请求(或CSR):

```Bash
```bash
$ cat <<EOF | cfssl genkey - | cfssljson -bare server
{
"hosts": [
Expand Down
8 changes: 4 additions & 4 deletions guide/service-access-application-cluster.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,15 @@

3. 显示 ReplicaSet 的信息:

```
```bash
kubectl get replicasets
kubectl describe replicasets

```

4. 创建一个暴露该 Deployment 的 Service 对象:

```Bash
```bash
kubectl expose deployment hello-world --type=NodePort --name=example-service
```

Expand Down Expand Up @@ -101,13 +101,13 @@

要删除 Service,输入以下命令:

```
```bash
kubectl delete services example-service
```

删除 Deployment、ReplicaSet 和正运行在 Pod 中的 Hello World 应用程序,输入以下命令:

```
```bash
kubectl delete deployment hello-world
```

Expand Down
2 changes: 1 addition & 1 deletion practice/edge-node-configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ kubectl label nodes 172.20.0.115 edgenode=true
查看DaemonSet的启动情况:
```Bash
```bash
$ kubectl -n kube-system get ds
NAME DESIRED CURRENT READY UP-TO-DATE AVAILABLE NODE-SELECTOR AGE
traefik-ingress-lb 3 3 3 3 3 edgenode=true 2h
Expand Down
2 changes: 1 addition & 1 deletion practice/kubedns-addon-installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ kubedns-svc.yaml

预定义的 RoleBinding `system:kube-dns` 将 kube-system 命名空间的 `kube-dns` ServiceAccount 与 `system:kube-dns` Role 绑定, 该 Role 具有访问 kube-apiserver DNS 相关 API 的权限;

```Bash
```bash
$ kubectl get clusterrolebindings system:kube-dns -o yaml
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRoleBinding
Expand Down
2 changes: 1 addition & 1 deletion practice/monitor.md
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ Kubernetes中应用的监控架构如图:

使用[scope.yaml](https://github.com/rootsongjc/kubernetes-handbook/blob/master/manifests/weave/scope.yaml)文件安装scope,该服务安装在`kube-system` namespace下。

```Bash
```bash
$ kubectl apply -f scope.yaml
```

Expand Down
2 changes: 1 addition & 1 deletion practice/network-and-cluster-perfermance-test.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Ingress Host:traefik.sample-webapp.io

通过向`sample-webapp`发送curl请求获取响应时间,直接curl后的结果为:

```Bash
```bash
$ curl "http://10.254.149.31:8000/"
Welcome to the "Distributed Load Testing Using Kubernetes" sample web app
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ enabled=1

验证源已经被激活。

```Bash
```bash
# yum repolist
```

Expand Down Expand Up @@ -357,7 +357,7 @@ State: Peer in Cluster (Connected)

就像OpenShift中的其他组件一样,StorageClass也简单的用YAML文件定义:

```Bash
```bash
# cat crs-storageclass.yaml
kind: StorageClass
apiVersion: storage.k8s.io/v1beta1
Expand Down Expand Up @@ -533,7 +533,7 @@ sh-4.2$ mysql -u $MYSQL_USER -p$MYSQL_PASSWORD -h $HOSTNAME $MYSQL_DATABASE
这点很方便,所有重要的配置,如MySQL凭据,数据库名称等都是pod模板中的环境变量的一部分,因此可以在pod中作为shell的环境变量。 我们来创建一些数据:
```Bash
```bash
mysql> show databases;
+--------------------+
| Database |
Expand Down
6 changes: 3 additions & 3 deletions practice/using-glusterfs-for-persistent-storage.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ $ systemctl status glusterd.service

## 配置 glusterfs

```Bash
```bash
# 配置 hosts

$ vi /etc/hosts
Expand Down Expand Up @@ -268,7 +268,7 @@ PVC属性

## 配置PVC

```Bash
```bash
$ cat glusterfs-pvc.yaml
kind: PersistentVolumeClaim
apiVersion: v1
Expand All @@ -293,7 +293,7 @@ glusterfs-nginx Bound gluster-dev-volume 8Gi RWX

## 创建 nginx deployment 挂载 volume

```Bash
```bash
$ vi nginx-deployment.yaml
apiVersion: extensions/v1beta1
kind: Deployment
Expand Down

0 comments on commit b5c3205

Please sign in to comment.