圣凤凌霜 发表于 2018-1-5 17:43:20

[k8s]kube-dns/dashboard排错历险记(含sa加载用法/集群搭建)

# cat kubernetes-dashboard.yaml  kind: Deployment
  apiVersion: extensions/v1beta1
  metadata:
  labels:
  app: kubernetes-dashboard
  name: kubernetes-dashboard
  namespace: kube-system
  spec:
  replicas: 1
  revisionHistoryLimit: 10
  selector:
  matchLabels:
  app: kubernetes-dashboard
  template:
  metadata:
  labels:
  app: kubernetes-dashboard
  # Comment the following annotation if Dashboard must not be deployed on master
  annotations:
  scheduler.alpha.kubernetes.io/tolerations: |
[
  {
  "key": "dedicated",
  "operator": "Equal",
  "value": "master",
  "effect": "NoSchedule"
  }
  ]
  spec:
  containers:
  - name: kubernetes-dashboard
  image: k8scn/kubernetes-dashboard-amd64:v1.7.1
  imagePullPolicy: IfNotPresent
  ports:
  - containerPort: 9090
  protocol: TCP
  args:
  # Uncomment the following line to manually specify Kubernetes API server Host
  # If not specified, Dashboard will attempt to auto discover the API server and connect
  # to it. Uncomment only if the default does not work.
  - --apiserver-host=http://192.168.x.x:8080
  livenessProbe:
  httpGet:
  path: /
  port: 9090
  initialDelaySeconds: 30
  timeoutSeconds: 30
  ---
  kind: Service
  apiVersion: v1
  metadata:
  labels:
  app: kubernetes-dashboard
  name: kubernetes-dashboard
  namespace: kube-system
  spec:
  type: NodePort
  ports:
  - port: 80
  targetPort: 9090
  nodePort: 30090
  selector:
  app: kubernetes-dashboard
页: [1]
查看完整版本: [k8s]kube-dns/dashboard排错历险记(含sa加载用法/集群搭建)