Merge pull request #7151 from Sn0rt/kops-api-server-enhancement

doc: support to debug kops-apiserver
This commit is contained in:
Kubernetes Prow Robot 2019-07-10 08:50:27 -07:00 committed by GitHub
commit 5e87f35f04
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 146 additions and 24 deletions

View File

@ -1,24 +0,0 @@
# Kops HTTP API Server
# Building the kops API server
Set your docker registry
```bash
cd ${GOPATH}/src/k8s.io/kops/
export DOCKER_REGISTRY=$registry
```
Build the kops API server container, and push the image up to your registry.
```bash
make kops-server-push
```
# Deploying the kops API server to a cluster
From the kops directory run the following `helm` command. More information on `helm` can be found [here](https://github.com/kubernetes/helm)
```bash
helm install charts/kops --namespace kops
```

View File

@ -0,0 +1,33 @@
# Kops HTTP API Server
# Building the kops API server
Set your docker registry
```bash
cd $GOPATH/src/k8s.io/kops
export DOCKER_REGISTRY=$registry
```
Build the kops API server container, and push the image up to your registry.
```bash
make kops-server-push
```
# Deploying the kops API server to a cluster
Choose one of the following methods (**only for develop**)
* the method one: apply the file
```bash
kubectl apply -f docs/kops-server/kops-server.yaml
```
* From the keops directory run the following `helm` command. More information on `helm` can be found [here](https://github.com/kubernetes/helm)
```bash
helm install charts/kops --namespace kops
```

View File

@ -0,0 +1,113 @@
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
namespace: kube-system
name: kops-server
spec:
replicas: 1
template:
metadata:
labels:
app: kops
spec:
containers:
- name: kops-server
image: docker.io/wangguohao/kops-server:latest
command: ["/kops-server"]
args: ["--etcd-servers", "http://etcd-service:2379"]
ports:
- containerPort: 80
serviceAccount: kops-server
---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
namespace: kube-system
name: kops-etcd
spec:
replicas: 1
template:
metadata:
labels:
app: kops-etcd
spec:
containers:
- name: etcd
command: ["etcd"]
args: ["--name", "default", "--listen-client-urls", "http://0.0.0.0:2379", "--advertise-client-urls", "http://0.0.0.0:2379", "--listen-peer-urls", "http://0.0.0.0:2380", "--initial-advertise-peer-urls", "http://0.0.0.0:2380", "--initial-cluster", "default=http://0.0.0.0:2380"]
image: quay.io/coreos/etcd:latest
---
kind: Service
apiVersion: v1
metadata:
namespace: kube-system
name: etcd-service
spec:
selector:
app: kops-etcd
ports:
- protocol: TCP
port: 2379
---
apiVersion: v1
kind: ServiceAccount
metadata:
namespace: kube-system
name: kops-server
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: kops-server
namespace: kube-system
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: kops:kops-server
subjects:
- kind: ServiceAccount
name: kops-server
namespace: kube-system
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: kops:kops-server
namespace: kube-system
rules:
- apiGroups:
- ""
resourceNames:
- extension-apiserver-authentication
resources:
- configmaps
verbs:
- get
- apiGroups:
- ""
resources:
- configmaps
- namespaces
verbs:
- get
- list
- watch
- apiGroups:
- admissionregistration.k8s.io
resources:
- mutatingwebhookconfigurations
- validatingwebhookconfigurations
verbs:
- create
- get
- list
- watch
- apiGroups:
- authorization.k8s.io
resources:
- subjectaccessreviews
verbs:
- create
- get
- list
- watch