-
Notifications
You must be signed in to change notification settings - Fork 35
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
Added usage of annotations for kernel clients #3663
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,37 +28,40 @@ kind: Kustomization | |
|
||
namespace: ${NAMESPACE} | ||
|
||
resources: | ||
- client.yaml | ||
bases: | ||
- https://github.com/networkservicemesh/deployments-k8s/apps/nsc-kernel?ref=5012a8aafd293534e2a9d98903f6d339ef44ceab | ||
- https://github.com/networkservicemesh/deployments-k8s/apps/nse-memif?ref=5012a8aafd293534e2a9d98903f6d339ef44ceab | ||
|
||
patchesStrategicMerge: | ||
- patch-nsc.yaml | ||
- patch-nse.yaml | ||
EOF | ||
``` | ||
|
||
Create NSC patch: | ||
Create Client: | ||
```bash | ||
cat > patch-nsc.yaml <<EOF | ||
cat > client.yaml <<EOF | ||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
apiVersion: v1 | ||
kind: Pod | ||
metadata: | ||
name: nsc-kernel | ||
name: alpine | ||
labels: | ||
app: alpine | ||
annotations: | ||
networkservicemesh.io: kernel://icmp-responder-ip/nsm-1 | ||
spec: | ||
template: | ||
spec: | ||
containers: | ||
- name: nsc | ||
env: | ||
- name: NSM_NETWORK_SERVICES | ||
value: kernel://icmp-responder-ip/nsm-1 | ||
|
||
nodeSelector: | ||
kubernetes.io/hostname: ${NODES[0]} | ||
containers: | ||
- name: alpine | ||
image: alpine | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please use a concrete alpine image. |
||
imagePullPolicy: IfNotPresent | ||
stdin: true | ||
tty: true | ||
nodeSelector: | ||
kubernetes.io/hostname: ${NODES[0]} | ||
EOF | ||
``` | ||
|
||
Create NSE patch: | ||
```bash | ||
cat > patch-nse.yaml <<EOF | ||
|
@@ -91,15 +94,15 @@ kubectl apply -k . | |
|
||
Wait for applications ready: | ||
```bash | ||
kubectl wait --for=condition=ready --timeout=1m pod -l app=nsc-kernel -n ${NAMESPACE} | ||
kubectl wait --for=condition=ready --timeout=1m pod -l app=nse-memif -n ${NAMESPACE} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why is order changed? |
||
``` | ||
```bash | ||
kubectl wait --for=condition=ready --timeout=1m pod -l app=nse-memif -n ${NAMESPACE} | ||
kubectl wait --for=condition=ready --timeout=1m pod -l app=alpine -n ${NAMESPACE} | ||
``` | ||
|
||
Find NSC and NSE pods by labels: | ||
```bash | ||
NSC=$(kubectl get pods -l app=nsc-kernel -n ${NAMESPACE} --template '{{range .items}}{{.metadata.name}}{{"\n"}}{{end}}') | ||
NSC=$(kubectl get pods -l app=alpine -n ${NAMESPACE} --template '{{range .items}}{{.metadata.name}}{{"\n"}}{{end}}') | ||
``` | ||
```bash | ||
NSE=$(kubectl get pods -l app=nse-memif -n ${NAMESPACE} --template '{{range .items}}{{.metadata.name}}{{"\n"}}{{end}}') | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,38 +35,41 @@ resources: | |
- https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/5012a8aafd293534e2a9d98903f6d339ef44ceab/examples/features/nse-composition/passthrough-2.yaml | ||
- https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/5012a8aafd293534e2a9d98903f6d339ef44ceab/examples/features/nse-composition/passthrough-3.yaml | ||
- https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/5012a8aafd293534e2a9d98903f6d339ef44ceab/examples/features/nse-composition/nse-composition-ns.yaml | ||
- client.yaml | ||
bases: | ||
- https://github.com/networkservicemesh/deployments-k8s/apps/nsc-kernel?ref=5012a8aafd293534e2a9d98903f6d339ef44ceab | ||
- https://github.com/networkservicemesh/deployments-k8s/apps/nse-kernel?ref=5012a8aafd293534e2a9d98903f6d339ef44ceab | ||
- https://github.com/networkservicemesh/deployments-k8s/examples/features/nse-composition/nse-firewall?ref=5012a8aafd293534e2a9d98903f6d339ef44ceab | ||
|
||
patchesStrategicMerge: | ||
- patch-nsc.yaml | ||
- patch-nse.yaml | ||
EOF | ||
``` | ||
|
||
Create NSC patch: | ||
Create Client: | ||
```bash | ||
cat > patch-nsc.yaml <<EOF | ||
cat > client.yaml <<EOF | ||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
apiVersion: v1 | ||
kind: Pod | ||
metadata: | ||
name: nsc-kernel | ||
name: alpine | ||
labels: | ||
app: alpine | ||
annotations: | ||
networkservicemesh.io: kernel://nse-composition/nsm-1 | ||
spec: | ||
template: | ||
spec: | ||
containers: | ||
- name: nsc | ||
env: | ||
- name: NSM_NETWORK_SERVICES | ||
value: kernel://nse-composition/nsm-1 | ||
nodeSelector: | ||
kubernetes.io/hostname: ${NODE} | ||
containers: | ||
- name: alpine | ||
image: alpine | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please use a concrete alpine image. |
||
imagePullPolicy: IfNotPresent | ||
stdin: true | ||
tty: true | ||
nodeSelector: | ||
kubernetes.io/hostname: ${NODE} | ||
EOF | ||
``` | ||
|
||
|
||
Create NSE patch: | ||
```bash | ||
cat > patch-nse.yaml <<EOF | ||
|
@@ -104,15 +107,15 @@ kubectl apply -k . | |
|
||
Wait for applications ready: | ||
```bash | ||
kubectl wait --for=condition=ready --timeout=1m pod -l app=nsc-kernel -n ${NAMESPACE} | ||
kubectl wait --for=condition=ready --timeout=1m pod -l app=alpine -n ${NAMESPACE} | ||
``` | ||
```bash | ||
kubectl wait --for=condition=ready --timeout=1m pod -l app=nse-kernel -n ${NAMESPACE} | ||
``` | ||
|
||
Find nsc and nse pods by labels: | ||
```bash | ||
NSC=$(kubectl get pods -l app=nsc-kernel -n ${NAMESPACE} --template '{{range .items}}{{.metadata.name}}{{"\n"}}{{end}}') | ||
NSC=$(kubectl get pods -l app=alpine -n ${NAMESPACE} --template '{{range .items}}{{.metadata.name}}{{"\n"}}{{end}}') | ||
``` | ||
```bash | ||
NSE=$(kubectl get pods -l app=nse-kernel -n ${NAMESPACE} --template '{{range .items}}{{.metadata.name}}{{"\n"}}{{end}}') | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is the order changed?
Note: previously we waited for NSC first.