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

fix: Add missed spire example #6

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
36 changes: 4 additions & 32 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,39 +1,11 @@
# deployment-k8s

This repository provides kubernetes yaml deployments and markdown examples for NSM.

## How to deploy spire?
## Contents

To deploy the spire run following command
```
kubectl apply -k spire/
- [Applications](./apps)
- [Basic examples](./examples/basic)

```


## How to deploy nsm?

To deploy the nsm run following command
```bash
kubectl apply -k nsm/
```

## How to register nsm spire entry?

Currently, we are working on automatization and this step will be removed soon.
For now, to register nsm into spire need to run following command:
```bash
kubectl exec -n spire spire-server-0 -- \
/opt/spire/bin/spire-server entry create \
-spiffeID spiffe://example.org/ns/spire/sa/spire-agent \
-selector k8s_sat:cluster:nsm-cluster \
-selector k8s_sat:agent_ns:spire \
-selector k8s_sat:agent_sa:spire-agent \
-node
kubectl exec -n spire spire-server-0 -- \
/opt/spire/bin/spire-server entry create \
-spiffeID spiffe://example.org/ns/nsm-system/sa/default \
-parentID spiffe://example.org/ns/spire/sa/spire-agent \
-selector k8s:ns:nsm-system \
-selector k8s:sa:default
```

36 changes: 36 additions & 0 deletions examples/spire/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Spire

## Run

To apply spire deployments following the next command:

```bash
kubectl apply -k .
```

Wait for PODs status ready:

```bash
kubectl wait -n spire --timeout=1m --for=condition=ready pod -l app=spire-agent
```

```bash
kubectl wait -n spire --timeout=1m --for=condition=ready pod -l app=spire-server
```

Register spire agents in the spire server:
```bash
kubectl exec -n spire spire-server-0 -- \
/opt/spire/bin/spire-server entry create \
-spiffeID spiffe://example.org/ns/spire/sa/spire-agent \
-selector k8s_sat:cluster:nsm-cluster \
-selector k8s_sat:agent_ns:spire \
-selector k8s_sat:agent_sa:spire-agent \
-node
```

## Cleanup

```bash
kubectl delete ns spire
```