This page currently only covers the set up for SDN-C clustering on single node Kubernetes.
About the SDN-C Clustering
The following diagram illustrates the desired SDN-C cluster deployment in this page(as described in
Jira |
---|
server | ONAP JIRA |
---|
columns | key,summary,type,created,updated,due,assignee,reporter,priority,status,resolution |
---|
serverId | 425b2b0a-557c-3c0c-b515-579789cceedb |
---|
key | SDNC-163 |
---|
|
) from POD and SERVICE view, which will have:
- 2 DB pods
- 3 SDN-C sdnc (ODL) pods
- 1 admin (portal) pod
- 1 dgbuilder pod
...
SDN-C Startup Order
Gliffy Diagram |
---|
| |
---|
name | sdnc pods start up order |
---|
|
Troubleshoot SDN-C pods are not start up in order
Usually, this is caused by init-container malfuntion. You can troubleshoot it by the following steps:
- Do a describe of the pod using command kubectl describe pod <pod-name>, to ensure the Init Container section is presented as your defined in your yaml template.
If it does not exist, it is possible that your Kubernetes version supports a different format for the init-containers:
init-containers syntax supported by Kubernetes 1.5, 1.6 and 1.7 and not supported by Kubernetes 1.8 and greater | initContainers syntax supported from Kubernetes 1.6 and greater |
---|
Init container is defined under spec.template.metadata.annotations."pod.beta.kubernetes.io/init-containers Code Block |
---|
language | xml |
---|
title | An example of init container by beta annotation |
---|
linenumbers | true |
---|
collapse | true |
---|
| apiVersion: apps/v1beta1
kind: StatefulSet
metadata:
name: sdnc
...
spec:
...
template:
metadata:
...
annotations:
pod.beta.kubernetes.io/init-containers: '[
{
"args": [
"--container-name",
"sdnc-db-container"
],
"command": [
"/root/ready.py"
],
"env": [
{
"name": "NAMESPACE",
"valueFrom": {
"fieldRef": {
"apiVersion": "v1",
"fieldPath": "metadata.namespace"
}
}
}
],
"image": "{{ .Values.image.readiness }}",
"imagePullPolicy": "{{ .Values.pullPolicy }}",
"name": "sdnc-readiness"
}
]'
spec:
containers:
... |
| Init container is defined under spec.template.spec.initContainers Code Block |
---|
language | xml |
---|
title | An example of init container by spec.initContainers |
---|
linenumbers | true |
---|
collapse | true |
---|
| apiVersion: apps/v1beta1
kind: StatefulSet
metadata:
name: sdnc
...
spec:
...
template:
...
spec:
initContainers:
- command:
- /root/ready.py
- "--container-name"
- "sdnc-db-container"
env:
- name: NAMESPACE
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: metadata.namespace
image: "{{ .Values.image.readiness }}"
imagePullPolicy: {{ .Values.pullPolicy }}
name: sdnc-readiness
containers:
... |
|
Restart Dead Instance (start a new one in its place)
...
Expand |
---|
title | Example of restarting dead instance by stopping karaf inside SDNC pod |
---|
|
Expand |
---|
title | Pod sdnc-0 is in Running STATUS with 0 RESTARTS |
---|
| ![](http://d2athenaconf:8090/confluence/download/attachments/12356276/image2017-11-24%2013%3A26%3A26.png?version=1&modificationDate=1511547987000&api=v2)
|
Expand |
---|
title | Enter pod container and stop Karaf |
---|
| ![](http://d2athenaconf:8090/confluence/download/attachments/12356276/image2017-11-24%2013%3A29%3A1.png?version=1&modificationDate=1511548142000&api=v2)
|
Expand |
---|
title | Kubernetes discovers pod process stopped and restarts the container |
---|
| ![](http://d2athenaconf:8090/confluence/download/attachments/12356276/image2017-11-24%2013%3A31%3A19.png?version=1&modificationDate=1511548279000&api=v2)
|
Expand |
---|
title | sdnc-0 pod will be brought up with the restart container and running with 2 out of 2 container READY |
---|
| ![](http://d2athenaconf:8090/confluence/download/attachments/12356276/image2017-11-24%2013%3A34%3A5.png?version=1&modificationDate=1511548446000&api=v2)
|
|
Source Code
The Source code can be found under the source code is currently temporary shared through gerrit topic SDNC-163https://gerrit.onap.org/r/#/q/topic:SDNC-163 until it is commited into gerrit.