Skip to content

Instantly share code, notes, and snippets.

@lburgazzoli
Created July 27, 2016 14:05
Show Gist options
  • Save lburgazzoli/6f4d1ca7b2588b71297396c49390f648 to your computer and use it in GitHub Desktop.
Save lburgazzoli/6f4d1ca7b2588b71297396c49390f648 to your computer and use it in GitHub Desktop.
@Grab(group='org.slf4j', module='slf4j-simple', version='1.7.14')
@Grab(group='io.fabric8', module='kubernetes-client', version='1.3.100')
import org.slf4j.*
import io.fabric8.kubernetes.client.*
def logger = LoggerFactory.getLogger("k8s")
def config = new ConfigBuilder().withMasterUrl("https://172.28.128.4:8443").build()
new DefaultKubernetesClient(config).withCloseable {
it.configMaps().withLabels([ 'karaf-id': 'karaf-1' ]).list().items.each {
logger.info("map ${it}")
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment