Skip to content

Commit 908e3b7

Browse files
author
orannahoum
committed
Combine skydive analyzer and skydive agents into skydive suite.
Add script for openshift easy deploy. Fix kube config path error. Delete redundant logs messages.
1 parent dd89da0 commit 908e3b7

35 files changed

+1591
-518
lines changed

.idea/modules.xml

+8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/skydive-golang-operator.iml

+9
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/vcs.xml

+6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

PROJECT

+3
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,7 @@ resources:
77
- group: skydive
88
kind: SkydiveAnalyzer
99
version: v1beta1
10+
- group: skydive
11+
kind: SkydiveSuite
12+
version: v1
1013
version: "2"

README.md

+12-27
Original file line numberDiff line numberDiff line change
@@ -16,36 +16,21 @@ To set up this operator follow the instructions below:
1616
darwin/amd64
1717

1818
* An openshift cluster
19-
* If you don't have an openshift cluster you may locally install one
20-
using [kind](https://kind.sigs.k8s.io/docs/user/quick-start/)
2119

22-
### Installation
2320

24-
1. If you're running a kind cluster the following commands won't work for you and you will have to modify the project
25-
namespace in the next part
21+
### Modyfing the CRD
22+
Modify the file config/skydive_v1_skydivesuite.yaml and pick what you wish to deploy (insert true or false in the relevant field), the options are as follows:
23+
* Skydive agents
24+
* Skydive analyzer
25+
* Service route - TODO: doesn't work on IBM cluster.
26+
27+
Choose your logging level (defaults to INFO)
2628

27-
```zsh
28-
oc adm new-project --node-selector='' skydive
29-
oc project skydive
30-
```
3129

32-
2. Run this to grant privileges to your user (#TODO this is maybe not needed)
30+
### Installation - Open-Shift
3331

34-
```zsh
35-
oc adm policy add-scc-to-user privileged -z default
36-
oc adm policy add-cluster-role-to-user cluster-reader -z default
37-
```
32+
run the zsh script :
33+
```deploy_operator_on_openshift.sh```
3834

39-
3. Clone this repo into your $GOPATH/src folder
40-
4. From skydive-operator folder run:
41-
42-
```bash
43-
make manifests
44-
kubectl create -f config/crd/bases
45-
kubectl create -f config/samples/skydive_v1beta1_skydiveanalyzer.yaml
46-
kubectl create -f config/samples/skydive_v1beta1_skydiveagents.yaml
47-
make run
48-
```
49-
50-
You might need to install some golang packages
51-
(#TODO make sure to see what my IDE auto installed for me)
35+
### Installation - Kubernetes
36+
*** to be continued

api/v1beta1/groupversion_info.go api/v1/groupversion_info.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
1616

17-
// Package v1beta1 contains API Schema definitions for the skydive v1beta1 API group
17+
// Package v1 contains API Schema definitions for the skydive v1 API group
1818
// +kubebuilder:object:generate=true
1919
// +groupName=skydive.example.com
20-
package v1beta1
20+
package v1
2121

2222
import (
2323
"k8s.io/apimachinery/pkg/runtime/schema"
@@ -26,7 +26,7 @@ import (
2626

2727
var (
2828
// GroupVersion is group version used to register these objects
29-
GroupVersion = schema.GroupVersion{Group: "skydive.example.com", Version: "v1beta1"}
29+
GroupVersion = schema.GroupVersion{Group: "skydive.example.com", Version: "v1"}
3030

3131
// SchemeBuilder is used to add go types to the GroupVersionKind scheme
3232
SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion}

api/v1beta1/skydiveanalyzer_types.go api/v1/skydivesuite_types.go

+36-18
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
1616

17-
package v1beta1
17+
package v1
1818

1919
import (
2020
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
@@ -23,43 +23,61 @@ import (
2323
// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN!
2424
// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.
2525

26-
// SkydiveAnalyzerSpec defines the desired state of SkydiveAnalyzer
27-
type SkydiveAnalyzerSpec struct {
28-
// INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
29-
// Important: Run "make" to regenerate code after modifying this file
26+
// SkydiveSuiteSpec defines the desired state of SkydiveSuite
27+
type SkydiveSuiteSpec struct {
28+
Namespace string `json:"namespace,omitempty"`
29+
30+
Enable EnableSpec `json:"enable"`
31+
32+
Logging LoggingSpec `json:"logging"`
33+
}
34+
35+
type EnableSpec struct {
36+
// +optional
37+
// +kubebuilder:default=true
38+
Analyzer bool `json:"analyzer,omitempty"`
39+
40+
// +optional
41+
// +kubebuilder:default=true
42+
Agents bool `json:"agents,omitempty"`
43+
44+
// +optional
45+
// +kubebuilder:default=false
46+
Route bool `json:"route,omitempty"`
47+
}
3048

49+
type LoggingSpec struct {
3150
// +optional
32-
// +kubebuilder:default=1
33-
Replicas *int32 `json:"replicas,omitempty"`
51+
// +kubebuilder:default="INFO"
52+
Level string `json:"level,omitempty"`
3453
}
3554

36-
// SkydiveAnalyzerStatus defines the observed state of SkydiveAnalyzer
37-
type SkydiveAnalyzerStatus struct {
55+
// SkydiveSuiteStatus defines the observed state of SkydiveSuite
56+
type SkydiveSuiteStatus struct {
3857
// INSERT ADDITIONAL STATUS FIELD - define observed state of cluster
3958
// Important: Run "make" to regenerate code after modifying this file
4059
}
4160

4261
// +kubebuilder:object:root=true
43-
// +kubebuilder:subresource:status
4462

45-
// SkydiveAnalyzer is the Schema for the skydiveanalyzers API
46-
type SkydiveAnalyzer struct {
63+
// SkydiveSuite is the Schema for the skydivesuites API
64+
type SkydiveSuite struct {
4765
metav1.TypeMeta `json:",inline"`
4866
metav1.ObjectMeta `json:"metadata,omitempty"`
4967

50-
Spec SkydiveAnalyzerSpec `json:"spec,omitempty"`
51-
Status SkydiveAnalyzerStatus `json:"status,omitempty"`
68+
Spec SkydiveSuiteSpec `json:"spec,omitempty"`
69+
Status SkydiveSuiteStatus `json:"status,omitempty"`
5270
}
5371

5472
// +kubebuilder:object:root=true
5573

56-
// SkydiveAnalyzerList contains a list of SkydiveAnalyzer
57-
type SkydiveAnalyzerList struct {
74+
// SkydiveSuiteList contains a list of SkydiveSuite
75+
type SkydiveSuiteList struct {
5876
metav1.TypeMeta `json:",inline"`
5977
metav1.ListMeta `json:"metadata,omitempty"`
60-
Items []SkydiveAnalyzer `json:"items"`
78+
Items []SkydiveSuite `json:"items"`
6179
}
6280

6381
func init() {
64-
SchemeBuilder.Register(&SkydiveAnalyzer{}, &SkydiveAnalyzerList{})
82+
SchemeBuilder.Register(&SkydiveSuite{}, &SkydiveSuiteList{})
6583
}

api/v1/zz_generated.deepcopy.go

+146
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)