Skip to content

Commit

Permalink
Documentation for running operator in kinder cluster
Browse files Browse the repository at this point in the history
  • Loading branch information
somtochiama committed Jun 2, 2020
1 parent 68e7b14 commit b45073d
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 0 deletions.
53 changes: 53 additions & 0 deletions kubeproxy/InCluster.md
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
3 changes: 3 additions & 0 deletions kubeproxy/config/rbac/auth_proxy_role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ rules:
- apiGroups: [""]
resources: ["*"]
verbs: ["list", "get", "watch"]
- apiGroups: [""]
resources: ["events", "serviceaccounts"]
verbs: ["create", "patch", "update"]
- apiGroups: ["apps", "extensions"]
resources: ["daemonsets"]
verbs: ["get", "watch", "list", "create", "patch"]
Expand Down

0 comments on commit b45073d

Please sign in to comment.