F5 CIS (Container Ingress Services), Manifest 및 Helm Chart를 통해 설치
F5 CIS, BIG-IP Container Ingress Services(CIS)는 Kubernetes나 OpenShift의 기본 CLI/API를 사용하여 F5 BIG-IP 장치를 관리할 수 있게 해주며, Kubernetes나 OpenShift를 BIG-IP Orchestration 플랫폼으로 사용할 수 있는 Cloud-native connector 입니다.
CIS는 고객 시나리오에 따라 여러 가지 방식으로 구성할 수 있습니다. CIS는 Kubernetes 플랫폼에 배포할 수 있습니다. CIS 설치는 고객이 Kubernetes 서비스를 노출하기 위해 사용하는 리소스(예: ConfigMap, Ingress, Routes, CRD)에 따라 달라질 수 있습니다.
또한 CIS 설치는 BIG-IP 배포(단독 또는 고가용성 구성)와 Kubernetes 클러스터 네트워킹(Flannel/Calico)에 따라 달라집니다.
목차
1. F5 CIS 설치 전 사전요구사항
2. F5 CIS 매뉴얼 설치
2-1. Kubernetes 클러스터에서 VXLAN Tunnel 생성하기
3. Helm Chart를 통한 F5 CIS 설치
3-1. Helm Chart Parameter
3-2. Helm Chart 삭제
1. F5 CIS 설치 전 사전요구사항
다음은 CIS를 배포하기 위한 필수 요구 사항입니다:
- Kubernetes 클러스터가 정상적으로 실행 중이어야 합니다.
- BIG-IP 시스템에 AS3: 3.18 이상이 설치되어 있어야 합니다.
- kube-api에 대해 최신 TLS 버전 및 암호화 스위트를 Kubernetes에서 사용해야 합니다.
- Kubernetes 객체를 관리하기 위한 BIG-IP 파티션을 생성해야 합니다. 이 파티션은 GUI(System > Users > Partition List) 또는 TMOS CLI를 통해 생성할 수 있습니다:
create auth partition <cis_managed_partition> - 이 파티션에 대한 관리자 권한을 가진 사용자가 필요합니다.
- 개인 Docker 레지스트리에서 k8s-bigip-ctlr 이미지를 가져와야 하는 경우, Docker 로그인 자격 증명을 Secret으로 저장해야 합니다.
또한, CIS를 클러스터 모드로 배포하는 경우 다음과 같은 추가 전제 조건이 필요합니다.
- BIG-IP는 완전하게 활성화되고 라이선스가 부여되어 있어야 합니다. SDN 서비스에 대한 라이선스가 필요합니다. 자세한 내용은 SDN 서비스를 위한 BIG-IP VE 라이선스 지원을 참조하십시오. 이 요구 사항은 BIG-IP v12.X 및 v13.X에 해당되며, 이후 버전에서는 기본적으로 포함되어 있습니다.
- Kubernetes 클러스터에서 BIG-IP로의 VXLAN 터널이 구성되어 있어야 합니다.
2. F5 CIS 매뉴얼 설치
1. BIG-IP 인증 정보를 Kubernetes Secret으로 추가
kubectl create secret generic f5-bigip-ctlr-login -n kube-system --from-literal=username=admin --from-literal=password=<password>
2. ServiceAccount 생성
kubectl create serviceaccount bigip-ctlr -n kube-system
3. ClusterRole 및 ClusterRoleBinding 생성
kubectl create -f https://raw.githubusercontent.com/F5Networks/k8s-bigip-ctlr/2.x-master/docs/config_examples/rbac/k8s_rbac.yml
k8s_rbac.yaml
# for reference only
# Should be changed as per your cluster requirements
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: bigip-ctlr-clusterrole
rules:
- apiGroups: ["", "extensions", "networking.k8s.io"]
resources: ["nodes", "services", "endpoints", "namespaces", "ingresses", "pods", "ingressclasses", "policies"]
verbs: ["get", "list", "watch"]
- apiGroups: ["", "extensions", "networking.k8s.io"]
resources: ["configmaps", "events", "ingresses/status", "services/status"]
verbs: ["get", "list", "watch", "update", "create", "patch"]
- apiGroups: ["cis.f5.com"]
resources: ["virtualservers","virtualservers/status", "tlsprofiles", "transportservers", "transportservers/status", "ingresslinks", "ingresslinks/status", "externaldnses", "policies"]
verbs: ["get", "list", "watch", "update", "patch"]
- apiGroups: ["fic.f5.com"]
resources: ["ipams", "ipams/status"]
verbs: ["get", "list", "watch", "update", "create", "patch", "delete"]
- apiGroups: ["apiextensions.k8s.io"]
resources: ["customresourcedefinitions"]
verbs: ["get", "list", "watch", "update", "create", "patch"]
- apiGroups: ["", "extensions"]
resources: ["secrets"]
verbs: ["get", "list", "watch"]
- apiGroups: ["config.openshift.io/v1"]
resources: ["network"]
verbs: ["list"]
- apiGroups: [ "crd.projectcalico.org" ]
resources: [ "blockaffinities" ]
verbs: [ "get", "watch", "list" ]
---
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
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: bigip-ctlr
namespace: kube-system
컨트롤러가 전체 클러스터 접근이 필요 없다면 Role/RoleBinding으로 대체 가능
4. CRD 모드 사용 시 CRD 설치
https://raw.githubusercontent.com/F5Networks/k8s-bigip-ctlr/2.x-master/docs/config_examples/customResourceDefinitions/customresourcedefinitions.yml
5. cis_deploy.yaml 생성 및 적용
apiVersion: apps/v1
kind: Deployment
metadata:
name: k8s-bigip-ctlr-deployment
namespace: kube-system
spec:
# DO NOT INCREASE REPLICA COUNT
replicas: 1
selector:
matchLabels:
app: k8s-bigip-ctlr-deployment
template:
metadata:
labels:
app: k8s-bigip-ctlr-deployment
spec:
# Name of the Service Account bound to a Cluster Role with the required
# permissions
containers:
- name: k8s-bigip-ctlr
image: "f5networks/k8s-bigip-ctlr:latest"
env:
- name: BIGIP_USERNAME
valueFrom:
secretKeyRef:
# Replace with the name of the Secret containing your login
# credentials
name: f5-bigip-ctlr-login
key: username
- name: BIGIP_PASSWORD
valueFrom:
secretKeyRef:
# Replace with the name of the Secret containing your login
# credentials
name: f5-bigip-ctlr-login
key: password
command: ["/app/bin/k8s-bigip-ctlr"]
args: [
# See the k8s-bigip-ctlr documentation for information about
# all config options
# When insecure=true, this enables insecure SSL communication to the BIG-IP system."
# https://clouddocs.f5.com/containers/latest/
"--bigip-username=$(BIGIP_USERNAME)",
"--bigip-password=$(BIGIP_PASSWORD)",
"--bigip-url=<ip_address-or-hostname>",
"--bigip-partition=<name_of_partition>",
"--pool-member-type=nodeport",
"--insecure",
]
serviceAccountName: bigip-ctlr
kubectl apply -f cis_deploy.yaml
2-1. Kubernetes 클러스터에서 VXLAN Tunnel 생성하기 (Optional)
해당 목차의 과정은 선택사항입니다.
VXLAN이란 기존의 VLAN(가상 LAN)의 한계를 극복하고, 대규모 클라우드 환경이나 데이터센터 네트워크에서 가상 머신(VM) 간의 논리적인 Layer 2 연결을 Layer 3 네트워크 상에서 구현할 수 있도록 해주는 네트워크 오버레이 기술 표준입니다.
VXLAN은 여러 다른 조직, 즉 “테넌트”가 다른 테넌트의 네트워크 트래픽을 전혀 볼 수 없는 상태로 하나의 물리적 네트워크를 공유할 수 있게 해줍니다.
1. VXLAN Tunnel 생성하기, 아래 예시에서는 Tunnel 이름이 fl-vxlan입니다.
tmsh create net tunnels vxlan fl-vxlan port 8472 flooding-type none

2. VXLAN Profile 생성하기
tmsh create net tunnels tunnel fl-vxlan key 1 profile fl-vxlan local-address 192.168.200.91

3. VXLAN Tunnel 셀프 IP 생성하기
tmsh create net self 10.244.20.91 address 10.244.20.91/255.255.0.0 allow-service none vlan fl-vxlan

3. Helm Chart를 통한 F5 CIS 설치
관련 문서: Helm
Helm은 Kubernetes용 패키지 관리자이며, CIS 설치를 간편하게 도와줍니다.
1. BIG-IP 인증 정보 Secret 생성
kubectl create secret generic f5-bigip-ctlr-login -n kube-system --from-literal=username=admin --from-literal=password=<password>
2. Helm 저장소 추가
helm repo add f5-stable https://f5networks.github.io/charts/stable
3. values.yaml 생성 후 설정값 정의
주요 설정 항목:
bigip_login_secret: f5-bigip-ctlr-login
bigip_secret:
create: false
username:
password:
rbac:
create: true
serviceAccount:
# Specifies whether a service account should be created
create: true
# The name of the service account to use.
# If not set and create is true, a name is generated using the fullname template
name: k8s-bigip-ctlr
# This namespace is where the Controller lives;
namespace: kube-system
ingressClass:
create: true
ingressClassName: f5
isDefaultIngressController: true
args:
# See https://clouddocs.f5.com/containers/latest/userguide/config-parameters.html
# NOTE: helm has difficulty with values using `-`; `_` are used for naming
# and are replaced with `-` during rendering.
# REQUIRED Params
bigip_url: <ip_address-or-hostname>
bigip_partition: <name_of_partition>
# OPTIONAL PARAMS -- uncomment and provide values for those you wish to use.
# verify_interval:
# node-poll_interval:
# log_level:
# python_basedir: ~
# VXLAN
# openshift_sdn_name:
# flannel_name:
# KUBERNETES
# default_ingress_ip:
# kubeconfig:
# namespaces: ["foo", "bar"]
# namespace_label:
# node_label_selector:
# pool_member_type: nodeport
# resolve_ingress_names:
# running_in_cluster:
# use_node_internal:
# use_secrets:
# insecure: true
# custom-resource-mode: true
# log-as3-response: true
# gtm-bigip-password
# gtm-bigip-url
# gtm-bigip-username
# ipam : true
image:
# Use the tag to target a specific version of the Controller
user: f5networks
repo: k8s-bigip-ctlr
pullPolicy: Always
version: latest
# affinity:
# nodeAffinity:
# requiredDuringSchedulingIgnoredDuringExecution:
# nodeSelectorTerms:
# - matchExpressions:
# - key: kubernetes.io/arch
# operator: Exists
# securityContext:
# runAsUser: 1000
# runAsGroup: 3000
# fsGroup: 2000
# If you want to specify resources, uncomment the following
# limits_cpu: 100m
# limits_memory: 512Mi
# requests_cpu: 100m
# requests_memory: 512Mi
# Set podSecurityContext for Pod Security Admission and Pod Security Standards
# podSecurityContext:
# runAsUser: 1000
# runAsGroup: 1000
# privileged: true
4. Helm Chart 설치
BIG-IP Secret을 수동으로 생성한 경우:
helm install -f values.yaml <차트명> f5-stable/f5-bigip-ctlr
CRD 설치 없이 진행할 경우:
helm install --skip-crds -f values.yaml <차트명> f5-stable/f5-bigip-ctlr
Helm으로 Secret까지 자동 생성하고 싶을 경우:
helm install --set bigip_secret.create="true" \
--set bigip_secret.username=$BIGIP_USERNAME \
--set bigip_secret.password=$BIGIP_PASSWORD \
-f values.yaml <차트명> f5-stable/f5-bigip-ctlr
Kubernetes 1.18 이하 버전에서는 아래 명령어 사용:
helm install --skip-crds -f values.yaml <차트명> f5-stable/f5-bigip-ctlr --version 0.0.14
3-1. Helm Chart Parameter
Chart 주요 파라미터 요약
| 파라미터 | 필수 여부 | 기본값 | 설명 |
|---|---|---|---|
| bigip_login_secret | 선택 | f5-bigip-ctlr-login | BIG-IP 로그인 정보가 담긴 Secret |
| bigip_secret.create | 선택 | false | Secret 자동 생성 여부 |
| args.bigip_url | 필수 | 없음 | BIG-IP 장비의 관리 IP |
| args.bigip_partition | 필수 | f5-bigip-ctlr | 관리할 BIG-IP 파티션 이름 |
| image.user | 선택 | f5networks | 컨트롤러 이미지 사용자 이름 |
| version | 선택 | latest | 컨트롤러 이미지 태그 버전 |
참고:
bigip_login_secret와bigip_secret은 동시에 사용 불가. 둘 다 정의된 경우bigip_secret이 우선 적용됨.
3-2. Helm Chart 삭제
helm del <차트명>
F5 BIG-IP에 대해 자세한 정보를 알고 싶으신가요? 지금 NGINX STORE에 문의하여 다양한 사용 사례에 대해 상담 받아보세요.
댓글을 달려면 로그인해야 합니다.