@@ -0,0 +1,1315 @@
+package io.kubernetes.client.util;%0A%0Aimport io.kubernetes.client.ApiClient;%0A%0Aimport java.io.BufferedReader;%0Aimport java.io.FileReader;%0Aimport java.io.FileInputStream;%0Aimport java.io.IOException;%0A%0Apublic class Config %7B%0A    private static final String SERVICEACCOUNT_ROOT =%0A        %22/var/run/secrets/kubernetes.io/serviceaccount%22;%0A    private static final String SERVICEACCOUNT_CA_PATH =%0A        SERVICEACCOUNT_ROOT + %22/ca.crt%22;%0A    private static final String SERVICEACCOUNT_TOKEN_PATH =%0A        SERVICEACCOUNT_ROOT + %22/token%22;%0A%0A    public static ApiClient fromCluster() throws IOException %7B%0A        String host = System.getenv(%22KUBERNETES_SERVICE_HOST%22);%0A        String port = System.getenv(%22KUBERNETES_SERVICE_PORT%22);%0A%0A        FileInputStream caCert = new FileInputStream(SERVICEACCOUNT_CA_PATH);%0A        BufferedReader tokenReader = new BufferedReader(new FileReader(SERVICEACCOUNT_TOKEN_PATH));%0A        StringBuilder builder = new StringBuilder();%0A        for (String line = tokenReader.readLine(); line != null; line = tokenReader.readLine()) %7B%0A            builder.append(line);%0A        %7D%0A        ApiClient result = new ApiClient();%0A        result.setBasePath(%22https://%22 + host + %22:%22 + port);%0A        result.setSslCaCert(caCert);%0A        result.setAccessToken(builder.toString());%0A%0A        return result;%0A    %7D%0A%7D

Add a Config object that knows how to create ApiClients