Question: I'm using macosx/Sierra, and I want to get write permissions in the `/System/Library/CoreServices` folder. I set myself to root via `sudo`, and all the directories in the tree have `drwxr-xr-x` permissions, but I still can't write in that directory.

```
% sudo -s
# cd /System/Library/CoreServices
# pwd
/System/Library/CoreServices
# whoami
root
# ls -ld .
0 drwxr-xr-x  160 root  wheel  5440 Feb 14 10:00 ./
# touch x
touch: x: Operation not permitted

```

Is there any way I can enable write access on this directory as `root`?

Thank you in advance.

Answer: 
One line command to create a Docker registry secret

```
kubectl create secret docker-registry regcred --docker-username=<your-name> --docker-password=<your-pword> --docker-email=<your-email> -n <your-namespace>

```

Then you can use it in your deployment file under *spec*

```
spec:
  containers:
  - name: private-reg-container-name
    image: <your-private-image>
  imagePullSecrets:
  - name: regcred

```

More details:
<https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/#create-a-secret-in-the-cluster-that-holds-your-authorization-token>
using `docker pull` or `kubectl set image`

example yaml deployment

```
apiVersion: apps/v1
kind: Deployment
metadata:
  name: nginx-deployment
  labels:
    app: nginx
spec:
  replicas: 3
  selector:
    matchLabels:
      app: nginx
  template:
    metadata:
      labels:
        app: nginx
    spec:
      containers:
      - name: nginx
        image: nginx:1.14.2
        ports:
        - containerPort: 80

```

start container and show status deployment with `kubectl get deployments`

result

```
 NAME               READY   UP-TO-DATE   AVAILABLE   AGE
nginx-deployment   3/3     3            3           18s

```

and now update image in kubernetes using `set image`

```
kubectl set image deployment/nginx-deployment nginx=nginx:1.16.1

```

and show status update image with `rollout`

```
kubectl rollout status deployment/nginx-deployment

```

Note: `ngnix` is name of `container ->name`

```
  containers:
      - name: nginx
        image: nginx:1.14.2

```

`nginx:1.16.1` is image version in docker hub, is recommendable change version for update

if you decided remove update and rollback to the previous revision, use `rollout undo`

```
kubectl rollout undo deployment/nginx-deployment

```

for more information, use the [documentation](https://kubernetes.io/docs/concepts/workloads/controllers/deployment/#updating-a-deployment)