-
Notifications
You must be signed in to change notification settings - Fork 11
/
load-balancer-setup.yaml
123 lines (115 loc) · 3.49 KB
/
load-balancer-setup.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
# ******************************************************************************
# IBM Cloud Kubernetes Service, 5737-D43
# (C) Copyright IBM Corp. 2019, 2021 All Rights Reserved.
#
# SPDX-License-Identifier: Apache2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ******************************************************************************
# Example IBM CCM load balancer setup for cluster running on classic infrastructure.
---
apiVersion: v1
kind: Namespace
metadata:
name: ibm-system
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: ibm-cloud-provider-lb
namespace: ibm-system
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: ibm-cloud-provider-lb
namespace: ibm-system
rules:
- apiGroups: [""]
resources: ["configmaps"]
verbs: ["get", "list", "watch"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: ibm-cloud-provider-lb
namespace: ibm-system
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: ibm-cloud-provider-lb
subjects:
- kind: ServiceAccount
name: ibm-cloud-provider-lb
namespace: ibm-system
---
apiVersion: scheduling.k8s.io/v1
description: IBM priority class used for app critical pods that should run in the
cluster, but can be moved to another node if necessary.
kind: PriorityClass
metadata:
name: ibm-app-cluster-critical
value: 900000000
---
apiVersion: v1
data:
cluster_id: {{cluster_id}}
vlanipmap.json: {{ibm_cloud_provider_lb_vlanipmap}}
kind: ConfigMap
metadata:
name: ibm-cloud-provider-vlan-ip-config
namespace: kube-system
# ibm_cloud_provider_lb_vlanipmap structure used to define virtual IP addresses
# available for load balancer services for the cluster. The cluster must
# have nodes available in the specified region, zone and VLANs.
#
# type cloudProviderReservedIP struct {
# IP string `json:"ip"`
# SubnetID string `json:"subnet_id"`
# VlanID string `json:"vlan_id"`
# IsPublic bool `json:"is_public"`
# Zone string `json:"zone"`
# }
#
# type cloudProviderSubnet struct {
# ID string `json:"id"`
# IPs []string `json:"ips"`
# IsPublic bool `json:"is_public"`
# }
#
# type subnetConfigErrorField struct {
# IsPublic bool `json:"is_public"`
# IsBYOIP bool `json:"is_byoip"`
# ErrorReasonCode string `json:"error_reason_code"`
# ErrorMessage string `json:"error_message"`
# Status string `json:"status"`
# }
#
# type cloudProviderVlan struct {
# ID string `json:"id"`
# Subnets []cloudProviderSubnet `json:"subnets"`
# Zone string `json:"zone"`
# }
#
# type vlanConfigErrorField struct {
# ID string `json:"id"`
# Subnets []subnetConfigErrorField `json:"subnets"`
# Zone string `json:"zone"`
# Region string `json:"region"`
# }
#
# type cloudProviderVlanIPConfig struct {
# ReservedIPs []cloudProviderReservedIP `json:"reserved_ips"`
# Vlans []cloudProviderVlan `json:"vlans"`
# VlanErrors []vlanConfigErrorField `json:"vlan_errors"`
# }