Skip to content
This repository was archived by the owner on May 31, 2023. It is now read-only.

Commit

Permalink
feat: added proposal and code for vault PKI for cloudcore and edgecore
Browse files Browse the repository at this point in the history
Hashicorp vault is used as PKI
Cloudcore and Edgecore retrieve their certificates and perform rotation
For cloudcore initial certificate retrieval is done via init container
Rotation is done for both using sidecar

Signed-off-by: Armin Schlegel <[email protected]>

fix: edgetunnel re-reads certs on reconnect
  • Loading branch information
siredmar committed Oct 19, 2022
1 parent 6ccb68f commit 3dacfaf
Showing 668 changed files with 88,400 additions and 654 deletions.
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.vscode

3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -18,3 +18,6 @@ keadm/keadm
_output
_tmp
build/edge/tmp
.history

patch
205 changes: 205 additions & 0 deletions LICENSES/vendor/github.com/edgefarm/vault-integration/LICENSE

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions build/cloud/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- 07-deployment.yaml
31 changes: 31 additions & 0 deletions build/overlays/vault/ca-configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: cacert
namespace: kubeedge
data:
ca.crt: |
-----BEGIN CERTIFICATE-----
MIID8zCCAtugAwIBAgIUOZfA+XxWW/zLqzjLgKRtMPgpLrowDQYJKoZIhvcNAQEL
BQAwHDEaMBgGA1UEAxMRY2Eucml2ZW5kZWxsLmhvbWUwHhcNMjIwMTI0MTYxNzE1
WhcNMzIwMTIyMTYxNzQ1WjAcMRowGAYDVQQDExFjYS5yaXZlbmRlbGwuaG9tZTCC
ASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAOxoCcOLaeCIP7+fxTNXt4nU
/Z6YQQVb76elqO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IotMJi0Ak440FiTyebYD84DVrA8qS
1TK78QCsCQ==
-----END CERTIFICATE-----
10 changes: 10 additions & 0 deletions build/overlays/vault/certretrieval.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
authrole=cloudcore
force=false
name=cloudcore.ci4rail.com
ca=/etc/kubeedge/certs/rootCA.crt
cert=/etc/kubeedge/certs/edge.crt
key=/etc/kubeedge/certs/edge.key
role=server
serverca=/opt/certretrieval/cert/ca.crt
ttl=24h
vault=https://vault.ci4rail.com
25 changes: 25 additions & 0 deletions build/overlays/vault/cloudhub-configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: cloudcore
namespace: kubeedge
data:
cloudcore.yaml: |
apiVersion: cloudcore.config.kubeedge.io/v1alpha2
kind: CloudCore
kubeAPIConfig:
kubeConfig: ""
master: ""
modules:
cloudHub:
nodeLimit: 10
tlsCAFile: /etc/kubeedge/certs/rootCA.crt
tlsCertFile: /etc/kubeedge/certs/edge.crt
tlsPrivateKeyFile: /etc/kubeedge/certs/edge.key
unixsocket:
address: unix:///var/lib/kubeedge/kubeedge.sock
enable: true
websocket:
address: 0.0.0.0
enable: true
port: 10000
26 changes: 26 additions & 0 deletions build/overlays/vault/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
bases:
- ../../cloud

resources:
- ca-configmap.yaml
- cloudhub-configmap.yaml

patches:
- patch.yaml

configMapGenerator:
- name: certretrieval.config
namespace: kubeedge
files:
- certretrieval.config

patchesJson6902:
- path: patch-volumes.json
target:
kind: Deployment
name: cloudcore
version: v1
group: apps
namespace: kubeedge
18 changes: 18 additions & 0 deletions build/overlays/vault/patch-volumes.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[
{
"op": "replace",
"path": "/spec/template/spec/volumes/3",
"value": {
"name": "certs",
"emptyDir": {}
}
},
{
"op": "replace",
"path": "/spec/template/spec/containers/0/volumeMounts/1",
"value": {
"name": "certs",
"mountPath": "/etc/kubeedge/certs"
}
}
]
Loading

0 comments on commit 3dacfaf

Please sign in to comment.