OpenShift cartridges provide the necessary command and control for the functionality of software that is running user's applications. OpenShift currently has many language cartridges JBoss, PHP, Ruby (Rails) etc. as well as many DB cartridges such as Postgres, Mysql, Mongo etc. Before writing your own cartridge you should search the current list of Red Hat and OpenShift Community provided cartriges.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// setupPprof enables pprof default endpoints | |
// Note: These endpoints and the podman flag --cpu-profile are mutually exclusive | |
// | |
// Examples: | |
// #1 go tool pprof -http localhost:8889 localhost:8888/debug/pprof/heap?seconds=120 | |
// Note: web page will only render after a sample has been recorded | |
// #2 curl http://localhost:8888/debug/pprof/heap > heap.pprof && go tool pprof heap.pprof | |
func (s *APIServer) setupPprof() { | |
if s.PProfAddr == "" { | |
return |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Remove deletes a Pod from local storage. The optional force parameter denotes | |
// that the Pod can be removed even if in a running state. | |
func Remove(ctx context.Context, nameOrID string, options *RemoveOptions) (*entities.PodRmReport, error) { | |
conn, err := bindings.GetClient(ctx) | |
if err != nil { | |
return nil, err | |
} | |
var params url.Values | |
if options != nil { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -ex | |
name='kubernetes/pause' | |
docker stop registry && docker rm -v registry ||: | |
rm -rf /var/registry/* ||: | |
ENV='-e REGISTRY_STORAGE_DELETE_ENABLED=true -e REGISTRY_LOG_LEVEL=debug' | |
docker run -d -p 5000:5000 --restart=always $ENV --volume /var/registry:/var/lib/registry --name registry registry:2.4 | |
docker pull $name |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import socket | |
import sys | |
from datetime import datetime | |
try: | |
import json | |
except: | |
import simplejson as json |