Skip to content

Commit

Permalink
cri-client-image name as env instead of cmd flag
Browse files Browse the repository at this point in the history
  • Loading branch information
senthilrch committed Jul 29, 2021
1 parent ab7c2be commit c398134
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
4 changes: 0 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ These instructions install _kube-fledged_ to a separate namespace called "kube-f

```
$ kubectl get pods -n kube-fledged -l app=kubefledged
$ kubectl logs -f <pod_name_obtained_from_above_command> -n kube-fledged
$ kubectl get imagecaches -n kube-fledged (Output should be: 'No resources found')
```

Expand Down Expand Up @@ -123,7 +122,6 @@ These instructions install _kube-fledged_ to a separate namespace called "kube-f

```
$ kubectl get pods -n kube-fledged -l app.kubernetes.io/name=kube-fledged
$ kubectl logs -f <pod_name_obtained_from_above_command> -n kube-fledged
$ kubectl get imagecaches -n kube-fledged (Output should be: 'No resources found')
```

Expand Down Expand Up @@ -291,8 +289,6 @@ For more detailed description, go through _kube-fledged's_ [design proposal](doc

`--image-cache-refresh-frequency:` The image cache is refreshed periodically to ensure the cache is up to date. Setting this flag to "0s" will disable refresh. default "15m"

`--cri-client-image:` The image name of the cri client. The cri client is used when deleting images during purging the cache".

`--image-pull-policy:` Image pull policy for pulling images into and refreshing the cache. Possible values are 'IfNotPresent' and 'Always'. Default value is 'IfNotPresent'. Image with no or ":latest" tag are always pulled.

`--stderrthreshold:` Log level. set the value of this flag to INFO
Expand Down
4 changes: 3 additions & 1 deletion cmd/controller/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,11 @@ func main() {
func init() {
flag.DurationVar(&imagePullDeadlineDuration, "image-pull-deadline-duration", time.Minute*5, "Maximum duration allowed for pulling an image. After this duration, image pull is considered to have failed")
flag.DurationVar(&imageCacheRefreshFrequency, "image-cache-refresh-frequency", time.Minute*15, "The image cache is refreshed periodically to ensure the cache is up to date. Setting this flag to 0s will disable refresh")
flag.StringVar(&dockerClientImage, "cri-client-image", "senthilrch/kubefledged-cri-client:latest", "The image name of the cri client. the cri client is used when deleting images during purging the cache")
flag.StringVar(&imagePullPolicy, "image-pull-policy", "IfNotPresent", "Image pull policy for pulling images into the cache. Possible values are 'IfNotPresent' and 'Always'. Default value is 'IfNotPresent'. Images with no or ':latest' tag are always pulled")
if fledgedNameSpace = os.Getenv("KUBEFLEDGED_NAMESPACE"); fledgedNameSpace == "" {
fledgedNameSpace = "kube-fledged"
}
if dockerClientImage = os.Getenv("KUBEFLEDGED_CRI_CLIENT_IMAGE"); dockerClientImage == "" {
dockerClientImage = "senthilrch/kubefledged-cri-client:latest"
}
}
3 changes: 2 additions & 1 deletion deploy/kubefledged-deployment-controller.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ spec:
- "--stderrthreshold=INFO"
- "--image-pull-deadline-duration=5m"
- "--image-cache-refresh-frequency=15m"
- "--cri-client-image=senthilrch/kubefledged-cri-client:v0.8.1"
- "--image-pull-policy=IfNotPresent"
imagePullPolicy: Always
name: controller
Expand All @@ -46,4 +45,6 @@ spec:
valueFrom:
fieldRef:
fieldPath: metadata.namespace
- name: KUBEFLEDGED_CRI_CLIENT_IMAGE
value: "senthilrch/kubefledged-cri-client:v0.8.1"
serviceAccountName: kubefledged-controller
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,15 @@ spec:
- "--stderrthreshold={{ .Values.args.controllerLogLevel }}"
- "--image-pull-deadline-duration={{ .Values.args.controllerImagePullDeadlineDuration }}"
- "--image-cache-refresh-frequency={{ .Values.args.controllerImageCacheRefreshFrequency }}"
- "--cri-client-image={{ .Values.image.kubefledgedCRIClientRepository }}:{{ .Chart.AppVersion }}"
- "--image-pull-policy={{ .Values.args.controllerImagePullPolicy }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
env:
- name: KUBEFLEDGED_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
- name: KUBEFLEDGED_CRI_CLIENT_IMAGE
value: {{ .Values.image.kubefledgedCRIClientRepository }}:{{ .Chart.AppVersion }}
resources:
{{- toYaml .Values.resources | nindent 12 }}
{{- with .Values.nodeSelector }}
Expand Down

0 comments on commit c398134

Please sign in to comment.