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

[WIP] PetSets / StatefulSets #1088

Merged

Conversation

benjaminapetersen
Copy link
Contributor

Initial run at PetSets/StatefulSets

Currently supports:

  • Edit YAML
  • Delete
  • Readonly env vars (cannot edit env vars on a PetSet)
  • Annotations
  • Labels

Screenshots:

screen shot 2017-01-06 at 1 46 15 pm
screen shot 2017-01-06 at 1 46 24 pm

I have a running list of about 15 more tasks, but wanted to get this up here sooner than later & see if we can merge in PetSets in stages.

@jwforres @spadgett

Copy link
Member

@jwforres jwforres left a comment

Choose a reason for hiding this comment

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

can you change all references to petset to statefulset, also as soon as the rebase lands we will need to switch to requests statefulsets instead of petsets

@benjaminapetersen benjaminapetersen changed the title [WIP] Petsets statefulsets [WIP] PetSets / StatefulSets Jan 6, 2017
@benjaminapetersen
Copy link
Contributor Author

Forgot to include this screenshot. Need to decide, do we want these on the deployments page, or do they get a dedicated (and different table list data)?

screen shot 2017-01-09 at 3 02 26 pm

@benjaminapetersen
Copy link
Contributor Author

Added:

  • Metrics
  • Events
  • Storage
  • Updated PetSet to StatefulSet (despite the hello-petset name)
    screen shot 2017-01-10 at 10 22 48 am

@jwforres
Copy link
Member

@benjaminapetersen did you push those changes?

@jwforres
Copy link
Member

also breadcrumb in your screen shot still says Pet Sets

@benjaminapetersen
Copy link
Contributor Author

Working with the table list to figure out what is most meaningful. Trigger needs to be removed yet & replaced with something else.

screen shot 2017-01-10 at 2 22 14 pm

@benjaminapetersen
Copy link
Contributor Author

@jwforres updates pushed if you want to start taking a look.

@@ -174,6 +174,11 @@ angular
templateUrl: 'views/edit/deployment-config.html',
controller: 'EditDeploymentConfigController'
})
.when('/project/:project/browse/stateful-sets/:statefulset', {
Copy link
Member

Choose a reason for hiding this comment

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

capital S on Set in the param :statefulSet

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done, though the annoying thing about camelCase here is that it doesn't work in the controller when using $routeParams. It will still be $routeParams.statefulset :(

@@ -404,6 +409,9 @@ angular
.when('/project/:project/browse/deployments-replicationcontrollers/:rc', {
redirectTo: '/project/:project/browse/rc/:rc'
})
.when('/project/:project/browse/pet-sets/:petset', {
redirectTo: '/project/:project/browse/stateful-sets/:statefulset'
Copy link
Member

Choose a reason for hiding this comment

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

why is this needed

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not anymore, but initially i was thinking we would get this in to support PetSets, then update to StatefulSets. Will remove.

group: 'apps',
version: 'v1alpha1'
}, context, function(statefulSets) {
console.log('statefulSets?', statefulSets.by('metadata.name'));
Copy link
Member

Choose a reason for hiding this comment

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

remove console.log

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will do. Assumed this block is tmp code till we agree it will land.

@@ -0,0 +1,90 @@
'use strict';

// TODO: statefulSetController rename
Copy link
Member

Choose a reason for hiding this comment

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

you can remove this TODO now right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yup

ProjectsService) {

$scope.projectName = $routeParams.project;
$scope.statefulSetName = $routeParams.statefulset || $routeParams.petset; // TODO: eliminate petset fallback
Copy link
Member

Choose a reason for hiding this comment

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

will want to make sure we remove this before merging, why is this currently needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Per the above, was assuming we may merge & update.

<uib-tab-heading>Events</uib-tab-heading>
<div class="resource-events">
<events
resource-kind="PetSet"
Copy link
Member

Choose a reason for hiding this comment

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

TODO here to switch to stateful set

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done.

<thead>
<tr>
<th>Name</th>
<th>Generation</th>
Copy link
Member

Choose a reason for hiding this comment

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

a lot of objects have Generation and we don't usually show it, I would probably just go with Name, Status, Created for now, we can discuss other options during design review thurs.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sounds good.

<td data-title="Status">
<status-icon status="statefulSet | deploymentStatus"></status-icon>
{{statefulSet | deploymentStatus}}
<span ng-if="(statefulSet | deploymentStatus) == 'Active' || (statefulSet | deploymentStatus) == 'Running'">,
Copy link
Member

Choose a reason for hiding this comment

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

i'm sure this was copied but these should really be triple equals ===

Copy link
Contributor Author

Choose a reason for hiding this comment

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

got it

{{statefulSet | deploymentStatus}}
<span ng-if="(statefulSet | deploymentStatus) == 'Active' || (statefulSet | deploymentStatus) == 'Running'">,
<span ng-if="statefulSet.spec.replicas !== statefulSet.status.replicas">{{statefulSet.status.replicas}}/</span>
{{statefulSet.spec.replicas}} replica<span ng-if="statefulSet.spec.replicas != 1">s</span>
Copy link
Member

Choose a reason for hiding this comment

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

!==

Copy link
Contributor Author

Choose a reason for hiding this comment

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

got it

@@ -77,8 +116,11 @@ <h3 ng-if="(deployments | hashSize) || (replicaSets | hashSize)">Deployment Conf
<div row class="status">
<status-icon status="replicationController | deploymentStatus" disable-animation></status-icon>
<span flex>
{{replicationController | deploymentStatus}}<span ng-if="(replicationController | deploymentStatus) == 'Active' || (replicationController | deploymentStatus) == 'Running'">,
<span ng-if="replicationController.spec.replicas !== replicationController.status.replicas">{{replicationController.status.replicas}}/</span>{{replicationController.spec.replicas}} replica<span ng-if="replicationController.spec.replicas != 1">s</span></span>
{{replicationController | deploymentStatus}}
Copy link
Member

Choose a reason for hiding this comment

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

you have introduced whitespace here that will cause the , to have a space in front of it

Copy link
Contributor Author

Choose a reason for hiding this comment

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

bah, html. 😒

Copy link
Member

Choose a reason for hiding this comment

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

dont forget you need to fix the fact that this is adding whitespace

@benjaminapetersen
Copy link
Contributor Author

Ok, updated comments above. I think the only outstanding is:

  • Where do these live (I'm still leaning towards a dedicated page)
  • If we do/don't update to a dedicated page, how do we want the breadcrumbs done (prob Deployments >> StatefulSetName if not Stateful Sets >> StatefulSetName)

Working on adding the donut now.

@benjaminapetersen
Copy link
Contributor Author

New screenshots, pushing code soon:

screen shot 2017-01-17 at 2 57 54 pm

screen shot 2017-01-17 at 2 55 12 pm

@jwforres
Copy link
Member

jwforres commented Jan 17, 2017 via email

@benjaminapetersen
Copy link
Contributor Author

@jwforres tinkering with the storage, including:

  • remove volume
  • add storage
  • add config files

Add Storage gives me an error, but I'm diagnosing (I dont think this came from the API):
screen shot 2017-01-17 at 4 11 20 pm

@jwforres
Copy link
Member

jwforres commented Jan 17, 2017 via email

@benjaminapetersen
Copy link
Contributor Author

Heh, yeah all of those actions are forbidden. neverthemind :)

@benjaminapetersen
Copy link
Contributor Author

benjaminapetersen commented Jan 17, 2017

Right, I added it to the allowed filter in the controllers, but the API response is still forbidden via a 422 error.

@benjaminapetersen
Copy link
Contributor Author

Perhaps something like this for persistent volume claim templates?
screen shot 2017-01-17 at 10 39 01 pm

Deliberately looks like volumes, but I'm trying to decide if its confusing.

@jwforres
Copy link
Member

Hmm, so we have largely stopped saying PVC in a lot of places, I'm wondering if this should say something like "Storage Template" or "Provisioned Storage Template" and put that section right underneath the Template section, and then maybe Volumes should be called Attached Volumes instead?

@spadgett thoughts?

@jwforres
Copy link
Member

Either way it probably needs a help tip or something next to the storage template section that explains what it is, since its a new concept that only exists on stateful sets. Or if we are able to get a subsection in the new stateful set docs page that talks about it we could link to that

@benjaminapetersen
Copy link
Contributor Author

@adellape ping! The above comment might be helpful for something we could use in the new docs page.

@benjaminapetersen
Copy link
Contributor Author

I do prefer it closer to the template above, wonder if I should mimic the style (grey left border, icons(?), etc):

screen shot 2017-01-18 at 10 45 09 am

@jwforres
Copy link
Member

Its probably worth trying, but I'm not sure what icon you would use for Access Mode. Also access mode needs to be humanized.

@benjaminapetersen
Copy link
Contributor Author

I think I do like the direction of this better:
screen shot 2017-01-18 at 11 02 29 am

Prob we can iron out the icons. The disk is so-so. The "server" icon seems too small to see & not sure its exactly right.

@jwforres
Copy link
Member

the server icon should probably be the database icon instead, like the mount icon in the pod template

@benjaminapetersen
Copy link
Contributor Author

Updated to the database icon, couple other options for the access mode icon:

Disk icon for access mode:
screen shot 2017-01-18 at 12 06 29 pm
Lock icon for access mode:
screen shot 2017-01-18 at 12 07 07 pm
Key icon for access mode:
screen shot 2017-01-18 at 12 07 26 pm

@ajacobs21e & (does liz have a github id?)

@benjaminapetersen benjaminapetersen force-pushed the petsets-statefulsets branch 2 times, most recently from 0cc34ab to b28dc2b Compare January 18, 2017 17:22
@benjaminapetersen
Copy link
Contributor Author

@lizsurette re: the icons

@lizsurette
Copy link

@benjaminapetersen I think the lock icon is fairly standard for representing something that deals with "permissions". Do you guys use that icon anywhere else? I just wouldn't want it to be used differently in two places and confuse anyone. @ajacobs21e

@@ -196,6 +196,12 @@ angular.module("openshiftConsole")
.segmentCoded(name.substring(0, ind))
.segmentCoded(name.substring(ind + 1));
break;
// PetSet & StatefulSet handle the same
case "PetSet" :
Copy link
Member

Choose a reason for hiding this comment

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

we can remove this now correct?

<div
ng-repeat="template in templates"
class="pod-template">
<div class="component-label">Claim: {{template.metadata.name}}</div>
Copy link
Member

Choose a reason for hiding this comment

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

Storage Claim:

Copy link
Contributor Author

Choose a reason for hiding this comment

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

👍

<span class="fa fa-database" aria-hidden="true"></span>
</div>
<div flex class="word-break">
<span class="pod-template-key">Storage:</span>
Copy link
Member

Choose a reason for hiding this comment

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

Capacity:

Copy link
Contributor Author

Choose a reason for hiding this comment

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

got it

<div flex class="word-break">
<span class="pod-template-key">Access Modes:</span>
<span ng-repeat="mode in template.spec.accessModes">
{{mode}}
Copy link
Member

Choose a reason for hiding this comment

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

if its not $last add a ', '

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

<div class="row">
<div class="col-md-12">
<alerts alerts="alerts"></alerts>
Copy link
Member

Choose a reason for hiding this comment

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

assume this was moved intentionally?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I just reset this file since im not working on this page anymore.

@@ -77,8 +116,11 @@ <h3 ng-if="(deployments | hashSize) || (replicaSets | hashSize)">Deployment Conf
<div row class="status">
<status-icon status="replicationController | deploymentStatus" disable-animation></status-icon>
<span flex>
{{replicationController | deploymentStatus}}<span ng-if="(replicationController | deploymentStatus) == 'Active' || (replicationController | deploymentStatus) == 'Running'">,
<span ng-if="replicationController.spec.replicas !== replicationController.status.replicas">{{replicationController.status.replicas}}/</span>{{replicationController.spec.replicas}} replica<span ng-if="replicationController.spec.replicas != 1">s</span></span>
{{replicationController | deploymentStatus}}
Copy link
Member

Choose a reason for hiding this comment

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

dont forget you need to fix the fact that this is adding whitespace

@benjaminapetersen
Copy link
Contributor Author

Quick screenshot update, "selector" used a label icon:
screen shot 2017-01-18 at 4 17 56 pm

@jwforres
Copy link
Member

jwforres commented Jan 18, 2017 via email

@benjaminapetersen
Copy link
Contributor Author

@jwforres updated & squashed

- Details, Environment, Metrics, Events
- Edit YAML
- Delete
- Pods list
- Annotations
- Template & volume claim template

- No support currently for scale/autoscale
 - hopefully API support in near future

<div
row class="pod-template-image icon-row"
ng-if="template.spec.selector.matchLabels">
Copy link
Member

Choose a reason for hiding this comment

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

ok looks like this is using the new type of selectors, we can do a follow-up PR tomorrow, but we should handle matchExpressions as well, can you make a TODO for that for tomorrow in your notebook :)

Copy link
Member

Choose a reason for hiding this comment

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

@benjaminapetersen We have a selector directive now.

<selector selector="template.spec.selector"></selector>

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh nice, I'll update this

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hmmm. So if I swap that in I get this:

screen shot 2017-01-19 at 10 37 55 am

@sg00dwin I think the css in the pod-template targeting div:first-child is probably what is doing it, probably too greedy:

.icon-row div:first-child {
    text-align: center;
    width: 30px;
}

Pinging you before I update as this is used in a bunch of places.

@jwforres
Copy link
Member

[merge]

@openshift-bot
Copy link

Evaluated for origin web console merge up to 075d122

@openshift-bot
Copy link

openshift-bot commented Jan 18, 2017

Origin Web Console Merge Results: SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pull_requests_origin_web_console/935/) (Base Commit: 2cb38e1)

@openshift-bot openshift-bot merged commit f6709f6 into openshift:master Jan 18, 2017
@benjaminapetersen benjaminapetersen deleted the petsets-statefulsets branch January 18, 2017 22:50
@jwforres
Copy link
Member

jwforres commented Jan 19, 2017 via email

@ajacobs21e
Copy link

@benjaminapetersen I didn't have a chance to read through all this until now. I agree with Liz, if we are using the lock elsewhere then I wouldn't use it here.

Should readonly be read only or read-only? It looks funny to me as one word. Is it a common term to write it that way?

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.

6 participants