yum简易安装的k8s

在阿里云的ECS下(centos系统)安装k8s

 

相信部署过或者了解过k8s部署的同学都知道,k8s很好但是安装起来比较复杂,所以给大家整理了如下快捷的安装方法


1.yum install -y etcd kubernetes

2.vim /etc/sysconfig/docker

   # 内容改为如下  OPTIONS='--selinux-enabled=false --insecure-registry gcr.io'

3.vim /etc/kubernetes/apiserver 去掉–admission-control中的ServiceAccount

4.systemctl start etcd.service

5.systemctl start docker

6.systemctl start kube-apiserver.service

7.systemctl start kube-controller-manager.service

8.systemctl start kube-scheduler.service

9.systemctl start kubelet.service

10.systemctl start kube-proxy.service

11.yum install python-rhsm-certificates 

避免k8s下载镜像出错

12.运行wget http://mirror.centos.org/centos/7/os/x86_64/Packages/python-rhsm-certificates-1.19.10-1.el7_4.x86_64.rpm 手动下载

13.chmod +x python-rhsm-certificates-1.19.10-1.el7_4.x86_64.rpm 

14.运行 rpm2cpio python-rhsm-certificates-1.19.10-1.el7_4.x86_64.rpm | cpio -iv --to-stdout /etc/rhsm/ca/redhat-uep.pem | tee           /etc/rhsm/ca/redhat-uep.pem

15.运行 ll /etc/docker/certs.d/registry.access.redhat.com/redhat-ca.crt 指向正确

16.docker pull XXXX

17.编写yaml文件:

XXXX.yaml:

apiVersion: v1

kind: ReplicationController

metadata:

  name: myname

  labels:

    name: myname

spec:

  replicas: 2

  selector:

    name: myname

  template:

    metadata:

    labels:

      name: myname

    spec:

    containers:

    - name: myname

      image: helloWord

      imagePullPolicy: IfNotPresent

      ports:

      - containerPort: 8080

18.kubectl create -f xxxxx.yaml       

19.kubectl get rc

20.kubectl get pods

21.kubectl describe pod helloworld-7jpm5

22.kubectl logs helloworld-7jpm5

通过yum的安装方式可以很简单的安装,但是部分功能不支持

附上原文链接:https://blog.csdn.net/baidu_35491832/article/details/88530875

你可能感兴趣的:(yum简易安装的k8s)