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

IngressEnricher ignores IngressRules defined in XML config #231

Closed
rohanKanojia opened this issue Jun 4, 2020 · 1 comment · Fixed by #512
Closed

IngressEnricher ignores IngressRules defined in XML config #231

rohanKanojia opened this issue Jun 4, 2020 · 1 comment · Fixed by #512
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@rohanKanojia
Copy link
Member

rohanKanojia commented Jun 4, 2020

There is this field mentioned in XML config:
https://github.com/eclipse/jkube/blob/65087cc54ac59f773b6b41314e9b27684f3db47f/jkube-kit/config/resource/src/main/java/org/eclipse/jkube/kit/config/resource/ResourceConfig.java#L82

@jwcarman noticed this issue. When you try to provide IngressRules inside XML config like this:

            <plugin>
                <groupId>org.eclipse.jkube</groupId>
                <artifactId>kubernetes-maven-plugin</artifactId>
                <version>1.0.0-SNAPSHOT</version>
                <configuration>
                    <resources>
                        <replicas>${k8s.replicas}</replicas>
                        <routeDomain>hello.example.systems</routeDomain>
                        <serviceAccounts>
                            <serviceAccount>
                                <name>hello-k8s-sa</name>
                                <deploymentRef>${artifactId}</deploymentRef>
                            </serviceAccount>
                        </serviceAccounts>
                        <ingressRules>
                            <ingressRule>
                                <host>hello.example.systems</host>
                                <http>
                                    <paths>
                                        <path>
                                            <path>/</path>
                                            <backend>
                                                <serviceName>${artifactId}</serviceName>
                                                <servicePort>
                                                    <IntVal>80</IntVal>
                                                </servicePort>
                                            </backend>
                                        </path>
                                    </paths>
                                </http>
                            </ingressRule>
                        </ingressRules>
                    </resources>

                    ...

No IngressRule seems to be present inside the created Ingress resource during k8s:resource goal.

Actual generated fragment:

~/work/repos/fmp-samples/hello-k8s : $ cat target/classes/META-INF/jkube/kubernetes/hello-k8s-ingress.yml 
---
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  annotations:
    jkube.io/git-url: https://github.com/jwcarman/hello-k8s.git
    jkube.io/git-commit: 33a20e2ffed2abea7010586effc3fbc8e8e7f9f0
    jkube.io/git-branch: failing-ingress
    jkube.io/scm-url: https://github.com/spring-projects/spring-boot/hello-k8s
    jkube.io/scm-tag: HEAD
    jkube.io/issue-system: GitHub
    jkube.io/issue-tracker-url: https://github.com/spring-projects/spring-boot/issues
  labels:
    app: hello-k8s
    provider: jkube
    version: 0.0.14-SNAPSHOT
    group: com.example.k8s
  name: hello-k8s
spec:
  rules:
  - host: hello-k8s.hello.example.systems
    http:
      paths:
      - backend:
          serviceName: hello-k8s
          servicePort: 80

Expected generated fragment:

~/work/repos/fmp-samples/hello-k8s : $ cat target/classes/META-INF/jkube/kubernetes/hello-k8s-ingress.yml 
---
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  annotations:
    jkube.io/git-url: https://github.com/jwcarman/hello-k8s.git
    jkube.io/git-commit: 33a20e2ffed2abea7010586effc3fbc8e8e7f9f0
    jkube.io/git-branch: failing-ingress
    jkube.io/scm-url: https://github.com/spring-projects/spring-boot/hello-k8s
    jkube.io/scm-tag: HEAD
    jkube.io/issue-system: GitHub
    jkube.io/issue-tracker-url: https://github.com/spring-projects/spring-boot/issues
  labels:
    app: hello-k8s
    provider: jkube
    version: 0.0.14-SNAPSHOT
    group: com.example.k8s
  name: hello-k8s
spec:
  rules:
    - host: hello.example.systems
      http:
        paths:
          - backend:
              serviceName: hello-k8s
              servicePort: 80
            path: /

The plugin should also check XML configuration for provided Ingress configuration. Right now we're just using Kubernetes Model's IngressRule object inside our XML configuration. We should probably have our own IngressConfig class to be used inside ResourceConfig so that we don't get affected by changes in Kubernetes model over time.

@manusa manusa added the enhancement New feature or request label Jun 4, 2020
@manusa manusa added this to the 1.1.0 milestone Jun 4, 2020
@manusa
Copy link
Member

manusa commented Jun 4, 2020

Relates to: #184 #213

@rohanKanojia rohanKanojia self-assigned this Dec 3, 2020
rohanKanojia added a commit to rohanKanojia/jkube that referenced this issue Dec 3, 2020
rohanKanojia added a commit to rohanKanojia/jkube that referenced this issue Dec 7, 2020
rohanKanojia added a commit to rohanKanojia/jkube that referenced this issue Dec 8, 2020
rohanKanojia added a commit to rohanKanojia/jkube that referenced this issue Jan 4, 2021
rohanKanojia added a commit to rohanKanojia/jkube that referenced this issue Jan 13, 2021
rohanKanojia added a commit to rohanKanojia/jkube that referenced this issue Jan 21, 2021
manusa pushed a commit to rohanKanojia/jkube that referenced this issue Jan 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants