Skip to content

Instantly share code, notes, and snippets.

View luksa's full-sized avatar

Marko Lukša luksa

View GitHub Profile
OpenShift 3.11 -> Kubernetes 1.11
OpenShift 4.1 -> Kubernetes 1.13
OpenShift 4.2 -> Kubernetes 1.14
OpenShift 4.3 -> Kubernetes 1.16
OpenShift 4.4 -> Kubernetes 1.17
#!/bin/bash
kubectl api-resources --verbs=list --namespaced -o name \
| xargs -n 1 kubectl get --show-kind --ignore-not-found
I0526 08:47:11.153362 17338 round_trippers.go:405] GET https://localhost:6443/api/v1/namespaces/default/configmaps/cluster-info 200 OK in 1 milliseconds
I0526 08:47:11.663177 17338 controller_instance.go:102] ===========================================
I0526 08:47:11.663188 17338 controller_instance.go:103] Adding ServiceInstance 'foo21/ups-instance-with-parametersfrom' to queue
I0526 08:47:11.663194 17338 controller_instance.go:104] ===========================================
I0526 08:47:11.663209 17338 controller.go:357] -------------------------------------------------
I0526 08:47:11.663237 17338 controller_instance.go:1112] ServiceInstance "foo21/ups-instance-with-parametersfrom": Removing condition "Failed"
I0526 08:47:11.663246 17338 controller_instance.go:962] ServiceInstance "foo21/ups-instance-with-parametersfrom": looking up a ClusterServiceClass from spec.externalName: "user-provided-service"
I0526 08:47:11.665472 17338 round_trippers.go:405] GET https://localhost:6443/apis/servicec
$ sudo iptables --list -t nat -n
Chain PREROUTING (policy ACCEPT)
target prot opt source destination
KUBE-SERVICES all -- 0.0.0.0/0 0.0.0.0/0 /* kubernetes service portals */
DOCKER all -- 0.0.0.0/0 0.0.0.0/0 ADDRTYPE match dst-type LOCAL
Chain INPUT (policy ACCEPT)
target prot opt source destination
Chain OUTPUT (policy ACCEPT)
if (foo == null) {
synchronized (this) {
if (foo == null) {
foo = createFoo();
}
}
}
return foo;
@luksa
luksa / openshift-wildfly-config.json
Last active August 29, 2015 14:12
An OpenShift V3 Application Config for deploying two replicas of WildFly
{
"kind": "Config",
"id": "wildfly-config",
"apiVersion": "v1beta1",
"name": "JBoss WildFly",
"description": "Creates a JBoss WildFly cluster",
"items": [
{
"kind": "Service",
"id": "wildfly-http-service",
2014-06-27 09:03:36,222 INFO [org.jboss.as.server.deployment] (MSC service thread 1-6) JBAS015876: Starting deployment of "io.fabric8.generated.fabric-profile-1.0.0.jar" (runtime-name: "io.fabric8.generated.fabric-profile-1.0.0.jar")
2014-06-27 09:03:36,229 DEBUG [org.jboss.as.server.deployment] (MSC service thread 1-1) Found Extension-Name manifest entry null in /content/io.fabric8.generated.fabric-profile-1.0.0.jar
2014-06-27 09:03:36,231 ERROR [org.jboss.as.controller.management-operation] (pool-3-thread-1) JBAS014613: Operation ("deploy") failed - address: ([("deployment" => "io.fabric8.generated.fabric-profile-1.0.0.jar")]) - failure description: {"JBAS014771: Services with missing/unavailable dependencies" => ["jboss.deployment.unit.\"io.fabric8.generated.fabric-profile-1.0.0.jar\".REGISTER is missing [jboss.wildfly.gravia.Repository]"]}
2014-06-27 09:03:36,232 ERROR [org.jboss.as.server] (pool-3-thread-1) JBAS015870: Deploy of deployment "io.fabric8.generated.fabric-profile-1.0.0.jar" was rolled back
@luksa
luksa / gist:d95ecf318b5e57f811bd
Last active August 29, 2015 14:02
ssh into fabric8 docker container by container id (e.g. sshf 5043fb)
#/bin/sh
# Store this into a file called "sshf" and do a chmod +x on it.
# Then simply do a "docker ps" to see the container id and then invoke "sshf <container id>" to ssh into
# that container
echo ssh-ing to docker container $1 \(port `docker port $1 22 | sed 's/.*://'`\)
ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o PreferredAuthentications=password fabric8@localhost -p `docker port $1 22 | sed 's/.*://'`
#/bin/sh
echo ssh-ing to docker container $1 \(port `docker port $1 22 | sed 's/.*://'`\)
ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o PreferredAuthentications=password fabric8@localhost -p `docker port $1 22 | sed 's/.*://'`