Add cfssl cert generation
[nonrtric.git] / service-exposure / rapps-webhook.yaml
1 #
2 # ============LICENSE_START=======================================================
3 #  Copyright (C) 2022 Nordix Foundation.
4 # ================================================================================
5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at
8 #
9 #      http://www.apache.org/licenses/LICENSE-2.0
10 #
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
16 #
17 # SPDX-License-Identifier: Apache-2.0
18 # ============LICENSE_END=========================================================
19 #
20 ---
21 apiVersion: v1
22 kind: ServiceAccount
23 metadata:
24   name: webhook-app
25   namespace: default
26 ---
27 apiVersion: rbac.authorization.k8s.io/v1
28 kind: ClusterRoleBinding
29 metadata:
30   name: webhook-app
31 roleRef:
32   apiGroup: rbac.authorization.k8s.io
33   kind: ClusterRole
34   name: cluster-admin
35 subjects:
36   - kind: ServiceAccount
37     name: webhook-app
38     namespace: default
39 ---
40 apiVersion: apps/v1
41 kind: Deployment
42 metadata:
43   name: jwt-proxy-admission-controller-deployment
44   namespace: default
45   labels:
46     app: jwt-proxy-admission-controller
47 spec:
48   selector:
49     matchLabels:
50       app: jwt-proxy-admission-controller
51   template:
52     metadata:
53       labels:
54         app: jwt-proxy-admission-controller
55         version: v1
56     spec:
57       serviceAccountName: webhook-app
58       containers:
59       - name: jwt-proxy-admission-controller
60         image: ktimoney/rapps-webhook
61         imagePullPolicy: IfNotPresent
62         command: ["/app/rapps-webhook"]
63         args: [
64                 "-port", "8443",
65                 "-tlsCertFile", "/certs/tls.crt",
66                 "-tlsKeyFile", "/certs/tls.key",
67                 "-hostPath", "/var/rapps/certs"
68               ]
69         ports:
70         - containerPort: 8443
71         resources:
72           limits:
73             memory: 256Mi
74             cpu: "250m"
75           requests:
76             memory: 128Mi
77             cpu: "80m"
78         volumeMounts:
79           - readOnly: true
80             mountPath: /certs
81             name: webhook-cert
82       volumes:
83         - name: webhook-cert
84           secret:
85             secretName: webhook-cert
86   replicas: 1
87 ---
88 apiVersion: v1
89 kind: Service
90 metadata:
91   name: jwt-proxy-admission-controller
92   namespace: default
93 spec:
94   selector:
95     app: jwt-proxy-admission-controller
96   ports:
97     - protocol: TCP
98       port: 443
99       targetPort: 8443
100       nodePort: 30570
101   type: NodePort
102 ---