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

kubernetes: Add StatefulSets and CronJobs #2724

Merged
merged 6 commits into from
Jul 19, 2017
Merged

Conversation

ekimekim
Copy link
Contributor

@ekimekim ekimekim commented Jul 18, 2017

Fixes #2239. Fixes #2571.

Most basic info is in metadata. Future work:

  • Map statefulset to its associated service (probably as a parent)
  • Add a control to suspend cronjobs

@ekimekim ekimekim force-pushed the mike/k8s/jobs-and-petsets branch from f295ed4 to ce3fc0c Compare July 18, 2017 17:27
@ekimekim ekimekim requested a review from 2opremio July 18, 2017 17:33
desiredReplicas := 1
if d.Spec.Replicas != nil {
desiredReplicas = int(*d.Spec.Replicas)
}

This comment was marked as abuse.

This comment was marked as abuse.

This comment was marked as abuse.

This comment was marked as abuse.

This comment was marked as abuse.

@ekimekim ekimekim force-pushed the mike/k8s/jobs-and-petsets branch from ce3fc0c to 1c65505 Compare July 18, 2017 17:48
ekimekim added 4 commits July 18, 2017 11:35
Since renderKubernetesTopologies was getting unweildy, refactored into a form
which was a bit clearer, if a bit more verbose.
Most of the time you only care about cronjobs, not the jobs that make them up,
so we only collect full cronjob data. We associate pods of jobs with the parent cronjob
Spec.Replicas is a *int32, with a value of nil occurring when the user doesn't set it.
In this case k8s defaults to 1, so we mimic this to show the effective value.
@ekimekim ekimekim force-pushed the mike/k8s/jobs-and-petsets branch from 1c65505 to 38814d5 Compare July 18, 2017 18:36
@ekimekim
Copy link
Contributor Author

Forgot to add the cronjob and statefulset files :S fixed

break
}
}
}

This comment was marked as abuse.

CronJob: MakeTopology().
WithShape(Triangle).
WithLabel("cron job", "cron jobs"),

This comment was marked as abuse.

This comment was marked as abuse.

ekimekim added 2 commits July 19, 2017 11:16
Final list of shapes for controllers view, with rationale:
Heptagon for Deployment - same shape as Service, which typically have a corresponding Deployment
Triangle for CronJob - weird shape for weird thing
Pentagon for DaemonSet - because pentagons and daemon worship :P
Octagon for StatefulSet - last shape left
Currently joining the two lists is O(mn), by putting into a hashmap first it's O(m+n)
@ekimekim
Copy link
Contributor Author

PTAL

@rade
Copy link
Member

rade commented Jul 19, 2017

LGTM. Please file issues for the future work you listed above.

@ekimekim
Copy link
Contributor Author

related to #2620

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