forked from justinsb/cluster-addons
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from SomtochiAma/kubeproxy-complete
Makes controller run in-cluster
- Loading branch information
Showing
12 changed files
with
575 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
## This Readme documents how to run the KubeProxy operator in a kinder cluster | ||
|
||
# 1. Create a kinder cluster | ||
Ensure kinder is installed. [Installation docs](https://github.com/kubernetes/kubeadm/blob/master/kinder/README.md) | ||
|
||
```bash | ||
kinder create cluster --image=kindest/node:v1.18.0 | ||
|
||
kinder do kubeadm-config | ||
kinder do loadbalancer | ||
|
||
docker exec -it kind-control-plane-1 /kind/bin/kubeadm init --skip-phases="addon/kube-proxy" --ignore-preflight-errors="FileContent--proc-sys-net-bridge-bridge-nf-call-iptables,Swap,SystemVerification" --config /kind/kubeadm.conf | ||
kinder exec @all -- sysctl -w net.ipv4.conf.all.rp_filter=1 | ||
|
||
kinder cp @cp1:/etc/kubernetes/admin.conf $(kinder get kubeconfig-path) | ||
export KUBECONFIG=$(kinder get kubeconfig-path) | ||
``` | ||
|
||
You might have set the server ip in the KUBECONFIG to use localhost to reach the cluster, `insecure-skip-tls-verify` to true, and delete the ca certificate. To find the port, run `docker ps | grep kind` and check the port | ||
|
||
> insecure-skip-tls-verify: true | ||
> server: https://127.0.0.1:<port> | ||
2. Set the Kubernetes Service host and port in manager.yaml | ||
ssh into the node and get the host and port. | ||
The command below should give the host. | ||
```bash | ||
docker inspect kind-control-plane-1 | grep IPAddress | ||
``` | ||
|
||
Replace it in the `manager.yaml` | ||
|
||
>- name: KUBERNETES_SERVICE_HOST | ||
> value: "172.17.0.2" | ||
>- name: KUBERNETES_SERVICE_PORT | ||
> value: "6443" | ||
|
||
3. Build and deploy Docker image | ||
```bash | ||
make docker-build | ||
|
||
make deploy | ||
``` | ||
|
||
4. Install CRD | ||
|
||
```bash | ||
make install | ||
kubectl apply -f config/samples/ | ||
``` | ||
|
||
5. KubeProxy should be up and running |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,11 @@ | ||
resources: | ||
- manager.yaml | ||
apiVersion: kustomize.config.k8s.io/v1beta1 | ||
kind: Kustomization | ||
images: | ||
- name: controller | ||
newName: controller | ||
newTag: latest | ||
patchesStrategicMerge: | ||
- patches/apiserver_endpoint.patch.yaml | ||
- patches/tolerations_controlplane.patch.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
kubeproxy/config/manager/patches/apiserver_endpoint.patch.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: controller-manager | ||
namespace: system | ||
spec: | ||
template: | ||
spec: | ||
containers: | ||
- name: manager | ||
env: | ||
- name: KUBERNETES_SERVICE_HOST | ||
value: "172.17.0.2" | ||
- name: KUBERNETES_SERVICE_PORT | ||
value: "6443" |
15 changes: 15 additions & 0 deletions
15
kubeproxy/config/manager/patches/tolerations_controlplane.patch.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: controller-manager | ||
namespace: system | ||
spec: | ||
template: | ||
spec: | ||
tolerations: | ||
- key: "node.kubernetes.io/not-ready" | ||
operator: "Exists" | ||
effect: "NoSchedule" | ||
- key: "node-role.kubernetes.io/master" | ||
operator: "Exists" | ||
effect: "NoSchedule" |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.