brew install go
export GOPATH=$HOME/go
export PATH=$PATH:/usr/local/bin:$GOPATH/bin
wget https://dl.google.com/go/go1.10.2.linux-amd64.tar.gz
sudo tar -xvf go1.10.2.linux-amd64.tar.gz -C /usr/local/
mkdir -p $HOME/go/src
export GOPATH=$HOME/go
export PATH=$PATH:/usr/local/go/bin:$GOPATH/bin
choco install golang
Create folder at C:\go-work.
Right click on "Start" and click on "Control Panel". Select "System and Security", then click on "System".
From the menu on the left, select the "Advanced systems settings".
Click the "Environment Variables" button at the bottom.
Click "New" from the "User variables" section.
Type GOPATH into the "Variable name" field.
Type C:\go-work into the "Variable value" field.
Click OK.
brew install dep
curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
choco install dep
go get -d -v github.com/operator-framework/operator-sdk
cd $GOPATH/src/github.com/operator-framework/operator-sdk
dep ensure -v
go install github.com/operator-framework/operator-sdk/commands/operator-sdk
operator-sdk --version
mkdir $GOPATH/src/github.com/memcached-operator
cd $GOPATH/src/github.com/memcached-operator
Create the project scaffold for the new custom operator. See https://github.com/operator-framework/operator-sdk/blob/master/doc/project_layout.md
operator-sdk new memcached-operator --api-version=cache.example.com/v1alpha1 --kind=Memcached
type MemcachedSpec struct {
// Size is the size of the memcached deployment
Size int32 `json:"size"`
}
type MemcachedStatus struct {
// Nodes are the names of the memcached pods
Nodes []string `json:"nodes"`
}
operator-sdk generate k8s
https://gist.githubusercontent.com/madorn/974f3b0b841c0d4621ef4b12ce5d6a14/raw/6f62c728587ad3c3a4e20d68df06e1a167f8fc2e/handler.go
operator-sdk build quay.io/madorn/memcached-operator:v0.0.1
docker push quay.io/madorn/memcached-operator:v0.0.1
kubectl apply -f deploy/deploy.yaml
go get -d -v github.com/operator-framework/operator-lifecycle-manager
minikube start --kubernetes-version=v1.10.0
minishift start --openshift-version=v3.9.0
kubectl create namespace tectonic-system
kubectl apply -f operator-lifecycle-manager/deploy/tectonic-alm-operator/manifests/0.4.0
kubectl get pods -n tectonic-system