Skip to content

Commit c6f1f29

Browse files
authored
Merge pull request #103 from polycube-network/pr/improve_developers_documentation
improve developers documentation
2 parents 1b1bd69 + 0232ed2 commit c6f1f29

15 files changed

Lines changed: 496 additions & 778 deletions

Documentation/codegen.rst

Lines changed: 0 additions & 145 deletions
This file was deleted.

Documentation/components/k8s/pcn-kubernetes.rst

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ You may choose either of the below options.
3535
-------------------------------
3636
- The fastest mode to test ``pcn-k8s`` including setup.
3737

38-
**Pre-requisite:**
38+
**Pre-requisite:**
3939

4040
Download and set up the following packages.
4141

@@ -113,14 +113,14 @@ You should see something like:
113113
kube-system kube-scheduler-k8s-master 1/1 Running 0 1m
114114

115115

116-
``pcn-k8s`` requires an ``etcd`` deployment to work, set the ``etcd_url`` parameter in :scm_web_file:`pcn-k8s.yaml <src/components/k8s/pcn-k8s.yaml>`.
117-
:scm_web_file:`standalone_etcd.yaml <src/components/k8s/standalone_etcd.yaml>` provides a basic etcd service that can be used for testing, deploy it before deploying pcn-k8s.
116+
``pcn-k8s`` requires an ``etcd`` deployment to work, set the ``etcd_url`` parameter in :scm_raw_web:`pcn-k8s.yaml <src/components/k8s/pcn-k8s.yaml>`.
117+
:scm_raw_web:`standalone_etcd.yaml <src/components/k8s/standalone_etcd.yaml>` provides a basic etcd service that can be used for testing, deploy it before deploying pcn-k8s.
118118

119119
At this point you can install ``pcn-k8s``:
120120

121121
.. parsed-literal::
122122
123-
kubectl apply -f |SCM_WEB|/src/components/k8s/pcn-k8s.yaml
123+
kubectl apply -f |SCM_RAW_WEB|/src/components/k8s/pcn-k8s.yaml
124124
# It will take some time until the images are pulled.
125125
126126
# Optional: if you want to execute pods on the master node
@@ -151,7 +151,7 @@ In order to remove ``pcn-k8s`` execute on the master node:
151151

152152
.. parsed-literal::
153153
154-
kubectl delete -f |SCM_WEB|/src/components/k8s/pcn-k8s.yaml
154+
kubectl delete -f |SCM_RAW_WEB|/src/components/k8s/pcn-k8s.yaml
155155
156156
157157
Testing pcn-k8s
@@ -250,7 +250,7 @@ In case you hit any problems, please follow the next steps to recover from a fai
250250
.. parsed-literal::
251251
252252
#1. Remove pcn-k8s
253-
kubectl delete -f |SCM_WEB|/src/components/k8s/pcn-k8s.yaml
253+
kubectl delete -f |SCM_RAW_WEB|/src/components/k8s/pcn-k8s.yaml
254254
255255
#2. Disable DNS
256256
kubectl -n kube-system scale --replicas=0 deployment/kube-dns
@@ -260,7 +260,7 @@ In case you hit any problems, please follow the next steps to recover from a fai
260260
ip link del dev pcn_vxlan
261261
262262
#4. Relaunch pcn-k8s
263-
kubectl apply -f |SCM_WEB|/src/components/k8s/pcn-k8s.yaml
263+
kubectl apply -f |SCM_RAW_WEB|/src/components/k8s/pcn-k8s.yaml
264264
265265
# Wait until all pcn-k8s containers are in running state
266266
kubectl get pods --all-namespaces

Documentation/components/k8s/testing.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Deploy services and pods to test
1010

1111
.. parsed-literal::
1212
13-
kubectl create -f |SCM_WEB|/src/components/k8s/examples/echoserver_nodeport.yaml
13+
kubectl create -f |SCM_RAW_WEB|/src/components/k8s/examples/echoserver_nodeport.yaml
1414
kubectl run curl1 --image=tutum/curl --replicas=5 --command -- sleep 600000
1515
1616

Documentation/conf.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -180,19 +180,23 @@
180180

181181

182182
# taken from cilium
183-
# TODO: how to actually get the branch
184-
branch = 'master'
185-
githubusercontent = 'https://raw.githubusercontent.com/polycube-network/polycube/'
186-
scm_web = githubusercontent + branch
183+
branch = os.environ.get('READTHEDOCS_VERSION')
184+
if branch == None or branch == 'latest':
185+
branch = 'master'
186+
187+
scm_raw_web = 'https://raw.githubusercontent.com/polycube-network/polycube/' + branch
188+
scm_web = 'https://github.com/polycube-network/polycube/blob/' + branch
187189

188190
# Store variables in the epilogue so they are globally available.
189191
rst_epilog = """
190192
.. |SCM_WEB| replace:: \{s}
193+
.. |SCM_RAW_WEB| replace:: \{sr}
191194
.. |SCM_BRANCH| replace:: \{b}
192-
""".format(s = scm_web, b = branch)
195+
""".format(s = scm_web, sr = scm_raw_web, b = branch)
193196

194197
# used to have links to repo files
195-
extlinks = {'scm_web_file': (scm_web + '/%s', 'scm_web_file ')}
198+
extlinks = {'scm_raw_web': (scm_raw_web + '/%s', 'scm_raw_web'),
199+
'scm_web': (scm_web + '/%s', 'scm_web')}
196200

197201
# spell configuration
198202
spelling_lang='en_US'

0 commit comments

Comments
 (0)