-
Notifications
You must be signed in to change notification settings - Fork 3
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
base: master
Are you sure you want to change the base?
Conversation
name: example-postgres | ||
spec: | ||
# Add fields here | ||
size: 3 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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()} |
There was a problem hiding this comment.
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") |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
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' |
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Delete
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!