write apiserver file