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

[k8s-extension] Release v1.0.4 with SSL secret support for AzureML #4286

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
181 commits
Select commit Hold shift + click to select a range
828f9d3
Create pull.yml
jonathan-innis Mar 10, 2021
1436bfc
Update pull.yml
jonathan-innis Mar 10, 2021
6cffd96
Update azure-pipelines.yml
jonathan-innis Mar 10, 2021
db0f4bd
Initial commit of k8s-extension
jonathan-innis Mar 10, 2021
3e2ea64
Update pipelines file
jonathan-innis Mar 10, 2021
9bbc0e4
Update CODEOWNERS
jonathan-innis Mar 10, 2021
8d46cbc
Update private preview pipelines
jonathan-innis Mar 11, 2021
6c3ba41
Remove open service mesh from public release
jonathan-innis Mar 11, 2021
a98e996
Merge pull request #6 from Azure/master
jonathan-innis Mar 11, 2021
43c6796
Update pipeline files
jonathan-innis Mar 11, 2021
009a83e
Update public extension pipeline
jonathan-innis Mar 12, 2021
8e058c5
Change condition variable
jonathan-innis Mar 12, 2021
dea40c1
Add version to public preview/private preview
jonathan-innis Mar 12, 2021
69269e0
Merge branch 'master' of https://github.com/Azure/azure-cli-extension…
jonathan-innis Mar 12, 2021
e81e010
Update pipelines
jonathan-innis Mar 12, 2021
9621a48
Add different testing based on private branch
jonathan-innis Mar 12, 2021
862a035
Add annotations to extension model
jonathan-innis Mar 12, 2021
e1c3d12
Update k8s-custom-pipelines.yml
jonathan-innis Mar 15, 2021
3e309bf
Update SDKs with Updated Swagger Spec for 2020-07-01-preview (#13)
jonathan-innis Mar 16, 2021
1df2ef5
remove py2 bdist support
jonathan-innis Mar 16, 2021
054a903
Add custom table formatting
jonathan-innis Mar 16, 2021
b298252
Remove unnecessary files
jonathan-innis Mar 16, 2021
afb4046
Fix style issues
jonathan-innis Mar 16, 2021
49b7eac
Merge branch 'master' of https://github.com/Azure/azure-cli-extension…
Mar 17, 2021
a13304d
Merge branch 'master' of https://github.com/Azure/azure-cli-extension…
Mar 17, 2021
aa078b0
Merge branch 'release' into k8s-extension/public
jonathan-innis Mar 17, 2021
21dff06
Fix branch based on comments
jonathan-innis Mar 17, 2021
93919f2
Update identity piece manually
jonathan-innis Mar 17, 2021
a88127a
Merge branch 'k8s-extension/public' of github.com:AzureArcForKubernet…
jonathan-innis Mar 17, 2021
7e40b3a
Don't handle defaults at the CLI level
jonathan-innis Mar 17, 2021
483202c
Merge branch 'master' of https://github.com/Azure/azure-cli-extension…
Mar 17, 2021
d1befa8
Remove defaults from CLI client
jonathan-innis Mar 17, 2021
c7bd93f
Merge branch 'release' into k8s-extension/public
jonathan-innis Mar 17, 2021
076827c
Check null target namespace with namespace scope
jonathan-innis Mar 17, 2021
550eea1
Update style
jonathan-innis Mar 17, 2021
1a17f1b
Merge branch 'k8s-extension/public' of github.com:AzureArcForKubernet…
jonathan-innis Mar 17, 2021
fbab3be
Add cassandra operator and location to model
jonathan-innis Mar 17, 2021
9aade9f
Stage Public Version of k8s-extension 0.2.0 for official release (#15)
jonathan-innis Mar 18, 2021
7f79cfb
Remove custom pipelines file
jonathan-innis Mar 18, 2021
1337996
Merge branch 'release' of https://github.com/AzureArcForKubernetes/az…
Mar 19, 2021
f6e68e9
Merge branch 'master' of https://github.com/Azure/azure-cli-extension…
Mar 20, 2021
f57af40
Merge branch 'release' of https://github.com/AzureArcForKubernetes/az…
Mar 20, 2021
e75f329
Merge branch 'master' of https://github.com/Azure/azure-cli-extension…
Mar 23, 2021
a47b63a
Merge branch 'release' of https://github.com/AzureArcForKubernetes/az…
Mar 23, 2021
6c4e0e6
Merge branch 'master' of https://github.com/Azure/azure-cli-extension…
Mar 24, 2021
bb88024
Merge branch 'release' of https://github.com/AzureArcForKubernetes/az…
Mar 24, 2021
9f06b49
Update extension description, remove private const
jonathan-innis Mar 24, 2021
a063594
Merge branch 'release' into k8s-extension/public
jonathan-innis Mar 24, 2021
eb4c58b
Update pipeline file
jonathan-innis Mar 24, 2021
20d809c
Merge branch 'master' of https://github.com/Azure/azure-cli-extension…
Mar 25, 2021
9524cda
Merge branch 'release' of https://github.com/AzureArcForKubernetes/az…
Mar 25, 2021
16489b8
Merge branch 'master' of https://github.com/Azure/azure-cli-extension…
Mar 26, 2021
ee395f2
Merge branch 'release' of https://github.com/AzureArcForKubernetes/az…
Mar 26, 2021
fbd331c
Merge branch 'master' of https://github.com/Azure/azure-cli-extension…
Mar 27, 2021
9c86220
Merge branch 'release' of https://github.com/AzureArcForKubernetes/az…
Mar 27, 2021
89828c5
Merge branch 'master' of https://github.com/Azure/azure-cli-extension…
Mar 31, 2021
bed066c
Merge branch 'release' of https://github.com/AzureArcForKubernetes/az…
Mar 31, 2021
8011213
Merge branch 'master' of https://github.com/Azure/azure-cli-extension…
Apr 1, 2021
491c1e5
Merge branch 'release' of https://github.com/AzureArcForKubernetes/az…
Apr 1, 2021
cfd267d
Merge branch 'master' of https://github.com/Azure/azure-cli-extension…
Apr 2, 2021
b9d1778
Merge branch 'release' of https://github.com/AzureArcForKubernetes/az…
Apr 2, 2021
3290f6e
Disable refs docs
jonathan-innis Apr 2, 2021
22c8e92
Update to include better create warning logs and remove update contex…
jonathan-innis Apr 2, 2021
12212f1
Merge branch 'master' of https://github.com/Azure/azure-cli-extension…
Apr 3, 2021
010e9a8
Merge branch 'release' of https://github.com/AzureArcForKubernetes/az…
Apr 3, 2021
6bbf418
Merge branch 'master' of https://github.com/Azure/azure-cli-extension…
Apr 11, 2021
df82dd8
Fix k8s-extension conflict with private version
jonathan-innis Apr 14, 2021
0228851
Fix style errors
jonathan-innis Apr 14, 2021
db4c5b2
Fix filename
jonathan-innis Apr 14, 2021
2971d69
Merge branch 'master' of https://github.com/Azure/azure-cli-extension…
Apr 18, 2021
5077192
add customization for microsoft.azureml.kubernetes (#23)
yuyue9284 Apr 23, 2021
dc0c178
Merge branch 'master' of https://github.com/Azure/azure-cli-extension…
Apr 25, 2021
3d15151
Add E2E Testing from Separate branch into internal code (#26)
jonathan-innis Apr 26, 2021
1ded405
Inference CLI validation for Scoring FE (#24)
liakaz Apr 27, 2021
53303d5
legal warning added (#27)
liakaz Apr 27, 2021
3370264
Remove deprecated method logger.warn
jonathan-innis Apr 27, 2021
4c66aef
Update k8s-custom-pipelines.yml for Azure Pipelines
jonathan-innis Apr 27, 2021
e8651f2
Update k8s-custom-pipelines.yml for Azure Pipelines
jonathan-innis Apr 27, 2021
9de1e4e
Add Azure Defender to E2E testing (#28)
jonathan-innis Apr 28, 2021
9c0317d
Add configuration testing
jonathan-innis Apr 28, 2021
4c21482
Fix pipeline failures
jonathan-innis Apr 28, 2021
3e2fb15
Make test script more intuitive
jonathan-innis Apr 29, 2021
4dca64d
Remove parameter from testing
jonathan-innis Apr 29, 2021
c93e958
Fix wrong location for k8s config whl
jonathan-innis Apr 29, 2021
27e9b4a
Merge branch 'master' of https://github.com/Azure/azure-cli-extension…
jonathan-innis May 3, 2021
cb30f9d
Merge branch 'master' of https://github.com/Azure/azure-cli-extension…
May 3, 2021
7276f4a
Merge branch 'k8s-extension/public' of github.com:AzureArcForKubernet…
jonathan-innis May 6, 2021
3dafc08
Fix pip upgrade issue
jonathan-innis May 6, 2021
c5bd1c2
Fix pip install upgrade issue
jonathan-innis May 6, 2021
d9e8760
Fix pip install issue
jonathan-innis May 6, 2021
9709504
delete resurce in testcase (#29)
yuyue9284 May 7, 2021
3f620a8
Check Provider is Registered with Subscription Before Making Requests…
jonathan-innis May 7, 2021
cf95612
only validate scoring fe when inference is enabled (#31)
yuyue9284 May 11, 2021
fea6e00
Provider registration case insensitive
jonathan-innis May 11, 2021
877868c
do not validate against scoring fe if inference is not enabled. (#33)
yuyue9284 May 13, 2021
7ea157b
Merge branch 'master' of https://github.com/Azure/azure-cli-extension…
jonathan-innis May 13, 2021
a50ade7
Merge branch 'k8s-extension/public' of github.com:AzureArcForKubernet…
jonathan-innis May 13, 2021
9b1bedd
Add OSM as Public Preview Extension (#34)
jonathan-innis May 13, 2021
257dbf3
Fix release train check in update
jonathan-innis May 14, 2021
a203575
Parallelize E2E Testing (#36)
jonathan-innis May 14, 2021
8d65189
Fix azureml deletion
jonathan-innis May 14, 2021
ec14c6d
Merge branch 'k8s-extension/public' of github.com:AzureArcForKubernet…
jonathan-innis May 14, 2021
918bc02
Fix private build (#40)
jonathan-innis May 21, 2021
8b2490d
change amlk8s to amlarc (#42)
yuyue9284 May 25, 2021
724acde
Merge branch 'master' of https://github.com/Azure/azure-cli-extension…
jonathan-innis May 27, 2021
9100ff5
Servicebus client model changes (#44)
jonathan-innis May 27, 2021
6955567
Read SSL cert and key from files (#38)
liakaz Jun 2, 2021
a46235b
Upgrade release version
jonathan-innis Jun 2, 2021
b0f25af
Merge branch 'master' of https://github.com/Azure/azure-cli-extension…
jonathan-innis Jun 2, 2021
2889d53
Liakaz/inference read ssl from file (#47)
liakaz Jun 3, 2021
67babd8
Fix style issues (#51)
jonathan-innis Jun 4, 2021
590e642
Fixed scoring fe related extension param names (#49)
liakaz Jun 8, 2021
fc661a8
Add distro validation for osm-arc (#50)
nshankar13 Jun 11, 2021
eb466aa
Add distro validation for osm-arc (#50)
nshankar13 Jun 11, 2021
b9b932a
Merge branch 'k8s-extension/public' of github.com:AzureArcForKubernet…
jonathan-innis Jun 11, 2021
b0af598
Add distro validation for osm-arc (#53)
nshankar13 Jun 15, 2021
c355ad5
Add Custom Delete Logic for Partners (#54)
jonathan-innis Jun 22, 2021
cda5e41
Add warning message when deleting amlarc extension (#55)
jingyizhu99 Jun 23, 2021
c423e54
Update release version
jonathan-innis Jun 24, 2021
0080c80
Merge branch 'main' of https://github.com/Azure/azure-cli-extensions …
jonathan-innis Jun 24, 2021
58b4df8
Remove Pyhelm from OSM customization (#58)
jonathan-innis Jul 9, 2021
0b56023
Merge branch 'main' of https://github.com/Azure/azure-cli-extensions …
jonathan-innis Jul 9, 2021
7712f52
Update release message
jonathan-innis Jul 9, 2021
4ca94bd
Remove pyhelm dependency
jonathan-innis Jul 9, 2021
de426d4
Merge branch 'main' of https://github.com/Azure/azure-cli-extensions …
jonathan-innis Jul 9, 2021
0336667
Merge branch 'main' of https://github.com/Azure/azure-cli-extensions …
jonathan-innis Jul 9, 2021
5bfabdb
Merge branch 'main' of https://github.com/Azure/azure-cli-extensions …
jonathan-innis Jul 9, 2021
a5ef607
Update tests to only check extensionconfig creation (#61)
jonathan-innis Jul 9, 2021
79bb7b2
Merge branch 'main' of https://github.com/Azure/azure-cli-extensions …
jonathan-innis Jul 19, 2021
fb8682a
Merge branch 'k8s-extension/public' of github.com:AzureArcForKubernet…
jonathan-innis Jul 19, 2021
d8528be
Increase open service mesh version number
jonathan-innis Jul 19, 2021
64ac05a
Update k8s-extension Models to Track2 (#64)
jonathan-innis Jul 20, 2021
a862b09
Merge branch 'main' of https://github.com/Azure/azure-cli-extensions …
jonathan-innis Jul 20, 2021
bf15d99
Fix identity in wrong place in model (#66)
jonathan-innis Jul 23, 2021
65edba6
Merge branch 'main' of https://github.com/Azure/azure-cli-extensions …
jonathan-innis Jul 23, 2021
bc48fdb
Readd osm-arc distro validation (#62)
nshankar13 Jul 27, 2021
ec40c30
Merge branch 'Azure:main' into k8s-extension/public
jonathan-innis Jul 27, 2021
611b81f
Don't Send Identity Headers If In DF (#67)
jonathan-innis Jul 27, 2021
a0431a6
Use default extension with identity instead of Cassandra specific (#69)
jonathan-innis Jul 28, 2021
6c271d5
Merge branch 'Azure:main' into k8s-extension/public
jonathan-innis Jul 28, 2021
a2a4050
Remove the identity check for now
jonathan-innis Jul 28, 2021
52d3fad
Merge branch 'main' of https://github.com/Azure/azure-cli-extensions …
jonathan-innis Aug 11, 2021
30b407c
Add -t for clusterType parameter (#71)
jonathan-innis Aug 11, 2021
ac02d5a
Adding a flag for AKS to AMLARC migration and set up corresponding FE…
tianchijushi Aug 12, 2021
3a293ed
remove version requirement and auto upgrade minor version check (#72)
trstringer Aug 24, 2021
7deb020
Custom User Confirmation for Partners (#70)
jonathan-innis Aug 24, 2021
dd991f0
Code cleanup and style fixes (#73)
jonathan-innis Aug 27, 2021
01deb1e
Enabled identity by default (#74)
jonathan-innis Aug 27, 2021
8f9386c
Increase version
jonathan-innis Aug 30, 2021
03a376e
Merge branch 'main' of https://github.com/Azure/azure-cli-extensions …
jonathan-innis Aug 30, 2021
e51eb49
Fix df check and add unit test (#77)
jonathan-innis Sep 13, 2021
aa1093a
Merge branch 'main' of https://github.com/Azure/azure-cli-extensions …
jonathan-innis Sep 13, 2021
a69aaa5
Bump extension version
jonathan-innis Sep 13, 2021
1e0c547
Pin helm version
jonathan-innis Sep 20, 2021
f721c84
Merge branch 'Azure:main' into k8s-extension/public
jonathan-innis Oct 14, 2021
bd56e41
Extensions GA changes into Public Branch (#79)
NarayanThiru Oct 19, 2021
544af52
Fix configuration settings in update
jonathan-innis Oct 20, 2021
338895b
Only provide confirmation when specifying settings
jonathan-innis Oct 20, 2021
a54aca2
Fix style issues
jonathan-innis Oct 20, 2021
9f06921
Merge branch 'main' of https://github.com/Azure/azure-cli-extensions …
jonathan-innis Oct 22, 2021
b4b0b0e
Cassandra tests with update (#81)
jonathan-innis Oct 26, 2021
d545111
Add Microsoft.PolicyInsights extension for public preview (#83)
nreisch Oct 27, 2021
ef59f15
Yuyu3/fix upgrade public (#85)
yuyue9284 Nov 9, 2021
b2eaf5e
Remove Parallel Powershell Jobs (#82)
jonathan-innis Nov 9, 2021
5f6aea5
Remove policy update test from extension E2E (#88)
jonathan-innis Nov 9, 2021
02672fa
feIsNodePort, feIsInternalLoadBalancer (#87)
yuyue9284 Nov 10, 2021
42e24b3
Fix history file
jonathan-innis Dec 1, 2021
b0cc9fd
Merge branch 'main' of https://github.com/Azure/azure-cli-extensions …
jonathan-innis Dec 1, 2021
ba2ebb5
Add one more prompt for amlarc extension update (#94)
youhuatuyh Dec 7, 2021
0f3c9d1
Update Identity Creation for Appliance to Latest Version (#95)
jonathan-innis Dec 8, 2021
53c9205
Bump version
jonathan-innis Dec 8, 2021
82a77c4
Merge branch 'main' of https://github.com/Azure/azure-cli-extensions …
jonathan-innis Dec 8, 2021
00e540c
Remove additional entry from history
jonathan-innis Dec 8, 2021
2ebd9c4
Do not create identity with appliances (#97)
jonathan-innis Dec 13, 2021
9ae1c03
Bump version
jonathan-innis Dec 13, 2021
7e5446b
Merge branch 'k8s-extension/public' of github.com:AzureArcForKubernet…
jonathan-innis Dec 13, 2021
e20b786
Merge branch 'main' of https://github.com/Azure/azure-cli-extensions …
jonathan-innis Dec 13, 2021
e781aeb
support sslSecret (#99)
mjaow Dec 27, 2021
d4b4051
Merge branch 'main' of https://github.com/Azure/azure-cli-extensions …
jonathan-innis Jan 3, 2022
2383b75
Bump version to 1.0.4
jonathan-innis Jan 3, 2022
bdce4ef
Remove unneeded files
jonathan-innis Jan 3, 2022
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
4 changes: 4 additions & 0 deletions src/k8s-extension/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
Release History
===============

1.0.4
++++++++++++++++++
* microsoft.azureml.kubernetes: Support SSL secret

1.0.3
++++++++++++++++++
* Remove identity creation for calls to Microsoft.ResourceConnector
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ def __init__(self):
self.privateEndpointILB = 'privateEndpointILB'
self.privateEndpointNodeport = 'privateEndpointNodeport'
self.inferenceLoadBalancerHA = 'inferenceLoadBalancerHA'
self.SSL_SECRET = 'sslSecret'

# constants for existing AKS to AMLARC migration
self.IS_AKS_MIGRATION = 'isAKSMigration'
Expand Down Expand Up @@ -108,7 +109,7 @@ def Create(self, cmd, client, resource_group_name, cluster_name, name, cluster_t
ext_scope = Scope(cluster=scope_cluster, namespace=None)

# validate the config
self.__validate_config(configuration_settings, configuration_protected_settings)
self.__validate_config(configuration_settings, configuration_protected_settings, release_namespace)

# get the arc's location
subscription_id = get_subscription_id(cmd.cli_ctx)
Expand Down Expand Up @@ -285,7 +286,7 @@ def Update(self, cmd, resource_group_name, cluster_name, auto_upgrade_minor_vers
if self.sslKeyPemFile in configuration_protected_settings and \
self.sslCertPemFile in configuration_protected_settings:
logger.info(f"Both {self.sslKeyPemFile} and {self.sslCertPemFile} are set, update ssl key.")
self.__set_inference_ssl_from_file(configuration_protected_settings)
self.__set_inference_ssl_from_file(configuration_protected_settings, self.sslCertPemFile, self.sslKeyPemFile)

return PatchExtension(auto_upgrade_minor_version=auto_upgrade_minor_version,
release_train=release_train,
Expand Down Expand Up @@ -318,7 +319,7 @@ def __normalize_config(self, configuration_settings, configuration_protected_set
logger.warning(
'Internal load balancer only supported on AKS and AKS Engine Clusters.')

def __validate_config(self, configuration_settings, configuration_protected_settings):
def __validate_config(self, configuration_settings, configuration_protected_settings, release_namespace):
# perform basic validation of the input config
config_keys = configuration_settings.keys()
config_protected_keys = configuration_protected_settings.keys()
Expand All @@ -339,12 +340,12 @@ def __validate_config(self, configuration_settings, configuration_protected_sett

if enable_inference:
logger.warning("The installed AzureML extension for AML inference is experimental and not covered by customer support. Please use with discretion.")
self.__validate_scoring_fe_settings(configuration_settings, configuration_protected_settings)
self.__validate_scoring_fe_settings(configuration_settings, configuration_protected_settings, release_namespace)
self.__set_up_inference_ssl(configuration_settings, configuration_protected_settings)
elif not (enable_training or enable_inference):
raise InvalidArgumentValueError(
"Please create Microsoft.AzureML.Kubernetes extension, either "
"for Machine Learning training or inference by specifying "
"To create Microsoft.AzureML.Kubernetes extension, either "
"enable Machine Learning training or inference by specifying "
f"'--configuration-settings {self.ENABLE_TRAINING}=true' or '--configuration-settings {self.ENABLE_INFERENCE}=true'")

configuration_settings[self.ENABLE_TRAINING] = configuration_settings.get(self.ENABLE_TRAINING, enable_training)
Expand All @@ -353,7 +354,7 @@ def __validate_config(self, configuration_settings, configuration_protected_sett
configuration_protected_settings.pop(self.ENABLE_TRAINING, None)
configuration_protected_settings.pop(self.ENABLE_INFERENCE, None)

def __validate_scoring_fe_settings(self, configuration_settings, configuration_protected_settings):
def __validate_scoring_fe_settings(self, configuration_settings, configuration_protected_settings, release_namespace):
isTestCluster = _get_value_from_config_protected_config(
self.inferenceLoadBalancerHA, configuration_settings, configuration_protected_settings)
isTestCluster = str(isTestCluster).lower() == 'false'
Expand All @@ -367,16 +368,20 @@ def __validate_scoring_fe_settings(self, configuration_settings, configuration_p
if isAKSMigration:
configuration_settings['scoringFe.namespace'] = "default"
configuration_settings[self.IS_AKS_MIGRATION] = "true"
sslSecret = _get_value_from_config_protected_config(
self.SSL_SECRET, configuration_settings, configuration_protected_settings)
feSslCertFile = configuration_protected_settings.get(self.sslCertPemFile)
feSslKeyFile = configuration_protected_settings.get(self.sslKeyPemFile)
allowInsecureConnections = _get_value_from_config_protected_config(
self.allowInsecureConnections, configuration_settings, configuration_protected_settings)
allowInsecureConnections = str(allowInsecureConnections).lower() == 'true'
if (not feSslCertFile or not feSslKeyFile) and not allowInsecureConnections:
sslEnabled = (feSslCertFile and feSslKeyFile) or sslSecret
if not sslEnabled and not allowInsecureConnections:
raise InvalidArgumentValueError(
"Provide ssl certificate and key. "
"Otherwise explicitly allow insecure connection by specifying "
"'--configuration-settings allowInsecureConnections=true'")
"To enable HTTPs endpoint, "
"either provide sslCertPemFile and sslKeyPemFile to config protected settings, "
f"or provide sslSecret (kubernetes secret name) containing both ssl cert and ssl key under {release_namespace} namespace. "
"Otherwise, to enable HTTP endpoint, explicitly set allowInsecureConnections=true.")

feIsNodePort = _get_value_from_config_protected_config(
self.privateEndpointNodeport, configuration_settings, configuration_protected_settings)
Expand All @@ -395,16 +400,17 @@ def __validate_scoring_fe_settings(self, configuration_settings, configuration_p
logger.warning(
'Internal load balancer only supported on AKS and AKS Engine Clusters.')

def __set_inference_ssl_from_file(self, configuration_protected_settings):
def __set_inference_ssl_from_secret(self, configuration_settings, fe_ssl_secret):
configuration_settings['scoringFe.sslSecret'] = fe_ssl_secret

def __set_inference_ssl_from_file(self, configuration_protected_settings, fe_ssl_cert_file, fe_ssl_key_file):
import base64
feSslCertFile = configuration_protected_settings.get(self.sslCertPemFile)
feSslKeyFile = configuration_protected_settings.get(self.sslKeyPemFile)
with open(feSslCertFile) as f:
with open(fe_ssl_cert_file) as f:
cert_data = f.read()
cert_data_bytes = cert_data.encode("ascii")
ssl_cert = base64.b64encode(cert_data_bytes).decode()
configuration_protected_settings['scoringFe.sslCert'] = ssl_cert
with open(feSslKeyFile) as f:
with open(fe_ssl_key_file) as f:
key_data = f.read()
key_data_bytes = key_data.encode("ascii")
ssl_key = base64.b64encode(key_data_bytes).decode()
Expand All @@ -415,7 +421,16 @@ def __set_up_inference_ssl(self, configuration_settings, configuration_protected
self.allowInsecureConnections, configuration_settings, configuration_protected_settings)
allowInsecureConnections = str(allowInsecureConnections).lower() == 'true'
if not allowInsecureConnections:
self.__set_inference_ssl_from_file(configuration_protected_settings)
fe_ssl_secret = _get_value_from_config_protected_config(
self.SSL_SECRET, configuration_settings, configuration_protected_settings)
fe_ssl_cert_file = configuration_protected_settings.get(self.sslCertPemFile)
fe_ssl_key_file = configuration_protected_settings.get(self.sslKeyPemFile)

# always take ssl key/cert first, then secret if key/cert file is not provided
if fe_ssl_cert_file and fe_ssl_key_file:
self.__set_inference_ssl_from_file(configuration_protected_settings, fe_ssl_cert_file, fe_ssl_key_file)
else:
self.__set_inference_ssl_from_secret(configuration_settings, fe_ssl_secret)
else:
logger.warning(
'SSL is not enabled. Allowing insecure connections to the deployed services.')
Expand Down
2 changes: 1 addition & 1 deletion src/k8s-extension/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
# TODO: Add any additional SDK dependencies here
DEPENDENCIES = []

VERSION = "1.0.3"
VERSION = "1.0.4"

with open("README.rst", "r", encoding="utf-8") as f:
README = f.read()
Expand Down