|
69 | 69 | # service account |
70 | 70 | - kubectl get serviceaccount --all-namespaces |
71 | 71 | - kubectl get ingress --all-namespaces |
| 72 | + # api server url |
| 73 | + - kubectl config view |
72 | 74 | ignore_error: true |
73 | 75 |
|
74 | 76 | check:dash: |
@@ -130,7 +132,133 @@ tasks: |
130 | 132 | - kubectl -n k8m port-forward svc/k8m 3618:3618 # 打开ip+ 3618 端口 |
131 | 133 | - open http://localhost:3618 |
132 | 134 |
|
| 135 | + # kuboard: https://github.com/eip-work/kuboard-press |
| 136 | + # 用户名: admin |
| 137 | + # 密码: Kuboard123 |
| 138 | + web4: |
| 139 | + cmds: |
| 140 | + - docker-compose -f compose.yml up -d |
| 141 | + - docker-compose -f compose.yml ps |
| 142 | + - open http://localhost:6001 |
| 143 | + dir: kuboard/ |
| 144 | + |
| 145 | + web4:token: |
| 146 | + aliases: ["w4t"] |
| 147 | + cmds: |
| 148 | + - kubectl apply -f kuboard-create-token.yml |
| 149 | + - $(kubectl -n kuboard get secret $(kubectl -n kuboard get secret kuboard-admin-token | grep kuboard-admin-token | awk '{print $1}') -o go-template='{{.data.token}}' | base64 -d) |
| 150 | + dir: kuboard/ |
| 151 | + |
| 152 | + # kubesphere: https://github.com/kubesphere/kubesphere |
| 153 | + # 用户名: admin |
| 154 | + # 密码: P@88w0rd (首次更改为: Admin,1234) # https://kubesphere.io/docs/v4.1/02-quickstart/01-install-kubesphere/ |
| 155 | + web5: |
| 156 | + cmds: |
| 157 | + - helm upgrade --install -n kubesphere-system --create-namespace ks-core https://charts.kubesphere.io/main/ks-core-1.1.3.tgz --debug --wait |
| 158 | + # 查看服务端口 |
| 159 | + - kubectl -n kubesphere-system get svc |
| 160 | + # proxy |
| 161 | + - kubectl -n kubesphere-system port-forward svc/ks-console 6002:80 |
| 162 | + - open http://localhost:6002 |
| 163 | + |
| 164 | + ############################################################################# |
| 165 | + |
| 166 | + # |
| 167 | + # 负载均衡器: https://github.com/openelb/openelb |
| 168 | + # |
| 169 | + openelb:dl: |
| 170 | + aliases: ["oedl"] |
| 171 | + cmds: |
| 172 | + - wget https://raw.githubusercontent.com/openelb/openelb/release-0.6/deploy/openelb.yaml |
| 173 | + dir: openelb/ |
| 174 | + |
| 175 | + openelb:run: |
| 176 | + aliases: ["oe"] |
| 177 | + cmds: |
| 178 | + - kubectl apply -f openelb.yaml |
| 179 | + - kubectl get po -n openelb-system |
| 180 | + - kubectl get validatingwebhookconfiguration |
| 181 | + - kubectl get mutatingwebhookconfigurations |
| 182 | + - kubectl get nodes -o wide # 配置ip段, 要保证所有 Kubernetes 集群节点必须在同一个二层网络中 |
| 183 | + dir: openelb/ |
| 184 | + |
| 185 | + # create eip |
| 186 | + # - https://openelb.io/docs/getting-started/usage/openelb-ip-address-assignment/ |
| 187 | + openelb:eip: |
| 188 | + aliases: ["oeip"] |
| 189 | + cmds: |
| 190 | + - kubectl apply -f openelb.eip.yml |
| 191 | + dir: openelb/ |
| 192 | + |
| 193 | + openelb:del: |
| 194 | + aliases: ["od"] |
| 195 | + cmds: |
| 196 | + - kubectl delete -f openelb.yaml |
| 197 | + dir: openelb/ |
| 198 | + |
| 199 | + # 示例服务: nginx |
| 200 | + openelb:nginx: |
| 201 | + aliases: ["ng"] |
| 202 | + cmds: |
| 203 | + - kubectl apply -f nginx.yml |
| 204 | + - kubectl get pods |
| 205 | + dir: openelb/ |
| 206 | + |
| 207 | + # load balancer |
| 208 | + openelb:nginx:lb: |
| 209 | + aliases: ["nglb"] |
| 210 | + cmds: |
| 211 | + - kubectl apply -f nginx.svc.yml |
| 212 | + - kubectl get svc nginx |
| 213 | + dir: openelb/ |
| 214 | + |
| 215 | + ng2: |
| 216 | + cmds: |
| 217 | + - kubectl apply -f nginx.svc2.yml |
| 218 | + - kubectl get svc |
| 219 | + - kubectl get pod,svc,ing |
| 220 | + dir: openelb/ |
| 221 | + |
| 222 | + ############################################################################# |
| 223 | + |
| 224 | + # |
| 225 | + #负载均衡的正确配置过程: |
| 226 | + # |
| 227 | + create:cluster: |
| 228 | + cmds: |
| 229 | + - k3d cluster create --api-port 6550 -p "8081:80@loadbalancer" --agents 2 k3d-test |
| 230 | + - k3d cluster list |
| 231 | + - kubectl --cluster k3d-k3d-test get nodes,svc,ing,pod |
| 232 | + |
| 233 | + # k3d cluster |
| 234 | + k3d:del: |
| 235 | + aliases: ["kd"] |
| 236 | + cmds: |
| 237 | + - k3d cluster list |
| 238 | + - k3d cluster delete # k3d-test |
| 239 | + |
| 240 | + # |
| 241 | + # 负载均衡的正确配置过程: |
| 242 | + # - https://k3d.io/stable/usage/exposing_services/#1-via-ingress-recommended |
| 243 | + # - 这个是成功的!!!! |
| 244 | + # - 基于 Ingress 公开暴露服务!!! |
| 245 | + # |
| 246 | + ng3: |
| 247 | + cmds: |
| 248 | + - kubectl --cluster k3d-k3d-test apply -f nginx.svc3.yml |
| 249 | + - kubectl --cluster k3d-k3d-test get svc |
| 250 | + - kubectl --cluster k3d-k3d-test get pod,svc,ing |
| 251 | + - open http://localhost:8081 # 注意不是 https !!! |
| 252 | + dir: openelb/ |
| 253 | + |
| 254 | + ############################################################################# |
| 255 | + |
133 | 256 | cluster:import: |
134 | 257 | aliases: ["ci"] |
135 | 258 | cmds: |
136 | 259 | - cat $HOME/.kube/config | grep server | awk '{print $2}' |
| 260 | + |
| 261 | + compose: |
| 262 | + aliases: ["dc"] |
| 263 | + cmds: |
| 264 | + - docker-compose {{.CLI_ARGS}} |
0 commit comments