Skip to content

Commit

Permalink
Merge pull request #61 from cloud-ark/additional-resource-support
Browse files Browse the repository at this point in the history
Added support for additional Kinds
  • Loading branch information
devdattakulkarni authored Apr 2, 2020
2 parents f64cdc2 + ea163f0 commit df4f666
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 6 deletions.
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ You can read more about our goals with Kubediscovery in
[this blog post](https://medium.com/@cloudark/kubediscovery-aggregated-api-server-to-learn-more-about-kubernetes-custom-resources-18202a1c4aef).



## How it works?

The ‘composition’ endpoint is used for obtaining dynamic composition tree of a Custom Resource instance in terms of its underlying resource instances.
Expand Down Expand Up @@ -163,19 +162,21 @@ kubectl get --raw "/apis/kubeplus.cloudark.io/v1/composition?kind=Postgres&insta

`$ eval $(minikube docker-env)`

3) Install/Vendor in dependencies:
3) Use Go version 1.10.2

4) Install/Vendor in dependencies:

`$ dep ensure`

4) Build the API Server container image:
5) Build the API Server container image:

`$ ./build-local-discovery-artifacts.sh`

5) Deploy the API Server in your cluster:
6) Deploy the API Server in your cluster:

`$ ./deploy-local-discovery-artifacts.sh`

6) Follow steps 3-10 listed under Try it section above.
7) Follow steps 3-10 listed under Try it section above.



Expand Down
2 changes: 1 addition & 1 deletion build-discovery-artifacts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

export GOOS=linux; go build .
cp kubediscovery ./artifacts/simple-image/kube-discovery-apiserver
docker build -t lmecld/kube-discovery-apiserver:latest ./artifacts/simple-image
docker build -t lmecld/kube-discovery-apiserver:0.4.1 ./artifacts/simple-image


16 changes: 16 additions & 0 deletions pkg/discovery/discovery.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ var (
ETCD_CLUSTER string
INGRESS string
STATEFULSET string
DAEMONSET string
RC string
)

var (
Expand Down Expand Up @@ -72,6 +74,8 @@ func init() {
ETCD_CLUSTER = "EtcdCluster"
INGRESS = "Ingress"
STATEFULSET = "StatefulSet"
DAEMONSET = "DaemonSet"
RC = "ReplicationController"

KindPluralMap = make(map[string]string)
kindVersionMap = make(map[string]string)
Expand All @@ -88,6 +92,18 @@ func init() {
kindVersionMap[REPLICA_SET] = "apis/extensions/v1beta1"
compositionMap[REPLICA_SET] = []string{"Pod"}

KindPluralMap[DAEMONSET] = "daemonsets"
kindVersionMap[DAEMONSET] = "apis/extensions/v1beta1"
compositionMap[DAEMONSET] = []string{"Pod"}

KindPluralMap[DAEMONSET] = "daemonsets"
kindVersionMap[DAEMONSET] = "apis/apps/v1"
compositionMap[DAEMONSET] = []string{"Pod"}

KindPluralMap[RC] = "replicationcontrollers"
kindVersionMap[RC] = "api/v1"
compositionMap[RC] = []string{"Pod"}

KindPluralMap[POD] = "pods"
kindVersionMap[POD] = "api/v1"
compositionMap[POD] = []string{}
Expand Down

0 comments on commit df4f666

Please sign in to comment.