Skip to content

Commit

Permalink
Merge pull request #281 from kubescape/remove-cloud-provider
Browse files Browse the repository at this point in the history
remove cloud_provider
  • Loading branch information
David Wertenteil authored Sep 10, 2023
2 parents 01d88d5 + 96337a9 commit c24c023
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 29 deletions.
4 changes: 2 additions & 2 deletions charts/kubescape-operator/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ type: application
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)

version: 1.15.2
version: 1.15.3

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.

appVersion: 1.15.2
appVersion: 1.15.3

maintainers:
- name: Ben Hirschberg
Expand Down
12 changes: 0 additions & 12 deletions charts/kubescape-operator/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -1,15 +1,3 @@
{{/* standardize cloud provider */}}
{{- define "cloud_provider" -}}
{{- if contains "eks" .Capabilities.KubeVersion.GitVersion -}}
{{- print "eks" -}}
{{- else if contains "gke" .Capabilities.KubeVersion.GitVersion -}}
{{- print "gke" -}}
{{- else if contains "azmk8s.io" .Values.clusterServer -}}
{{- print "aks" -}}
{{- else -}}
{{- print "" -}}
{{- end }}
{{- end }}

{{- define "configurations" -}}
{{- $otel := not (empty .Values.configurations.otelUrl) -}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,8 @@ data:
"maxImageSize": {{ .Values.kubevuln.config.maxImageSize }},
"keepLocal": {{ not $components.serviceDiscovery.enabled }},
"scanTimeout": "{{ .Values.kubevuln.config.scanTimeout }}",
"relevantImageVulnerabilitiesConfiguration": "{{ .Values.capabilities.relevancy }}",
{{- if .Values.grypeOfflineDB.enabled }}
"listingURL": "http://{{ .Values.grypeOfflineDB.name }}:80/listing.json",
{{- end }}
"clusterProvider": "{{ include "cloud_provider" . }}"
"relevantImageVulnerabilitiesConfiguration": "{{ .Values.capabilities.relevancy }}"
}
17 changes: 7 additions & 10 deletions charts/kubescape-operator/templates/kubescape/deployment.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{{- $components := fromYaml (include "components" .) }}
{{- if $components.kubescape.enabled }}
{{- $configurations := fromYaml (include "configurations" .) }}
{{- $cloud_provider := (include "cloud_provider" .) -}}
{{- $no_proxy_envar_list := (include "no_proxy_envar_list" .) -}}
apiVersion: apps/v1
kind: Deployment
Expand Down Expand Up @@ -108,24 +107,22 @@ spec:
value: "/home/nonroot/.kubescape/host-scanner.yaml"
- name: LARGE_CLUSTER_SIZE
value: "1500"
{{- if $cloud_provider }}
- name: KS_CLOUD_PROVIDER
value: "{{ $cloud_provider }}"
{{- if .Values.cloudProviderMetadata.cloudRegion }}
- name: KS_CLOUD_REGION
value: "{{ .Values.cloudProviderMetadata.cloudRegion }}"
- name: KS_KUBE_CLUSTER
value: "{{ .Values.clusterName }}"
{{- if eq "gke" $cloud_provider }}
{{- end }}
{{- if .Values.cloudProviderMetadata.gkeProject }}
- name: KS_GKE_PROJECT
value: "{{ .Values.cloudProviderMetadata.gkeProject }}"
{{- end -}}
{{- if eq "aks" $cloud_provider }}
{{- end }}
{{- if .Values.cloudProviderMetadata.aksSubscriptionID }}
- name: AZURE_SUBSCRIPTION_ID
value: "{{ .Values.cloudProviderMetadata.aksSubscriptionID }}"
{{- end }}
{{- if .Values.cloudProviderMetadata.aksResourceGroup }}
- name: AZURE_RESOURCE_GROUP
value: "{{ .Values.cloudProviderMetadata.aksResourceGroup }}"
{{- end }}
{{- end }}
{{- if $components.otelCollector.enabled }}
- name: ACCOUNT_ID
value: "{{ .Values.account }}"
Expand Down
4 changes: 1 addition & 3 deletions charts/kubescape-operator/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,7 @@ server: api.armosec.io
# Customer Specific Data
# account is deliberately not defined here and it should be defined by the user
# --set clusterName=`kubectl config current-context`
clusterName: # cluster name must be defined by the user
# --set clusterServer=`kubectl config view -o jsonpath="{.clusters[?(@.name=='$(kubectl config current-context)')].cluster.server}"`
clusterServer: ""
clusterName: # cluster name must be defined by the user

# -- set the image pull secrets for private registry support
imagePullSecrets: ""
Expand Down

0 comments on commit c24c023

Please sign in to comment.