Skip to content

Commit 66e7b97

Browse files
nlu90tuteng
andauthored
update auth and tls settings (#160)
* update auth and tls settings Co-authored-by: guangning <guangning@apache.org>
1 parent 094eae7 commit 66e7b97

26 files changed

Lines changed: 367 additions & 179 deletions

api/v1alpha1/common.go

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,18 @@ type PulsarMessaging struct {
3131
// webServiceURL
3232
// brokerServiceURL
3333
PulsarConfig string `json:"pulsarConfig,omitempty"`
34-
AuthConfig string `json:"authConfig,omitempty"`
34+
35+
// The auth secret should contain the following fields
36+
// clientAuthenticationPlugin
37+
// clientAuthenticationParameters
38+
AuthSecret string `json:"authSecret,omitempty"`
39+
40+
// The TLS secret should contain the following fields
41+
// use_tls
42+
// tls_allow_insecure
43+
// hostname_verification_enabled
44+
// tls_trust_cert_path
45+
TLSSecret string `json:"tlsSecret,omitempty"`
3546
}
3647

3748
type PodPolicy struct {

config/crd/bases/compute.functionmesh.io_functionmeshes.yaml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2192,10 +2192,12 @@ spec:
21922192
type: string
21932193
pulsar:
21942194
properties:
2195-
authConfig:
2195+
authSecret:
21962196
type: string
21972197
pulsarConfig:
21982198
type: string
2199+
tlsSecret:
2200+
type: string
21992201
type: object
22002202
python:
22012203
properties:
@@ -4363,10 +4365,12 @@ spec:
43634365
type: string
43644366
pulsar:
43654367
properties:
4366-
authConfig:
4368+
authSecret:
43674369
type: string
43684370
pulsarConfig:
43694371
type: string
4372+
tlsSecret:
4373+
type: string
43704374
type: object
43714375
python:
43724376
properties:
@@ -6513,10 +6517,12 @@ spec:
65136517
type: string
65146518
pulsar:
65156519
properties:
6516-
authConfig:
6520+
authSecret:
65176521
type: string
65186522
pulsarConfig:
65196523
type: string
6524+
tlsSecret:
6525+
type: string
65206526
type: object
65216527
python:
65226528
properties:

config/crd/bases/compute.functionmesh.io_functions.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2193,10 +2193,12 @@ spec:
21932193
type: string
21942194
pulsar:
21952195
properties:
2196-
authConfig:
2196+
authSecret:
21972197
type: string
21982198
pulsarConfig:
21992199
type: string
2200+
tlsSecret:
2201+
type: string
22002202
type: object
22012203
python:
22022204
properties:

config/crd/bases/compute.functionmesh.io_sinks.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2128,10 +2128,12 @@ spec:
21282128
type: string
21292129
pulsar:
21302130
properties:
2131-
authConfig:
2131+
authSecret:
21322132
type: string
21332133
pulsarConfig:
21342134
type: string
2135+
tlsSecret:
2136+
type: string
21352137
type: object
21362138
python:
21372139
properties:

config/crd/bases/compute.functionmesh.io_sources.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2103,10 +2103,12 @@ spec:
21032103
type: string
21042104
pulsar:
21052105
properties:
2106-
authConfig:
2106+
authSecret:
21072107
type: string
21082108
pulsarConfig:
21092109
type: string
2110+
tlsSecret:
2111+
type: string
21102112
type: object
21112113
python:
21122114
properties:

config/samples/compute_v1alpha1_function.yaml

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ spec:
3434
key: "password"
3535
pulsar:
3636
pulsarConfig: "test-pulsar"
37-
#authConfig: "test-auth"
37+
authSecret: "test-auth"
38+
tlsSecret: "test-tls"
3839
volumeMounts:
3940
- mountPath: /cache
4041
name: cache-volume
@@ -73,6 +74,23 @@ metadata:
7374
data:
7475
webServiceURL: http://test-pulsar-broker.default.svc.cluster.local:8080
7576
brokerServiceURL: pulsar://test-pulsar-broker.default.svc.cluster.local:6650
77+
---
78+
apiVersion: v1
79+
kind: Secret
80+
metadata:
81+
name: test-auth
82+
stringData:
83+
clientAuthenticationPlugin: admin
84+
clientAuthenticationParameters: t0p-Secret
85+
---
86+
apiVersion: v1
87+
kind: Secret
88+
metadata:
89+
name: test-tls
90+
stringData:
91+
tlsTrustCertsFilePath: "uvw"
92+
tlsAllowInsecureConnection: "false"
93+
tlsHostnameVerificationEnable: "true"
7694
#---
7795
#apiVersion: v1
7896
#kind: ConfigMap

config/samples/compute_v1alpha1_function_crypto.yaml

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ spec:
5151
key: "password"
5252
pulsar:
5353
pulsarConfig: "test-pulsar"
54-
#authConfig: "test-auth"
5554
java:
5655
jar: pulsar-functions-api-examples.jar
5756
jarLocation: public/default/nlu-test-java-function
@@ -66,18 +65,6 @@ metadata:
6665
data:
6766
webServiceURL: http://test-pulsar-broker.default.svc.cluster.local:8080
6867
brokerServiceURL: pulsar://test-pulsar-broker.default.svc.cluster.local:6650
69-
#---
70-
#apiVersion: v1
71-
#kind: ConfigMap
72-
#metadata:
73-
# name: test-auth
74-
#data:
75-
# clientAuthenticationPlugin: "abc"
76-
# clientAuthenticationParameters: "xyz"
77-
# tlsTrustCertsFilePath: "uvw"
78-
# useTls: "true"
79-
# tlsAllowInsecureConnection: "false"
80-
# tlsHostnameVerificationEnable: "true"
8168
---
8269
apiVersion: v1
8370
data:

config/samples/compute_v1alpha1_function_key_based_batcher.yaml

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ spec:
3737
key: "password"
3838
pulsar:
3939
pulsarConfig: "test-pulsar"
40-
#authConfig: "test-auth"
4140
volumeMounts:
4241
- mountPath: /cache
4342
name: cache-volume
@@ -75,18 +74,6 @@ metadata:
7574
data:
7675
webServiceURL: http://test-pulsar-broker.default.svc.cluster.local:8080
7776
brokerServiceURL: pulsar://test-pulsar-broker.default.svc.cluster.local:6650
78-
#---
79-
#apiVersion: v1
80-
#kind: ConfigMap
81-
#metadata:
82-
# name: test-auth
83-
#data:
84-
# clientAuthenticationPlugin: "abc"
85-
# clientAuthenticationParameters: "xyz"
86-
# tlsTrustCertsFilePath: "uvw"
87-
# useTls: "true"
88-
# tlsAllowInsecureConnection: "false"
89-
# tlsHostnameVerificationEnable: "true"
9077
---
9178
apiVersion: v1
9279
data:

config/samples/compute_v1alpha1_go_function.yaml

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ spec:
3131
key: "password"
3232
pulsar:
3333
pulsarConfig: "test-go-pulsar"
34-
#authConfig: "test-auth"
3534
golang:
3635
go: go_func_all
3736
goLocation: public/default/nlu-test-go-function
@@ -48,18 +47,6 @@ metadata:
4847
data:
4948
webServiceURL: http://test-pulsar-broker.default.svc.cluster.local:8080
5049
brokerServiceURL: pulsar://test-pulsar-broker.default.svc.cluster.local:6650
51-
#---
52-
#apiVersion: v1
53-
#kind: ConfigMap
54-
#metadata:
55-
# name: test-auth
56-
#data:
57-
# clientAuthenticationPlugin: "abc"
58-
# clientAuthenticationParameters: "xyz"
59-
# tlsTrustCertsFilePath: "uvw"
60-
# useTls: "true"
61-
# tlsAllowInsecureConnection: "false"
62-
# tlsHostnameVerificationEnable: "true"
6350
---
6451
apiVersion: v1
6552
data:

config/samples/compute_v1alpha1_py_function.yaml

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ spec:
3232
key: "password"
3333
pulsar:
3434
pulsarConfig: "test-py-pulsar"
35-
#authConfig: "test-auth"
3635
python:
3736
py: exclamation_function.py
3837
pyLocation: public/default/nlu-test-py-function
@@ -49,18 +48,6 @@ metadata:
4948
data:
5049
webServiceURL: http://test-pulsar-broker.default.svc.cluster.local:8080
5150
brokerServiceURL: pulsar://test-pulsar-broker.default.svc.cluster.local:6650
52-
#---
53-
#apiVersion: v1
54-
#kind: ConfigMap
55-
#metadata:
56-
# name: test-auth
57-
#data:
58-
# clientAuthenticationPlugin: "abc"
59-
# clientAuthenticationParameters: "xyz"
60-
# tlsTrustCertsFilePath: "uvw"
61-
# useTls: "true"
62-
# tlsAllowInsecureConnection: "false"
63-
# tlsHostnameVerificationEnable: "true"
6451
---
6552
apiVersion: v1
6653
data:

0 commit comments

Comments
 (0)