Skip to content

Instantly share code, notes, and snippets.

View smarterclayton's full-sized avatar

Clayton Coleman smarterclayton

View GitHub Profile
if quota := v.CPUQuota; quota > 0 {
if quota < 1000 {
quota = 1000 // minQuotaPeriod
}
milliCPU := quota * 1000 // milliCPUtoCPU
milliCPU = milliCPU / 100000 // quotaPeriod
c.Resources.Limits[kapi.ResourceCPU] = resource.NewMilliQuantity(milliCPU, resource.DecimalSI)
}
if shares := v.CPUShares; shares > 0 {
if shares < 2 {
$ oc init
On branch init @ 3082f62 with remote [email protected]:openshift/origin.git
When initializing a repository, you can choose how you want to develop:
1. Build from your local code using a binary build (--binary)
This is the simplest setup. Your local code will be uploaded on each build, but you won't
be able to rebuild without uploading your code again. Best used when you're testing out a
build locally.
@smarterclayton
smarterclayton / gist:17ff2e6747330d45e483
Last active February 12, 2016 06:15
Things wrong in vs.code
* code complete appears in comments
* font weight is wrong / change font
* colors of comment section are bad
* ONE FOLDER ARE YOU KIDDING ME
* double click in string includes quotes
* find and replace all???
https://github.com/cockroachdb/cockroach/pull/615#discussion_r28082815
@smarterclayton
smarterclayton / oscstatus-1
Last active August 29, 2015 14:17
example osc status
In project foo
service frontend.foo.local port 80 -> 8080 (172.121.17.2)
routing www.cdrom.com, frontend.router.openshift.mycompany.com
ruby-helloworld deploys image openshift/origin-ruby-sample:latest <- https://github.com/mfojtik/ruby-sample.git
build 345 started 3 minutes ago (3498755: Added license (Psju33100) authored by jdoe)
#3 deployed 1 day ago - 97% of 305 pods running on 40 nodes
service backend.foo.local port 3306 (172.121.17.5)
db-shard-east deploys image openshift/origin-mysql:latest manually
_ = master.New(&master.Config{
Client: kubeClient,
EtcdHelper: etcdHelper,
HealthCheckMinions: false,
KubeletClient: kubeletClient,
APIPrefix: "/api/v1beta1",
@smarterclayton
smarterclayton / gist:d4145348de9feaf36967
Created January 29, 2015 19:36
NewTestImageOpenShift
handlerContainer := master.NewHandlerContainer(osMux)
_ = master.New(&master.Config{
Client: kubeClient,
EtcdHelper: etcdHelper,
HealthCheckMinions: false,
KubeletClient: kubeletClient,
APIPrefix: "/api/v1beta1",
RestfulContainer: handlerContainer,
})
==================
WARNING: DATA RACE
Read by goroutine 282:
sync.raceRead()
/usr/lib/golang/src/pkg/sync/race.go:37 +0x35
sync.(*WaitGroup).Add()
/usr/lib/golang/src/pkg/sync/waitgroup.go:60 +0xbe
net/http/httptest.(*waitGroupHandler).ServeHTTP()
/usr/lib/golang/src/pkg/net/http/httptest/server.go:198 +0x5e
net/http.serverHandler.ServeHTTP()
$ osc new-app openshift/ruby-20-centos~git://github.com/mfojtik/sinatra-app-example --build=source
{
"kind": "List",
"creationTimestamp": null,
"apiVersion": "v1beta1",
"items": [
{
"kind": "ImageRepository",
"apiVersion": "v1beta1",
"metadata": {
@smarterclayton
smarterclayton / replicationcontroller.json
Created November 14, 2014 19:59
A replication controller created by a deployment config
// ReplicationController[I'm Deployment 1 of mydeployment created when mydeployment was at index 50]
{
"metadata": {
"labels": {
"deployment": "1"
},
"annotations": {
"description": "This is deployment 1 of mydeployment: we are going to roll this sucker out",
"deployment.version": "1",
"deployment.config": "mydeployment",