Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Customized pullPolicy for verifier, tenant, registrar and agent #64

Merged
merged 1 commit into from
Feb 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 16 additions & 16 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -231,22 +231,22 @@ helm-keylime-clean: ## Cleans the packaged keylime helm chart
.PHONY: helm-keylime-undeploy
helm-keylime-undeploy: ## Undeploy the keylime helm chart
{ \
helm list --namespace $(HELM_CHART_NAMESPACE) | grep -q $(HELM_CHART_RELEASE_NAME) &&\
helm uninstall $(HELM_CHART_RELEASE_NAME) --namespace $(HELM_CHART_NAMESPACE);\
kubectl get persistentvolumeclaim/data-$(HELM_CHART_RELEASE_NAME)-mysql-0 --namespace $(HELM_CHART_NAMESPACE) > /dev/null 2>&1 &&\
kubectl delete persistentvolumeclaim/data-$(HELM_CHART_RELEASE_NAME)-mysql-0 --namespace $(HELM_CHART_NAMESPACE);\
kubectl get secret/$(HELM_CHART_RELEASE_NAME)-keylime-ca-password --namespace $(HELM_CHART_NAMESPACE) > /dev/null 2>&1 &&\
kubectl delete secret/$(HELM_CHART_RELEASE_NAME)-keylime-ca-password --namespace $(HELM_CHART_NAMESPACE);\
kubectl get secret/$(HELM_CHART_RELEASE_NAME)-keylime-mysql-password --namespace $(HELM_CHART_NAMESPACE) > /dev/null 2>&1 &&\
kubectl delete secret/$(HELM_CHART_RELEASE_NAME)-keylime-mysql-password --namespace $(HELM_CHART_NAMESPACE);\
kubectl get secret/$(HELM_CHART_RELEASE_NAME)-keylime-certs --namespace $(HELM_CHART_NAMESPACE) > /dev/null 2>&1 &&\
kubectl delete secret/$(HELM_CHART_RELEASE_NAME)-keylime-certs --namespace $(HELM_CHART_NAMESPACE);\
kubectl get secret/$(HELM_CHART_RELEASE_NAME)-keylime-tpm-cert-store --namespace $(HELM_CHART_NAMESPACE) > /dev/null 2>&1 &&\
kubectl delete secret/$(HELM_CHART_RELEASE_NAME)-keylime-tpm-cert-store --namespace $(HELM_CHART_NAMESPACE);\
kubectl get secret/$(HELM_CHART_RELEASE_NAME)-keylime-tpm-extra-cert-store --namespace $(HELM_CHART_NAMESPACE) > /dev/null 2>&1 &&\
kubectl delete secret/$(HELM_CHART_RELEASE_NAME)-keylime-tpm-extra-cert-store --namespace $(HELM_CHART_NAMESPACE);\
kubectl get job/$(HELM_CHART_RELEASE_NAME)-keylime-init-ca --namespace $(HELM_CHART_NAMESPACE) > /dev/null 2>&1 &&\
kubectl delete job/$(HELM_CHART_RELEASE_NAME)-keylime-init-ca --namespace $(HELM_CHART_NAMESPACE);\
helm list --namespace $(HELM_CHART_NAMESPACE) --kubeconfig $(HELM_CHART_KUBECONFIG) | grep -q $(HELM_CHART_RELEASE_NAME) &&\
helm uninstall $(HELM_CHART_RELEASE_NAME) --namespace $(HELM_CHART_NAMESPACE) --kubeconfig $(HELM_CHART_KUBECONFIG);\
kubectl --kubeconfig $(HELM_CHART_KUBECONFIG) get persistentvolumeclaim/data-$(HELM_CHART_RELEASE_NAME)-mysql-0 --namespace $(HELM_CHART_NAMESPACE) > /dev/null 2>&1 &&\
kubectl --kubeconfig $(HELM_CHART_KUBECONFIG) delete persistentvolumeclaim/data-$(HELM_CHART_RELEASE_NAME)-mysql-0 --namespace $(HELM_CHART_NAMESPACE);\
kubectl --kubeconfig $(HELM_CHART_KUBECONFIG) get secret/$(HELM_CHART_RELEASE_NAME)-keylime-ca-password --namespace $(HELM_CHART_NAMESPACE) > /dev/null 2>&1 &&\
kubectl --kubeconfig $(HELM_CHART_KUBECONFIG) delete secret/$(HELM_CHART_RELEASE_NAME)-keylime-ca-password --namespace $(HELM_CHART_NAMESPACE);\
kubectl --kubeconfig $(HELM_CHART_KUBECONFIG) get secret/$(HELM_CHART_RELEASE_NAME)-keylime-mysql-password --namespace $(HELM_CHART_NAMESPACE) > /dev/null 2>&1 &&\
kubectl --kubeconfig $(HELM_CHART_KUBECONFIG) delete secret/$(HELM_CHART_RELEASE_NAME)-keylime-mysql-password --namespace $(HELM_CHART_NAMESPACE);\
kubectl --kubeconfig $(HELM_CHART_KUBECONFIG) get secret/$(HELM_CHART_RELEASE_NAME)-keylime-certs --namespace $(HELM_CHART_NAMESPACE) > /dev/null 2>&1 &&\
kubectl --kubeconfig $(HELM_CHART_KUBECONFIG) delete secret/$(HELM_CHART_RELEASE_NAME)-keylime-certs --namespace $(HELM_CHART_NAMESPACE);\
kubectl --kubeconfig $(HELM_CHART_KUBECONFIG) get secret/$(HELM_CHART_RELEASE_NAME)-keylime-tpm-cert-store --namespace $(HELM_CHART_NAMESPACE) > /dev/null 2>&1 &&\
kubectl --kubeconfig $(HELM_CHART_KUBECONFIG) delete secret/$(HELM_CHART_RELEASE_NAME)-keylime-tpm-cert-store --namespace $(HELM_CHART_NAMESPACE);\
kubectl --kubeconfig $(HELM_CHART_KUBECONFIG) get secret/$(HELM_CHART_RELEASE_NAME)-keylime-tpm-extra-cert-store --namespace $(HELM_CHART_NAMESPACE) > /dev/null 2>&1 &&\
kubectl --kubeconfig $(HELM_CHART_KUBECONFIG) delete secret/$(HELM_CHART_RELEASE_NAME)-keylime-tpm-extra-cert-store --namespace $(HELM_CHART_NAMESPACE);\
kubectl --kubeconfig $(HELM_CHART_KUBECONFIG) get job/$(HELM_CHART_RELEASE_NAME)-keylime-init-ca --namespace $(HELM_CHART_NAMESPACE) > /dev/null 2>&1 &&\
kubectl --kubeconfig $(HELM_CHART_KUBECONFIG) delete job/$(HELM_CHART_RELEASE_NAME)-keylime-init-ca --namespace $(HELM_CHART_NAMESPACE);\
rm -f $(MKFILE_DIR)/kt;\
}

Expand Down
11 changes: 11 additions & 0 deletions build/helm/keylime/charts/keylime-agent/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,17 @@ Define a custom init image tag.
{{- end }}
{{- end }}

{{/*
Define a custom image pullpolicy.
*/}}
{{- define "agent.image.pullPolicy" -}}
{{- if .Values.global.service.agent.image.pullPolicy }}
{{- toYaml .Values.global.service.agent.image.pullPolicy }}
{{- else }}
{{- toYaml .Values.image.pullPolicy }}
{{- end }}
{{- end }}

{{/*
Define a custom plugin image repository.
*/}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,6 @@ Will expand a whole 'storageClassName: <entry>' section, or nothing if the setti
{{- end }}
{{- end }}


{{/*
Define a custom image repository.
*/}}
Expand All @@ -179,3 +178,14 @@ Define a custom image tag.
{{- toYaml .Chart.AppVersion }}
{{- end }}
{{- end }}

{{/*
Define a custom image pullpolicy.
*/}}
{{- define "registrar.image.pullPolicy" -}}
{{- if .Values.global.service.registrar.image.pullPolicy }}
{{- toYaml .Values.global.service.registrar.image.pullPolicy }}
{{- else }}
{{- toYaml .Values.image.pullPolicy }}
{{- end }}
{{- end }}
11 changes: 11 additions & 0 deletions build/helm/keylime/charts/keylime-tenant/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -115,3 +115,14 @@ Define a custom image tag.
{{- toYaml .Chart.AppVersion }}
{{- end }}
{{- end }}

{{/*
Define a custom image pullpolicy.
*/}}
{{- define "tenant.image.pullPolicy" -}}
{{- if .Values.global.service.tenant.image.pullPolicy }}
{{- toYaml .Values.global.service.tenant.image.pullPolicy }}
{{- else }}
{{- toYaml .Values.image.pullPolicy }}
{{- end }}
{{- end }}
11 changes: 11 additions & 0 deletions build/helm/keylime/charts/keylime-verifier/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -167,3 +167,14 @@ Define a custom image tag.
{{- toYaml .Chart.AppVersion }}
{{- end }}
{{- end }}

{{/*
Define a custom image pullpolicy.
*/}}
{{- define "verifier.image.pullPolicy" -}}
{{- if .Values.global.service.verifier.image.pullPolicy }}
{{- toYaml .Values.global.service.verifier.image.pullPolicy }}
{{- else }}
{{- toYaml .Values.image.pullPolicy }}
{{- end }}
{{- end }}
1 change: 1 addition & 0 deletions build/helm/keylime/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -144,3 +144,4 @@ Always expands to the name of the secret used for the TPM cert store when the in
{{- define "keylime.tpmCertStore.extrasecret" -}}
{{- printf "%s-%s" .Release.Name "keylime-tpm-extra-cert-store" | trunc 63 | trimSuffix "-" }}
{{- end }}

8 changes: 8 additions & 0 deletions build/helm/keylime/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -161,11 +161,15 @@ global:
# Default image is the from quay, default tag is tag the chart appVersion
image:
repository: quay.io/keylime/keylime_tenant
# Default image pull policy
pullPolicy: IfNotPresent
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wondering whether "always" might not be a better default policy. Especially for people who like "latest" or do quick development.
But certainly having any default pull policy is better than none.

# registrar options
registrar:
# Default image is the from quay, default tag is tag the chart appVersion
image:
repository: quay.io/keylime/keylime_registrar
# Default image pull policy
pullPolicy: IfNotPresent
# number of replicas, with default 1. IMPORTANT: if "sqlite" database backend is selected, then this value will be ignored and 1 will be used instead
replicas: 1
# type of service, with "ClusterIP" as default. Switch to "NodePort" or "LoadBalancer" to allow
Expand All @@ -178,6 +182,8 @@ global:
# Default image is the from quay, default tag is tag the chart appVersion
image:
repository: quay.io/keylime/keylime_verifier
# Default image pull policy
pullPolicy: IfNotPresent
# number of replicas, with default 1. IMPORTANT: if "sqlite" database backend is selected, then this value will be ignored and 1 will be used instead
replicas: 1
# type of service, with "ClusterIP" as default. Switch to "NodePort" or "LoadBalancer" to allow
Expand All @@ -190,6 +196,8 @@ global:
repository: quay.io/keylime/keylime_tenant
image:
repository: quay.io/keylime/keylime_agent
# Default image pull policy
pullPolicy: IfNotPresent
# the device plugin image is used when deploying unprivileged agents
pluginImage:
repository: ghcr.io/keylime/k8s-tpm-device-plugin
Expand Down
Loading