kubernetes1.5.2--部署dashboard服务_lykops的博客-程序员秘密

技术标签: kubernetes  kubernetes服务部署  kube-ui  kubernetes可视化  kubernetes dashboard  docker  

本文基于kubernetes 1.5.2版本编写

使用http方式访问api server的部署

cat dashboard-controller.yaml 
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  labels:
    k8s-app: kubernetes-dashboard
    kubernetes.io/cluster-service: "true"
  name: kubernetes-dashboard
  namespace: kube-system
  selfLink: /apis/extensions/v1beta1/namespaces/kube-system/deployments/kubernetes-dashboard
spec:
  replicas: 1
  selector:
    matchLabels:
      k8s-app: kubernetes-dashboard
  strategy:
    rollingUpdate:
      maxSurge: 1
      maxUnavailable: 1
    type: RollingUpdate
  template:
    metadata:
      labels:
        k8s-app: kubernetes-dashboard
    spec:
      containers:
      - args:
        - --apiserver-host=http://192.168.20.128:8080
        image: docker.io/googlecontainer/kubernetes-dashboard-amd64:v1.6.1
        imagePullPolicy: IfNotPresent
        livenessProbe:
          failureThreshold: 3
          httpGet:
            path: /
            port: 9090
            scheme: HTTP
          initialDelaySeconds: 30
          periodSeconds: 10
          successThreshold: 1
          timeoutSeconds: 30
        name: kubernetes-dashboard
        ports:
        - containerPort: 9090
          protocol: TCP
        resources:
          limits:
            cpu: 100m
            memory: 50Mi
          requests:
            cpu: 100m
            memory: 50Mi
      dnsPolicy: ClusterFirst
      restartPolicy: Always 

使用https访问api server部署

apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  name: kubernetes-dashboard
  namespace: kube-system
  labels:
    k8s-app: kubernetes-dashboard
    kubernetes.io/cluster-service: "true"
spec:
  selector:
    matchLabels:
      k8s-app: kubernetes-dashboard
  template:
    metadata:
      labels:
        k8s-app: kubernetes-dashboard
      annotations:
        scheduler.alpha.kubernetes.io/critical-pod: ''
        scheduler.alpha.kubernetes.io/tolerations: '[{"key":"CriticalAddonsOnly", "operator":"Exists"}]'
    spec:
      containers:
      - name: kubernetes-dashboard
        image: docker.io/googlecontainer/kubernetes-dashboard-amd64:v1.6.1
        imagePullPolicy: IfNotPresent
        resources:
          limits:
            cpu: 100m
            memory: 512Mi
          requests:
            cpu: 100m
            memory: 128Mi
        livenessProbe:
          httpGet:
            path: /
            port: 9090
          initialDelaySeconds: 30
          timeoutSeconds: 30
        ports:
        - containerPort: 9090
        args:
        - --apiserver-host=https://192.168.20.128:6443
        - --kubeconfig=/etc/kubernetes/kubelet-config
        volumeMounts:
        - name: config
          mountPath: /etc/kubernetes/kubelet-config
          readOnly: True
        - name: certs
          mountPath: /etc/ssl/kube
          readOnly: True
      volumes:
      - name: certs
        hostPath:
          path: /etc/ssl/kube
      - name: config
        hostPath:
          path: /etc/kubernetes/kubelet-config

service

cat dashboard-service.yaml 
apiVersion: v1
kind: Service
metadata:
  name: kubernetes-dashboard
  namespace: kube-system
  labels:
    k8s-app: kubernetes-dashboard
    kubernetes.io/cluster-service: "true"
spec:
  selector:
    k8s-app: kubernetes-dashboard
  ports:
  - port: 80
targetPort: 9090

kubectl create -f dashboard-controller.yaml kubectl create -f dashboard-service.yaml

访问地址

http:http://192.168.20.128:8080/ui

https:https://192.168.20.128:6443/ui

如果API Server配置文件中没有配置登陆账号和密码(--basic-auth-file=/etc/kubernetes/useraccount.csv),登陆失败; 如果配置了,账号和密码为/etc/kubernetes/useraccount.csv任意中的一个


版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/liyingke112/article/details/77776843

智能推荐

Visual Studio 远程调试编译开发树莓派程序(15.17.19版本) 笔记_一心只想搞钱的博客-程序员秘密

树莓派(Linux)下的纯命令行开发调试,对于我这样的新手来说效率有些低。据说有个叫交叉编译器的神器,让我们可以在Windows下使用VS进行编辑、编译、调试或运行,最后在Linux下运行。而且运行大神们给的代码时,那些Makefile看着都头大,别说要我编写。 再次据说VS名下的插件VisualGDB神器可以帮我们把Linux下那些繁琐的工作(写Makefile、输入命令编译、使用命令调试等...

OpenCV图像处理(13)——指定区域截取和指定区域复制_rexinx的博客-程序员秘密

前言:在令人讨厌的的自动屏保中突然看到一张漂亮的图片(懂就行!),就想赶紧按了键盘上的截屏键,当发现无法去掉上面的文字。于是乎,图像处理的我就和邱邱一起研究如何将其去掉。思路:该图片上的文字和特别,特别在其实白色的。白色——在cv中简直就是最大的特征——三通道全是255!!开始进行:将制定文字区域截取出来,直接上我的嘴子奥西最小值滤波。效果:带有文字的图像↑去掉文字...

java getrootelement_JAXB中的@XmlRootElement注解详解_筱杰哥哥的博客-程序员秘密

Java代码@Retention(value=RUNTIME)@Target(value=TYPE)[email protected]@[email protected](value=RUNTIME)@Target(value={PACKAGE,TYPE})[email protected]: 将类或枚举...

安装配置iptables防火墙,查看防火墙规则、匹配条件规则_查看forwaed链_吃饼干的小熊的博客-程序员秘密

安装配置iptables防火墙安装配置iptables防火墙1)安装iptables防火墙服务[[email protected] ~]# yum -y install iptables iptables-services2)启动iptables服务设置开机自动启动[[email protected] ~]# systemctl start iptables.service[roo[email protected] ~]# systemctl enable iptables.service3)拒绝ping命令入站[roo

Kickstart 无人值守安装_weixin_34240520的博客-程序员秘密

导言: 作为中小公司的运维,经常会遇到一些机械式的重复工作。例如:有时公司同时上线几十甚至上百台服务器,而且需要我们在短时间内完成系统安装。常规的安装方法如下所示:① 光盘安装系统:一个的服务器 DVD 内置光驱百千块,百台服务器都配光驱就浪费了,因为一台服务器也就开始装系统能用的上,以后用的机会屈指可数。用 USB 外置光驱,插来插去也是十分繁琐。② U盘安装系统:还是同样的问题,要一...

随便推点

Redis常见问题_青格软件函数管理_shanchahua123456的博客-程序员秘密

参考文章:https://www.cnblogs.com/php-no-2/p/9396965.htmlhttps://www.cnblogs.com/jasontec/p/9699242.htmlhttps://www.cnblogs.com/yuanermen/p/5717885.html(集群搭建)推荐视频https://www.bilibili.com/video/a...

关于如何用vscode使用Competitive Programming Helper (cph)插件以及网页插件competitive-companion实现高效刷题_vscode cph_GHOSTANDBREAD的博客-程序员秘密

首先官网下载vscode,之后的配置以及MInGW的安装以及环境变量的配置可以看这个视频:2202年了还在用Dev吗? 快来使用vscode配置高效-美观-简洁的c/c++编程环境_哔哩哔哩_bilibili然后vscode里下载Competitive Programming Helper (cph)插件然后去jmerle/competitive-companion: Browser extension which parses competitive programming p

微信小程序之云函数报错error code -404011等的解决2020-05-22_天高云飞的博客-程序员秘密

在2020.5.18左右,微信官方更新了基础库,云函数有些api改动了,然后原先没问题,现在就报错写不进云数据库了。大概把我遇到的总结下。Error: errCode: -404011 cloud function execution error | errMsg: cloud.callFunction:fail cloud function service error code -504002, error message wx is not defined; at cloud.callFunction

Windows server 2012 添加中文语言包(英文转为中文)(离线)_dingshen2767的博客-程序员秘密

Windows server 2012 添加中文语言包(英文转为中文)(离线)相关资料:公司环境:亚马孙aws虚拟机 英文版Windows2012中文SQL Server2012安装包,需要安装操作系统的中文语言包XenSource Windows guest agentEC2 ConfigService参考资料http://www.cnb...

一、django错误集合_keyerror: 'backend_Lcoderfit的博客-程序员秘密

1、django.core.exceptions.ImproperlyConfigured: WSGI application ‘LARS.wsgi.application’ could not be loaded; Error importing module.设置SESSION_ENGINE时出错,(sessions写成session)SESSION_ENGINE = "django.co...

IndexError: Inconsistent shape between the condition and the input (got (xx, 1) and (xx,)_alongwaywith的博客-程序员秘密

这个错误是制作热力图的时候遇到的。这个原因是热力图传入的数据是一个2维的数据,你传入的是一个1维的数据。你只需要将传入的数据reshape即可。可以先使用arry转换格式,reshape(-1,1)即可使用...

推荐文章

热门文章

相关标签