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

autotls feature doesn't work with OpenShift 3.9 (Kubernetes 1.8+) due to InitContainer annotation deprecation #1299

Closed
mojsha opened this issue May 25, 2018 · 17 comments
Assignees
Labels
cat/bug Bug which needs fixing group/kubernetes Kubernetes related issue

Comments

@mojsha
Copy link

mojsha commented May 25, 2018

The autotls feature uses initContainer alpha annotations (https://github.com/fabric8io/fabric8-maven-plugin/blob/bd414f1ad94fdf48e8de05f25e3e09998b3f7508/enricher/api/src/main/java/io/fabric8/maven/enricher/api/util/InitContainerHandler.java) but this has been deprecated as of Kubernetes 1.8.0 (https://kubernetes.io/docs/concepts/workloads/pods/init-containers/#support-and-compatibility).

We need to replace the annotation with the spec.initContainers field.

  • f-m-p version : 3.5.38

  • Maven version (mvn -v) : 3.3.9

  • Kubernetes / OpenShift setup and version :
    openshift v3.9.0+191fece
    kubernetes v1.9.1+a0ce1bc657

  • If it's a bug, how to reproduce :
    Enable and use autotls feature. Initcontainer will not be created.

@mojsha
Copy link
Author

mojsha commented Jun 18, 2018

@rohanKanojia Any chance you can assign this to somebody?

@rohanKanojia
Copy link
Member

Sorry for responding late, will take a look soon.

@rohanKanojia rohanKanojia self-assigned this Jun 18, 2018
@hrishin
Copy link
Member

hrishin commented Jun 18, 2018

@mojsha feel free to contribute 👍 :)
FYI soon we are going release new FMP version which is targeted for Kubernetes 1.8/1.9 and OpenShift 3.9.

rohanKanojia added a commit to rohanKanojia/fabric8-maven-plugin that referenced this issue Jun 18, 2018
…(Kubernetes 1.8+) due to InitContainer annotation deprecation
@mojsha
Copy link
Author

mojsha commented Jun 19, 2018

@hrishin When will it be released, and will it have solved the autotls issue?

@mojsha
Copy link
Author

mojsha commented Jul 2, 2018

@rohanKanojia @hrishin Any comments/updates (either about the new version for 3.9 or the patch)?

@piyush-garg
Copy link
Collaborator

@mojsha Its WIP, we need to first reflect in the client. Model work has been done and released fabric8io/kubernetes-client#1103.

@rohanKanojia
Copy link
Member

@mojsha: Sorry for the delay, I have a work in progress local branch which updates deprecated annotation. I have to test it

@mojsha
Copy link
Author

mojsha commented Jul 2, 2018

Thanks guys, if the 3.9-compatible release will take its time, we should perhaps have @rohanKanojia make a maintenance release in the interim period until it's done.

rohanKanojia added a commit to rohanKanojia/fabric8-maven-plugin that referenced this issue Jul 9, 2018
…(Kubernetes 1.8+) due to InitContainer annotation deprecation
@rohanKanojia rohanKanojia added cat/bug Bug which needs fixing in progress group/kubernetes Kubernetes related issue labels Jul 13, 2018
rohanKanojia added a commit to rohanKanojia/fabric8-maven-plugin that referenced this issue Jul 17, 2018
…(Kubernetes 1.8+) due to InitContainer annotation deprecation
@rhuss rhuss closed this as completed in 49cb572 Jul 30, 2018
rhuss added a commit that referenced this issue Jul 30, 2018
Fix #1299 : autotls feature doesn't work with OpenShift 3.9 (Kubernetes 1.8+) due to InitContainer annotation deprecation
@rohanKanojia
Copy link
Member

@mojsha : We released fabric8-maven-plugin 3.5.41 last week. It would contain the fix for this issue :) . Sorry for long delay.

@mojsha
Copy link
Author

mojsha commented Aug 8, 2018

@rohanKanojia I just tested it and it looks like the spring-boot-health-check enricher is broken because it is trying to apply the readiness/liveness healthchecks on the InitContainer:

[ERROR] Failed to update DeploymentConfig from openshift.yml. io.fabric8.kubernetes.client.KubernetesClientException: Failure executing: PUT at: https://openshift:8443/apis/apps.openshift.io/v1/namespaces/sample/deploymentconfigs/demo. Message: DeploymentConfig "demo" is invalid: [spec.template.spec.initContainers[0].livenessProbe: Invalid value: core.Probe{Handler:core.Handler{Exec:(*core.ExecAction)(nil), HTTPGet:(*core.HTTPGetAction)(0xc43c815960), TCPSocket:(*core.TCPSocketAction)(nil)}, InitialDelaySeconds:180, TimeoutSeconds:1, PeriodSeconds:10, SuccessThreshold:1, FailureThreshold:3}: must not be set for init containers, spec.template.spec.initContainers[0].readinessProbe: Invalid value: core.Probe{Handler:core.Handler{Exec:(*core.ExecAction)(nil), HTTPGet:(*core.HTTPGetAction)(0xc43c8159d0), TCPSocket:(*core.TCPSocketAction)(nil)}, InitialDelaySeconds:10, TimeoutSeconds:1, PeriodSeconds:10, SuccessThreshold:1, FailureThreshold:3}: must not be set for init containers].

@rohanKanojia
Copy link
Member

@mojsha : ah, Could you please share steps via which you were able to reproduce it? This might be coming because of #1283 , since now we're defining InitContainers on Deployment instead of annotations :-(

@mojsha
Copy link
Author

mojsha commented Aug 8, 2018

@rohanKanojia Essentially, you just need to add the enricher to your F-M-P pom.xml like so:

<enricher> <includes> <include>spring-boot-health-check</include> </includes> </enricher>

@rohanKanojia
Copy link
Member

@mojsha : I was trying to reproduce this, but somehow I'm not able to. Here is what I did:
1.) Changed pom.xml of samples/spring-boot like this.
2.) Hit mvn clean install
Build was successful. Is there something I could be missing?

@mojsha
Copy link
Author

mojsha commented Aug 8, 2018

@rohanKanojia Do you have initContainers in your DeploymentConfig resource fragment?

@rohanKanojia
Copy link
Member

ah, no. let me check with this

@rohanKanojia
Copy link
Member

@mojsha : Hi, I looked into it and looks like it is a case of #1283 . A pull request is already there(see #1202 ) to handle this health check enrichment in such a way that only main container is enriched, or something else depending upon what configuration you provide. I tested and it seemed to be working for me. Hopefully it would get in before next release :-)

@mojsha
Copy link
Author

mojsha commented Aug 9, 2018

@rohanKanojia Cool. Thanks for your efforts!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cat/bug Bug which needs fixing group/kubernetes Kubernetes related issue
Projects
None yet
Development

No branches or pull requests

4 participants