| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [View Raw Code] [Original HTTPS Page] |
We provide various approaches to run FrameworkController:
Notes:
If the k8s cluster enforces Authorization, you need to first create a ServiceAccount with granted permission for FrameworkController. For example, if the cluster enforces RBAC:
kubectl create serviceaccount frameworkcontroller --namespace default
kubectl create clusterrolebinding frameworkcontroller \
--clusterrole=cluster-admin \
--user=system:serviceaccount:default:frameworkcontrollerRun FrameworkController with above ServiceAccount and the k8s inClusterConfig:
kubectl create -f frameworkcontroller-with-default-config.yamlframeworkcontroller-with-default-config.yaml:
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: frameworkcontroller
namespace: default
spec:
serviceName: frameworkcontroller
selector:
matchLabels:
app: frameworkcontroller
replicas: 1
template:
metadata:
labels:
app: frameworkcontroller
spec:
# Using the ServiceAccount with granted permission
# if the k8s cluster enforces authorization.
serviceAccountName: frameworkcontroller
containers:
- name: frameworkcontroller
image: frameworkcontroller/frameworkcontroller
# Using k8s inClusterConfig, so usually, no need to specify
# KUBE_APISERVER_ADDRESS or KUBECONFIG
#env:
#- name: KUBE_APISERVER_ADDRESS
# value: {http[s]://host:port}
#- name: KUBECONFIG
# value: {Pod Local KubeConfig File Path}kubectl create -f frameworkcontroller-customized-config.yaml
kubectl create -f frameworkcontroller-with-customized-config.yamlframeworkcontroller-customized-config.yaml:
apiVersion: v1
kind: ConfigMap
metadata:
name: frameworkcontroller-config
namespace: default
data:
frameworkcontroller.yaml: |
kubeClientQps: 200
kubeClientBurst: 300
workerNumber: 500
largeFrameworkCompression: true
frameworkCompletedRetainSec: 2592000
#podFailureSpec:
#- code: 221
# phrase: ContainerTensorflowOOMKilled
# type:
# attributes: [Permanent]
# podPatterns:
# - containers:
# - messageRegex: '(?msi)tensorflow.*ResourceExhaustedError.*OOM.*'
# codeRange: {min: 1}
# nameRegex: '(?ms).*'
#- {More customized podFailureSpec, better to also include these in the default config}frameworkcontroller-with-customized-config.yaml:
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: frameworkcontroller
namespace: default
spec:
serviceName: frameworkcontroller
selector:
matchLabels:
app: frameworkcontroller
replicas: 1
template:
metadata:
labels:
app: frameworkcontroller
spec:
# Using the ServiceAccount with granted permission
# if the k8s cluster enforces authorization.
serviceAccountName: frameworkcontroller
containers:
- name: frameworkcontroller
image: frameworkcontroller/frameworkcontroller
# Using k8s inClusterConfig, so usually, no need to specify
# KUBE_APISERVER_ADDRESS or KUBECONFIG
#env:
#- name: KUBE_APISERVER_ADDRESS
# value: {http[s]://host:port}
#- name: KUBECONFIG
# value: {Pod Local KubeConfig File Path}
command: [
"bash", "-c",
"cp /frameworkcontroller-config/frameworkcontroller.yaml . &&
./start.sh"]
volumeMounts:
- name: frameworkcontroller-config
mountPath: /frameworkcontroller-config
volumes:
- name: frameworkcontroller-config
configMap:
name: frameworkcontroller-configIf you have an insecure ApiServer address (can be got from Insecure ApiServer or kubectl proxy) which does not enforce authentication, you only need to provide the address:
docker run -e KUBE_APISERVER_ADDRESS={http[s]://host:port} \
frameworkcontroller/frameworkcontrollerOtherwise, you need to provide your KubeConfig File which inlines or refers the ApiServer Credential Files with granted permission:
docker run -e KUBECONFIG=/mnt/.kube/config \
-v {Host Local KubeConfig File Path}:/mnt/.kube/config \
-v {Host Local ApiServer Credential File Path}:{Container Local ApiServer Credential File Path} \
frameworkcontroller/frameworkcontrollerFor example, if the k8s cluster is created by Minikube:
docker run -e KUBECONFIG=/mnt/.kube/config \
-v ${HOME}/.kube/config:/mnt/.kube/config \
-v ${HOME}/.minikube:${HOME}/.minikube \
frameworkcontroller/frameworkcontrollerEnsure you have installed Golang 1.12.6 or above and the ${GOPATH} is valid.
Then build the FrameworkController binary distribution:
export PROJECT_DIR=${GOPATH}/src/github.com/microsoft/frameworkcontroller
rm -rf ${PROJECT_DIR}
mkdir -p ${PROJECT_DIR}
git clone https://github.com/microsoft/frameworkcontroller.git ${PROJECT_DIR}
cd ${PROJECT_DIR}
./build/frameworkcontroller/go-build.shIf you have an insecure ApiServer address (can be got from Insecure ApiServer or kubectl proxy) which does not enforce authentication, you only need to provide the address:
KUBE_APISERVER_ADDRESS={http[s]://host:port} \
./dist/frameworkcontroller/start.shOtherwise, you need to provide your KubeConfig File which inlines or refers the ApiServer Credential Files with granted permission:
KUBECONFIG={Process Local KubeConfig File Path} \
./dist/frameworkcontroller/start.shFor example:
KUBECONFIG=${HOME}/.kube/config \
./dist/frameworkcontroller/start.shAnd in above example, ${HOME}/.kube/config is the default value of KUBECONFIG, so you can skip it:
./dist/frameworkcontroller/start.sh| Back | FazBrowse Home | New Git URL |