Skip to content

Instantly share code, notes, and snippets.

💭
I may be slow to respond.

Huamin Chen rootfs

💭
I may be slow to respond.
Block or report user

Report or block rootfs

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@rootfs
rootfs / kubernetes_add_service_account_kubeconfig.sh
Created Oct 2, 2019 — forked from innovia/kubernetes_add_service_account_kubeconfig.sh
Create a service account and generate a kubeconfig file for it - this will also set the default namespace for the user
View kubernetes_add_service_account_kubeconfig.sh
#!/bin/bash
set -e
set -o pipefail
# Add user to k8s using service account, no RBAC (must create RBAC after this script)
if [[ -z "$1" ]] || [[ -z "$2" ]]; then
echo "usage: $0 <service_account_name> <namespace>"
exit 1
fi
View build-out.md

First run

# kubectl -n default logs -c build-step-node-ftl steren-sample-function-v29fs-6s4bj
2018-06-22,14:40:57.207 INFO     Loading Docker credentials for repository 'launcher.gcr.io/google/nodejs:latest'
2018-06-22,14:40:57.207 INFO     Loading Docker credentials for repository 'gcr.io/openshift-gce-devel/kn/sample-fn:latest'
2018-06-22,14:41:27.238 INFO     builder initialization took 30 seconds
2018-06-22,14:41:27.239 INFO     full build took 30 seconds
Traceback (most recent call last):
  File "/app/ftl/node_builder_image.binary.runfiles/__main__/ftl/node/main.py", line 54, in <module>
    main(sys.argv[1:])
View install tensorflow on fedora 28.md

add python site

export PYTHONPATH=${PYTHONPATH}:/usr/lib64/python3.6

install cuda and nvdia driver

dnf config-manager --add-repo=http://negativo17.org/repos/fedora-nvidia.repo
# yum-config-manager --add-repo=http://negativo17.org/repos/epel-nvidia.repo
View azure-file-class.yaml
kind: StorageClass
apiVersion: storage.k8s.io/v1beta1
metadata:
name: slow
provisioner: kubernetes.io/azure-file
parameters:
skuName: Standard_LRS
location: eastus
secretnamespace: azure-file-ns
---
View azure-file-rbac.yaml
apiVersion: v1
kind: Namespace
metadata:
name: azure-file-ns
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: system:controller:persistent-volume-binder
namespace: azure-file-ns
View dev-ro.yaml
apiVersion: extensions/v1beta1
kind: DaemonSet
metadata:
labels:
app: rook-ds
name: rook-ds
namespace: rook-system
spec:
selector:
matchLabels:
View rook-dev.md
  1. Make changes locally
  2. Build (go and docker images)
  3. tests/scripts/minikube.sh up
  4. Go get a snack
  5. After the VM is up, kubernetes is ready now. Verify with a simple kubectl command from your host
  6. kubectl create -f rook-operator.yaml
  7. kubectl create -f rook-cluster.yaml
  8. go test -run -v SmokeSuite github.com/rook/rook/tests/integration/
View Dockerfile.containerized-kubelet
FROM centos:7
RUN yum install -y ebtables ethtool iptables ipset docker
ADD hyperkube /bin/hyperkube
ADD kubelet /bin/kubelet
View containerized-kubelet.sh
#!/bin/bash
docker run \
--volume=/:/rootfs:rw \
--volume=/var/run:/var/run:rw \
--volume=/sys:/sys:rw \
--volume=/sys/fs/cgroup:/sys/fs/cgroup:rw \
--volume=/var/lib/docker:/var/lib/docker:rw \
--volume=/var/lib/kubelet/:/var/lib/kubelet:rw \
--volume=/dev:/dev \
View iscsi-csi-pv.yaml
apiVersion: v1
kind: PersistentVolume
metadata:
name: csi-iscsi-pv
labels:
name: csi-iscsi-pv
spec:
accessModes:
- ReadWriteOnce
capacity:
You can’t perform that action at this time.