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

Can anyone tell me how to solve this problem:java.net.UnknownHostException: kubernetes.default.svc #1103

Open
kuailexingmao opened this issue Nov 3, 2021 · 1 comment
Labels
question Further information is requested

Comments

@kuailexingmao
Copy link

kuailexingmao commented Nov 3, 2021

I am using org.eclipse.jkube:openshift-maven-plugin, but the build fails.
My configuration is as follows:

<plugin>
    <groupld>org.eclipse.jkube</groupld>
    <artifactld>openshift-maven-plugin</artifactld>
    <version>l.5.l</version>
    <executions>
        <execution>
            <id>build-image</id>
            <phase>package</phase>
            <goals>
                <goal>build</goal>
                <goal>push</goal>
                <! --<goal>deploy</goal>-->
            </goals>
        </execution>
    </executions>
    <configuration>
        <dockerHost>${docker.maven.plugin.dockerhost}</dockerHost>
        <skip>${docker.maven.plugin.docker.skip}</skip>
        <verbose>true</verbose>
        <images>
            < image>
                <name>${docker.maven.plugin.docker.register}/${d^ckernanie}:${docker.maven.plugin.docker.tag}</name>
                < build>
                    <dockerFile>${project.basedir}/src/docker/Dockerfile</dockerFile>
                </build>
            </image>
        </images>
    </configuration>
</plugin>                                                                                            

Is there a problem with my configuration, can you tell me?Do I need to configure other files?
I read the official document, but I don't understand it a little too vaguely. Where can I see the detailed configuration about deploying to OPENSHIFT, I personally feel that the official documentation is too general.

Can you help me solve this problem first?Thx

@manusa
Copy link
Member

manusa commented Jan 12, 2022

The plugin is not detecting your .kube/config and thinks that it's being executed from within a Pod.

Are you sure you are logged in to your OpenShift cluster (oc login...)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants