Skip to content

Commit

Permalink
modify refresh/purge annotation key to kubefledged.io/xxx
Browse files Browse the repository at this point in the history
  • Loading branch information
senthilrch committed Jul 28, 2021
1 parent 5253364 commit ab7c2be
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 18 deletions.
19 changes: 3 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,26 +92,13 @@ These instructions install _kube-fledged_ to a separate namespace called "kube-f
$ kubectl create namespace ${KUBEFLEDGED_NAMESPACE}
```

- Create secret containing cert/key for kubefledged-webhook-server

```
$ curl -fsSL https://raw.githubusercontent.com/senthilrch/kube-fledged/master/deploy/webhook-create-signed-cert.sh | bash -s -- --namespace ${KUBEFLEDGED_NAMESPACE}
```

- Retrieve the certificate-authoity-data of the kubernetes cluster

```
$ CLUSTER=$(kubectl config view --raw --flatten -o json | jq -r '.contexts[] | select(.name == "'$(kubectl config current-context)'") | .context.cluster')
$ export CA_BUNDLE=$(kubectl config view --raw --flatten -o json | jq -r '.clusters[] | select(.name == "'${CLUSTER}'") | .cluster."certificate-authority-data"')
```

- Verify and install latest version of kube-fledged helm chart

```
$ helm repo add kubefledged-charts https://senthilrch.github.io/kubefledged-charts/
$ gpg --keyserver keyserver.ubuntu.com --recv-keys 92D793FA3A6460ED (or) gpg --keyserver pgp.mit.edu --recv-keys 92D793FA3A6460ED
$ gpg --export >~/.gnupg/pubring.gpg
$ helm install --verify kube-fledged kubefledged-charts/kube-fledged -n ${KUBEFLEDGED_NAMESPACE} --set validatingWebhookCABundle=${CA_BUNDLE} --wait
$ helm install --verify kube-fledged kubefledged-charts/kube-fledged -n ${KUBEFLEDGED_NAMESPACE} --wait
```

## Quick Install using Helm operator
Expand Down Expand Up @@ -257,15 +244,15 @@ $ kubectl get imagecaches imagecache1 -n kube-fledged -o json
_kube-fledged_ supports both automatic and on-demand refresh of image cache. Auto refresh is enabled using the flag `--image-cache-refresh-frequency:`. To request for an on-demand refresh, run the following command:-

```
$ kubectl annotate imagecaches imagecache1 -n kube-fledged kubefledged.k8s.io/refresh-imagecache=
$ kubectl annotate imagecaches imagecache1 -n kube-fledged kubefledged.io/refresh-imagecache=
```

### Delete image cache

Before you could delete the image cache, you need to purge the images in the cache using the following command. This will remove all cached images from the worker nodes.

```
$ kubectl annotate imagecaches imagecache1 -n kube-fledged kubefledged.k8s.io/purge-imagecache=
$ kubectl annotate imagecaches imagecache1 -n kube-fledged kubefledged.io/purge-imagecache=
```

View the status of purging the image cache. If any failures, such images should be removed manually or you could decide to leave the images in the worker nodes.
Expand Down
4 changes: 2 additions & 2 deletions cmd/controller/app/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ import (
)

const controllerAgentName = "kubefledged-controller"
const imageCachePurgeAnnotationKey = "kubefledged.k8s.io/purge-imagecache"
const imageCacheRefreshAnnotationKey = "kubefledged.k8s.io/refresh-imagecache"
const imageCachePurgeAnnotationKey = "kubefledged.io/purge-imagecache"
const imageCacheRefreshAnnotationKey = "kubefledged.io/refresh-imagecache"

const (
// SuccessSynced is used as part of the Event 'reason' when a ImageCache is synced
Expand Down

0 comments on commit ab7c2be

Please sign in to comment.