Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added New Operator SDK #8

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

Conversation

NoahElzein
Copy link

I kept the cache within the structure as we discussed.

All spots with r.client calls in the Controller are spots we must substitute the cache with.

I would appreciate comments on where I can retreieve the Postgres cache initially.

Thanks!

name: example-postgres
spec:
# Add fields here
size: 3
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the purpose of size field?

kind: Role
metadata:
creationTimestamp: null
name: postgres-operator-sdk-new
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like the Role name is defaulted to the folder name.

apiVersion: apps/v1
kind: Deployment
metadata:
name: postgres-operator-sdk-new
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same issue as Role name.

@@ -0,0 +1,10 @@
package controller
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the purpose of this file?


// newReconciler returns a new reconcile.Reconciler
func newReconciler(mgr manager.Manager) reconcile.Reconciler {
return &ReconcilePostgres{client: mgr.GetClient(), scheme: mgr.GetScheme(), cache: mgr.GetCache()}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can delete cache: mgr.GetCache()

// add adds a new Controller to mgr with r as the reconcile.Reconciler
func add(mgr manager.Manager, r reconcile.Reconciler) error {
// Create a new controller
log.Print("I AM HERE\n")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stray print line. Can be deleted.

fmt.Printf("Check using: kubectl describe postgres %s \n", deploymentName)

pgresObj := instance
err2 := r.client.Get(context.TODO(), request.NamespacedName, pgresObj)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why another Get call here?

}

pgresObj2 := &postgresv1.Postgres{}
err3 := r.client.Get(context.TODO(), request.NamespacedName, pgresObj2)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One more Get


func int32Ptr(i int32) *int32 { return &i }

// newbusyBoxPod demonstrates how to create a busybox pod
Copy link
Contributor

@devdattakulkarni devdattakulkarni Dec 17, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The newbusyBoxPod function can be deleted. It is not used anywhere.

@@ -0,0 +1,288 @@
# postgres-operator
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add this README to postgres-operator-sdk-new folder.


## Purpose of Experiment

--> Talk about the hypothesis of the experiment that Operator SDK might be less performant than sample-controller.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The lines here are mixed. Some of the them are directives of what the description should be about, and some contain the actual description of the experiment.

Delete the directive lines.

## Purpose of Experiment

--> Talk about the hypothesis of the experiment that Operator SDK might be less performant than sample-controller.
Give the reason why we think this might be the case. Refer to the Github issue about this from Operator SDK repo.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is no longer relevant.


--> Talk about the hypothesis of the experiment that Operator SDK might be less performant than sample-controller.
Give the reason why we think this might be the case. Refer to the Github issue about this from Operator SDK repo.
Refer to CloudARK blog on 'Writing Kubernetes Custom Controller'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Delete


## Begin Experiment

--> Say that you will need 4 windows - create them.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Delete

- Number of API calls for add-db
- Number of API calls for add-user

Is it possible for you to distinguish above three calls in your log file? I think it should be possible.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Delete


## Conclusion

--> Comment about what you learned from this research.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Delete


--> Comment about what you learned from this research.

What are the next steps? Is there any recommendation you can make to
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Delete

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants