k8s big-ip control 安装使用

0. 准备工作

网络打通,这里没有使用fannel,没有使用vxlan 。

在f5界面 创建f5分区。这里是cce-test。

1. 安装bigip control

kubectl create serviceaccount bigip-ctlr -n kube-system

kubectl get sa -n kube-system

创建ClusterRole ,ClusterRole

f5-k8s-sample-rbac.yaml

# for use in k8s clusters only
# for OpenShift, use the OpenShift-specific examples
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: bigip-ctlr-clusterrole
rules:
- apiGroups: ["", "extensions"]
resources: ["nodes", "services", "endpoints", "namespaces", "ingresses", "pods"]
verbs: ["get", "list", "watch"]
- apiGroups: ["", "extensions"]
resources: ["configmaps", "events", "ingresses/status"]
verbs: ["get", "list", "watch", "update", "create", "patch"]
- apiGroups: ["", "extensions"]
resources: ["secrets"]
resourceNames: ["<secret-containing-bigip-login>"]
verbs: ["get", "list", "watch"] --- kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: bigip-ctlr-clusterrole-binding
namespace: kube-system
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: bigip-ctlr-clusterrole
subjects:
- apiGroup: ""
kind: ServiceAccount
name: bigip-ctlr
namespace: kube-system

kubectl get clusterroles.rbac.authorization.k8s.io -n kube-system

NAME                                                                   AGE
admin 2d12h
aggregate-network-attachment-definitions-admin 2d12h
aggregate-network-attachment-definitions-edit 2d12h
aggregate-network-attachment-definitions-view 2d12h
bigip-ctlr-clusterrole 46h
cluster-admin 2d12h
copaddon-nginx-ingress 2d12h
coredns 2d12h
edit 2d12h

kubectl get clusterrolebindings.rbac.authorization.k8s.io -n kube-system

NAME                                                   AGE
auto-approve-csrs-for-group 2d12h
auto-approve-renewals-for-nodes 2d12h
auto-approve-renewals-for-nodes-server 2d12h
bigip-ctlr-clusterrole-binding 46h
f5-k8s-bigip-ctlr_basic.yaml

kubectl create secret generic bigip-login --namespace kube-system --from-literal=username=admin --from-literal=password=admin

kubectl describe secret bigip-login -n kube-system

kubectl apply -f f5-k8s-bigip-ctlr_basic.yaml

apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: k8s-bigip-ctlr-deployment
namespace: kube-system
spec:
# DO NOT INCREASE REPLICA COUNT
replicas: 1
template:
metadata:
name: k8s-bigip-ctlr
labels:
app: k8s-bigip-ctlr
spec:
# Name of the Service Account bound to a Cluster Role with the required
# permissions
serviceAccountName: bigip-ctlr
containers:
- name: k8s-bigip-ctlr
image: "f5networks/k8s-bigip-ctlr"
imagePullPolicy: IfNotPresent
env:
- name: BIGIP_USERNAME
valueFrom:
secretKeyRef:
# Replace with the name of the Secret containing your login
# credentials
name: bigip-login
key: username
- name: BIGIP_PASSWORD
valueFrom:
secretKeyRef:
# Replace with the name of the Secret containing your login
# credentials
name: bigip-login
key: password
command: ["/app/bin/k8s-bigip-ctlr"]
args: [
# See the k8s-bigip-ctlr documentation for information about
# all config options
# https://clouddocs.f5.com/products/connectors/k8s-bigip-ctlr/latest
"--bigip-username=$(BIGIP_USERNAME)",
"--bigip-password=$(BIGIP_PASSWORD)",
"--bigip-url=xxxxxxxxx",
"--bigip-partition=cce-test",
"--pool-member-type=cluster"
]
# imagePullSecrets:
# # Secret that gives access to a private docker registry
# - name: f5-docker-images
# # Secret containing the BIG-IP system login credentials
# - name: bigip-login

指定bigip-url

bigip-partition

pool-member-type

看下deployment日志有没有报错:

kubectl logs k8s-bigip-ctlr-deployment-bcf87fdb8-ztj9f -n kube-system

2. 创建应用和对应f5 vs的configmap

创建应用,这里以nginx为例:

kubectl create deployment --image=nginx nginx1

kubectl expose deployment nginx1 --port=80

创建f5vs的configmap

f5-resource-vs-example.configmap.yaml

kind: ConfigMap
apiVersion: v1
metadata:
name: nginx1.vs
labels:
f5type: virtual-server
data:
# See the f5-schema table for schema-controller compatibility
# https://clouddocs.f5.com/containers/latest/releases_and_versioning.html#f5-schema
schema: "f5schemadb://bigip-virtual-server_v0.1.7.json"
data: |
{
"virtualServer": {
"backend": {
"servicePort": 80,
"serviceName": "nginx1",
"healthMonitors": [{
"interval": 30,
"protocol": "http",
"send": "GET / HTTP/1.1\r\nHost:abc.com\r\n\r\n",
"recv": "200|OK",
"timeout": 120
}]
},
"frontend": {
"virtualAddress": {
"port": 80,
"bindAddr": "xxxxxxxxxx"
},
"partition": "cce-test",
"balance": "least-connections-member",
"mode": "http"
}
}
}

填写backend, frontend。

官网有比较详细的解释,参数可以添加很多。https://clouddocs.f5.com/products/connectors/k8s-bigip-ctlr/v1.10/

k8s big-ip control 安装使用的更多相关文章

  1. Istio(二):在Kubernetes(k8s)集群上安装部署istio1.14

    目录 一.模块概览 二.系统环境 三.安装istio 3.1 使用 Istioctl 安装 3.2 使用 Istio Operator 安装 3.3 生产部署情况如何? 3.4 平台安装指南 四.Ge ...

  2. Sublime Text以及Package Control安装方法

    官方下载:Sublime Text 中国论坛:Sublime 论坛 Sublime Text 是一个代码编辑器,具有漂亮的用户界面和强大的功能,并且它还是一个跨平台的编辑器,同时支持Windows.L ...

  3. Mac下sublime text 的“package control”安装

    小伙伴们好,我根据昨晚的经历写一个小总结:关于“Mac下sublime text 的“package control”安装”.本来安装package control是一个无比简单的事情,即使是初次使用 ...

  4. 006_Mac下sublime text 的“package control”安装,sublimepackage

    Mac下sublime text 的“package control”安装,sublimepackage 小伙伴们好,我根据昨晚的经历写一个小总结:关于“Mac下sublime text 的“pack ...

  5. 国内不fq安装K8S三: 使用helm安装kubernet-dashboard

    目录 3 使用helm安装kubernet-dashboard 3.1 Helm的安装 3.2 使用Helm部署Nginx Ingress 3.3 使用Helm部署dashboard 3.4 使用He ...

  6. 【K8S】K8S 1.18.2安装dashboard(基于kubernetes-dashboard 2.0.0版本)

    [K8S]K8S 1.18.2安装dashboard(基于kubernetes-dashboard 2.0.0版本) 写在前面 K8S集群部署成功了,如何对集群进行可视化管理呢?别着急,接下来,我们一 ...

  7. k8s第二回之k8s集群的安装

    1. k8s集群的安装 目录 1. k8s集群的安装 1.架构: 2.环境准备 3.master节点安装etcd 4. master节点安装kubernetes 5.node节点安装kubernete ...

  8. Sublime Text 3常用快捷键 以及package control 安装

    网络上搜索到的,现整理下来备用: package control安装 view下 ctrl+~ import urllib.request,os; pf = 'Package Control.subl ...

  9. 通过 Sublime Package Control 安装插件后不能用的解决办法

    最近使用 Sublime 写 SASS 的时候需要使用高亮功能,通过 Package Control 安装了相关插件,但是安装之后没有反应,再次打开 Package Control 的时候,已经搜索不 ...

随机推荐

  1. 苹果登录服务端JWT算法验证-PHP

    验证参数 可用的验证参数有 userID.authorizationCode.identityToken,需要iOS客户端传过来 验证方式 苹果登录验证可以选择两种验证方式 具体可参考这篇文章 htt ...

  2. 负载均衡服务之HAProxy基础配置(五)

    前文我们聊了下haproxy的修改报文首部的配置.压缩功能以及haproxy基于http协议自定义健康状态检测机制:回顾请参考https://www.cnblogs.com/qiuhom-1874/p ...

  3. 在项目中部署redis的读写分离架构(包含节点间认证口令)

    #### 在项目中部署redis的读写分离架构(包含节点间认证口令) ##### 1.配置过程 ---  1.此前就是已经将redis在系统中已经安装好了,redis utils目录下,有个redis ...

  4. Linux - centos7.X安装tomcat8

    创建tomcat安装路径 mkdir /usr/local/tomcat wget直接下载tomcat8 注意,需要已经安装了wget命令 wget http://mirrors.estointern ...

  5. javascript-文件File转换成base64格式

    不能直接访问用户计算机中的文件,一直都是Web应用开发中的一大障碍.2000年以前,处理文件的唯一方式就是在表单中加入<input type="file">字段,仅此而 ...

  6. PHP实现MySQL并发查询

    一般的,一个看似很简单的页面,一次http请求后,到达服务端,穿过Cache层,落到后台后,实际可能会有很多很多的数据查询逻辑!而这些查询实际是不相互依赖的,也即可以同时查询.比如各种用户信息,用户的 ...

  7. docker-数据管理(3)

    Docker 容器中管理数据主要有两种方式: 数据卷(Data volumes) 数据卷容器(Data volumes containers 数据卷是一个可供一个或者多个容器使用的特殊目录,它绕过UF ...

  8. 【Linux常见问题】CentOS 7 root用户密码忘记,找回密码方法

    1.开机按esc 2.选择CentOS Linux (3.10.0-693.......)     按 e 键: 3.光标移动到 linux 16 开头的行,找到 ro 改为 rw init=sysr ...

  9. webpack打包多入口配置

    在它的entry入口设置多文件入口即可,例: entry: { core: './src/core.js', design: './src/design.js' }, 单一出口输出: output: ...

  10. Express 文档(常见问题)

    常见问题 我该如何构建我的应用程序? 这个问题没有明确的答案,答案取决于你的应用程序规模和所涉及的团队,为了尽可能灵活,Express在结构方面没有做出任何假设. 在你喜欢的任何目录结构中,路由和其他 ...