Skip to content
This repository was archived by the owner on Jun 19, 2024. It is now read-only.

Conversation

@ucosty
Copy link
Contributor

@ucosty ucosty commented Oct 30, 2016

I've had some time to work on issue #517, adding support for generating PetSet and DaemonSet configurations using the fabric8-maven-plugin. I'll have a go at updating the documentation as well, to reflect some of these changes.

For now I've been using it by configuring the fmp-controller enricher to generate the PetSet and DaemonSet types.

The following snippet of code seems to work for my needs.

<enricher>
    <config>
        <fmp-controller>
            <type>petSet</type>
        </fmp-controller>
    </config>
</enricher>

@ucosty ucosty changed the title PetSet and DaemonSet support Issue #517PetSet and DaemonSet support Oct 30, 2016
@ucosty ucosty changed the title Issue #517PetSet and DaemonSet support Issue #517: PetSet and DaemonSet support Oct 30, 2016
@rhuss
Copy link
Contributor

rhuss commented Nov 11, 2016

Thanks, will have a look ASAP.

Copy link
Contributor

@rhuss rhuss left a comment

Choose a reason for hiding this comment

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

Except for some minor things, looks good to me.

Could you please fix that and update the PR ?

Thanks a lot !


private ObjectMeta createPetSetMetaData(ResourceConfig config) {
return new ObjectMetaBuilder()
.withName(KubernetesHelper.validateKubernetesId(config.getReplicaSetName(), "replica set name"))
Copy link
Contributor

Choose a reason for hiding this comment

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

wdyt, maybe we should rename replicaSetName to controllerName ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good idea, I've added that to this PR.

probe.setTimeoutSeconds(timeoutSeconds);
}
HTTPGetAction getAction = getHTTPGetAction(probeConfig.getGetUrl());
if(StringUtils.isEmpty(getAction.getHost())) {
Copy link
Contributor

Choose a reason for hiding this comment

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

This check can lead to a NPE since getAction can be null. Could explain briefly why an empty String as host is an issue ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It was a bit of a hack to allow an empty HTTP host to be set in the liveness/readiness checks. Without this minor change an empty host value would result in a literal empty host value being added to the output YAML. For now I've just removed this, as it should have been a part of issue #622.


@Override
protected Kind getKind() {
return Kind.DAEMON_SET;
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't this be Kind.PET_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.

Indeed it should be, fixed.

@oscerd
Copy link
Member

oscerd commented Dec 11, 2016

Any news on this one? :-)

Copy link
Contributor

@rhuss rhuss left a comment

Choose a reason for hiding this comment

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

Thanks a lot and sorry for the long delay. There is only one minor issue, if this is fixed we can merge it into master.

@Override
public void visit(PetSetSpecBuilder item) {
Map<String, String> selectorMatchLabels =
KubernetesResourceUtil.removeVersionSelector(enricherManager.extractSelector(getConfig(), Kind.REPLICATION_CONTROLLER));
Copy link
Contributor

Choose a reason for hiding this comment

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

Should be Kind.PET_SET

@Override
public void visit(DaemonSetSpecBuilder item) {
Map<String, String> selectorMatchLabels =
KubernetesResourceUtil.removeVersionSelector(enricherManager.extractSelector(getConfig(), Kind.REPLICATION_CONTROLLER));
Copy link
Contributor

Choose a reason for hiding this comment

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

shoud be Kind.DAEMON_SET (btw, there is an error for the Deployment selector, I will fix that.

@rhuss rhuss added Feedback required pr/change-requested Reviewer requested a change and removed Feedback required labels Dec 12, 2016
@rhuss
Copy link
Contributor

rhuss commented Dec 17, 2016

If you don't mind I would fix the outstanding issues and integrate this PR next week.

@oscerd
Copy link
Member

oscerd commented Jan 4, 2017

I'd like to see this one merged, to update the cassandra quickstart with a PetSet configuration :-)

@rhuss
Copy link
Contributor

rhuss commented Jan 4, 2017

@oscerd back right now, will go through the PRs here soon. Happy new year ;-) !

@oscerd
Copy link
Member

oscerd commented Jan 5, 2017

@rhuss happy new year! :-)

Thanks for your work! :-)

@ucosty
Copy link
Contributor Author

ucosty commented Feb 3, 2017

Sorry for the delay, this has been updated now.

@ucosty ucosty force-pushed the petset_daemonset_support branch from 9262620 to 3ec77b6 Compare February 3, 2017 16:38
@codecov
Copy link

codecov bot commented Feb 3, 2017

Codecov Report

Merging #620 into master will decrease coverage by -0.78%.

@@             Coverage Diff              @@
##             master     #620      +/-   ##
============================================
- Coverage     17.02%   16.24%   -0.78%     
+ Complexity      431      403      -28     
============================================
  Files           150      148       -2     
  Lines          8102     8102              
  Branches       1478     1468      -10     
============================================
- Hits           1379     1316      -63     
- Misses         6565     6633      +68     
+ Partials        158      153       -5

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1dc2abd...e93c69e. Read the comment docs.

@crashdump
Copy link

I would love to see this one merged.

@rhuss
Copy link
Contributor

rhuss commented Feb 7, 2017

will check that this later today or tomorrow, will merge it this week.

@jstrachan
Copy link
Contributor

though PetSet is now StatefulSet right?

@rhuss
Copy link
Contributor

rhuss commented Feb 7, 2017

Right, should be changed to StatefulSet.

@rhuss
Copy link
Contributor

rhuss commented Feb 7, 2017

We could support PetSet for backwards compatibility, too, but probably its better to start with out baggage. So I opts for supporting only StatefulSet.

@rawlingsj
Copy link
Contributor

FWIW this PR will bring in the StatefulSet rename fabric8io/kubernetes-client#646, once we're happy with that I was going to upgrade fabric8 and then fabric8-maven-plugin asap.

@rhuss rhuss removed the pr/change-requested Reviewer requested a change label Feb 9, 2017
@rhuss
Copy link
Contributor

rhuss commented Feb 9, 2017

@rawlingsj thanks a lot for StatefulSet, I'm going to rename it in this PR. Is the kubernetes-client already released with this addition ?

@rawlingsj
Copy link
Contributor

thanks a lot for StatefulSet, I'm going to rename it in this PR. Is the kubernetes-client already released with this addition ?

no problem! yes if you rebase this PR then you should get the new fabric8 version which includes the updated kubernetes client and model with StatefulSet.

@rhuss
Copy link
Contributor

rhuss commented Feb 9, 2017

Hmm. I see still fabric8 2.2.193 as the latest referring to kubernetes-client 2.0.0 (but 2.0.2 is the latest which contains the changes).

@rhuss
Copy link
Contributor

rhuss commented Feb 9, 2017

Let me debug that a bit here, looks a bit weird ... (using a kubernetes client 1.4.33 and so). Probably my fault.

@rhuss
Copy link
Contributor

rhuss commented Feb 9, 2017

ok, got it now properly. all good :)

@rawlingsj
Copy link
Contributor

Looks like there's been a couple more releases but 2.0.0 was the one that I did which includes the statefulset rename. So hopefully you should be good.

@rawlingsj
Copy link
Contributor

ok, got it now properly. all good :)

ah cool :)

@rhuss
Copy link
Contributor

rhuss commented Feb 9, 2017

I updated from PetSet to StatefulSet (thanks to @rawlingsj for the upstream kubernetes-client update !).

Changes look good to me. Some tests would have been nice but due to the fact that we don't have tests for the other handlers, too, its not fair to call for one here now ;-)

@rhuss
Copy link
Contributor

rhuss commented Feb 9, 2017

[merge]

@fusesource-ci fusesource-ci merged commit bf56cf2 into fabric8io:master Feb 9, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants