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

Microservice Documentation/Helm Deploy/NodePort #205

Merged
merged 12 commits into from
May 12, 2020
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
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ The CNF Conformance Test Suite will inspect CNFs for the following characteristi
- **Compatibility** - CNFs should work with any Certified Kubernetes product and any CNI-compatible network that meet their functionality requirements.
- **Statelessness** - The CNF's state should be stored in a custom resource definition or a separate database (e.g. etcd) rather than requiring local storage. The CNF should also be resilient to node failure.
- **Security** - CNF containers should be isolated from one another and the host.
- **Microservice** - The CNF should be developed and delivered as a microservice.
- **Scalability** - CNFs should support horizontal scaling (across multiple machines) and vertical scaling (between sizes of machines).
- **Configuration and Lifecycle** - The CNF's configuration and lifecycle should be managed in a declarative manner, using ConfigMaps, Operators, or other declarative interfaces.
- **Observability** - CNFs should externalize their internal states in a way that supports metrics, tracing, and logging.
Expand Down
5 changes: 5 additions & 0 deletions TEST-CATEGORIES.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ The CNF Conformance program enables interoperability of CNFs from multiple vendo
* Check if there are any shells
* Check if any protected directories or files are accessed

## Microservice Tests
#### The CNF should be developed and delivered as a microservice. The CNF Conformance suite tests to determine the organizational structure and rate of change of the CNF being tested. Once these are known we can detemine whether or not the CNF is a microservice. See: [Microservice-Principles](https://networking.cloud-native-principles.org/cloud-native-microservice-principles):
* Check if the CNF have a reasonable startup time.
* Check the image size of the CNF.

## Scalability Tests
#### The CNF conformance suite checks to see if CNFs support horizontal scaling (across multiple machines) and vertical scaling (between sizes of machines) by using the native K8s [kubectl](https://kubernetes.io/docs/reference/kubectl/cheatsheet/#scaling-resources) command to:
* Test increasing/decreasing capacity
Expand Down
16 changes: 16 additions & 0 deletions USAGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,22 @@ crystal src/cnf-conformance.cr shells
crystal src/cnf-conformance.cr protected_access
```

## Microservice Tests
#### :heavy_check_mark: To run all of the microservice tests
```
crystal src/cnf-conformance.cr microservice
```

#### :heavy_check_mark: To check if the CNF has a reasonable image size
```
crystal src/cnf-conformance.cr reasonable_image_size
```
#### :heavy_check_mark: To check if the CNF have a reasonable startup time
```
crystal src/cnf-conformance.cr reasonable_startup_time
```


## Scalability Tests

#### :heavy_check_mark: To run all of the scalability tests
Expand Down
4 changes: 3 additions & 1 deletion points.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,9 @@
- name: no_volume_with_configuration
tags: configuration_lifecycle, dynamic
- name: rolling_update
tags: configuration_lifecycle, dynamic, installability
tags: configuration_lifecycle, dynamic
- name: nodeport_not_used
tags: configuration_lifecycle, dynamic

- name: fluentd_traffic
tags: observability, dynamic
Expand Down
39 changes: 39 additions & 0 deletions sample-cnfs/sample-bad-helm-deploy-repo/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Set up Sample CoreDNS CNF
./sample-cnfs/sample-coredns-cnf/readme.md
# Prerequistes
### Install helm
```
curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3
chmod 700 get_helm.sh
./get_helm.sh
```
### Optional: Use a helm version manager
https://github.com/yuya-takeyama/helmenv
Check out helmenv into any path (here is ${HOME}/.helmenv)
```
${HOME}/.helmenv)
$ git clone https://github.com/yuya-takeyama/helmenv.git ~/.helmenv
```
Add ~/.helmenv/bin to your $PATH any way you like
```
$ echo 'export PATH="$HOME/.helmenv/bin:$PATH"' >> ~/.bash_profile
```
```
helmenv versions
helmenv install <version 3.1?>
```

### core-dns installation
```
helm install coredns stable/coredns
```
### Pull down the helm chart code, untar it, and put it in the cnfs/coredns directory
```
helm pull stable/coredns
```
### Example cnf-conformance config file for sample-core-dns-cnf
In ./cnfs/sample-core-dns-cnf/cnf-conformance.yml
```
---
container_names: [coredns-coredns]
```
16 changes: 16 additions & 0 deletions sample-cnfs/sample-bad-helm-deploy-repo/cnf-conformance.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
helm_directory: cnfs/coredns/helm_chart/coredns
# helm_directory: helm_chart
git_clone_url:
install_script:
release_name: coredns
deployment_name: coredns-coredns
service_name: coredns-coredns
application_deployment_names: [coredns-coredns]
helm_repository:
name: stable
repo_url: https://bad-helm-repo.googleapis.com
helm_chart:
helm_chart_container_name: coredns
rolling_update_tag: 1.6.7
white_list_helm_chart_container_names: [falco, node-cache, nginx, coredns, calico-node, kube-proxy, nginx-proxy]
1 change: 1 addition & 0 deletions sample-cnfs/sample-bad-helm-repo/cnf-conformance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ git_clone_url:
install_script:
release_name: coredns
deployment_name: coredns-coredns
service_name: coredns-coredns
application_deployment_names: [coredns-coredns]
helm_repository:
name: stable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ git_clone_url:
install_script:
release_name: bad-helm-coredns-coredns
deployment_name: bad-helm-coredns-coredns
service_name: bad-helm-coredns-coredns
application_deployment_names: [bad-helm-coredns]
helm_chart: stable/coredns
helm_chart_container_name: coredns
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ git_clone_url:
install_script:
release_name: coredns
deployment_name: coredns-coredns
service_name: coredns-coredns
application_deployment_names: [coredns-coredns]
docker_repository: coredns/coredns
helm_repository:
Expand Down
1 change: 1 addition & 0 deletions sample-cnfs/sample-coredns-cnf-source/cnf-conformance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ git_clone_url: https://github.com/coredns/coredns.git
install_script: coredns/Makefile
release_name: coredns
deployment_name: coredns-coredns
service_name: coredns-coredns
application_deployment_names: [coredns-coredns]
helm_chart: stable/coredns
helm_chart_container_name: coredns
Expand Down
1 change: 1 addition & 0 deletions sample-cnfs/sample-coredns-cnf/cnf-conformance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ git_clone_url:
install_script:
release_name: coredns
deployment_name: coredns-coredns
service_name: coredns-coredns
application_deployment_names: [coredns-coredns]
docker_repository: coredns/coredns
helm_repository:
Expand Down
1 change: 1 addition & 0 deletions sample-cnfs/sample-generic-cnf/cnf-conformance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ git_clone_url: https://github.com/coredns/coredns.git
install_script: cnfs/coredns/Makefile
release_name: coredns
deployment_name: coredns-coredns
service_name: coredns-coredns
application_deployment_names: [coredns-coredns]
docker_repository: coredns/coredns
helm_repository:
Expand Down
3 changes: 2 additions & 1 deletion sample-cnfs/sample-large-cnf/cnf-conformance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ helm_directory: chart
git_clone_url:
install_script:
release_name: coredns
deployment_name: coredns-coredns
deployment_name: coredns-coredns
service_name: coredns-coredns
application_deployment_names: [coredns-coredns]
docker_repository: coredns/coredns
helm_repository:
Expand Down
1 change: 1 addition & 0 deletions sample-cnfs/sample_coredns/cnf-conformance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ git_clone_url:
install_script: chart
release_name: coredns
deployment_name: coredns-coredns
service_name: coredns-coredns
application_deployment_names: [coredns-coredns]
helm_chart: stable/coredns
helm_chart_container_name: coredns-coredns
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ git_clone_url:
install_script: chart
release_name: bad-liveness
deployment_name: bad-liveness-coredns
service_name: bad-liveness-coredns
application_deployment_names: [bad-liveness-coredns]
helm_chart: stable/coredns
helm_chart_container_name: bad-liveness-coredns
Expand Down
39 changes: 39 additions & 0 deletions sample-cnfs/sample_coredns_chart_directory/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Set up Sample CoreDNS CNF
./sample-cnfs/sample-coredns-cnf/readme.md
# Prerequistes
### Install helm
```
curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3
chmod 700 get_helm.sh
./get_helm.sh
```
### Optional: Use a helm version manager
https://github.com/yuya-takeyama/helmenv
Check out helmenv into any path (here is ${HOME}/.helmenv)
```
${HOME}/.helmenv)
$ git clone https://github.com/yuya-takeyama/helmenv.git ~/.helmenv
```
Add ~/.helmenv/bin to your $PATH any way you like
```
$ echo 'export PATH="$HOME/.helmenv/bin:$PATH"' >> ~/.bash_profile
```
```
helmenv versions
helmenv install <version 3.1?>
```

### core-dns installation
```
helm install coredns stable/coredns
```
### Pull down the helm chart code, untar it, and put it in the cnfs/coredns directory
```
helm pull stable/coredns
```
### Example cnf-conformance config file for sample-core-dns-cnf
In ./cnfs/sample-core-dns-cnf/cnf-conformance.yml
```
---
container_names: [coredns-coredns]
```
22 changes: 22 additions & 0 deletions sample-cnfs/sample_coredns_chart_directory/chart/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*~
# Various IDEs
.project
.idea/
*.tmproj
OWNERS
23 changes: 23 additions & 0 deletions sample-cnfs/sample_coredns_chart_directory/chart/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
apiVersion: v1
appVersion: 1.6.7
description: CoreDNS is a DNS server that chains plugins and provides Kubernetes DNS
Services
home: https://coredns.io
icon: https://coredns.io/images/CoreDNS_Colour_Horizontal.png
keywords:
- coredns
- dns
- kubedns
maintainers:
- email: hello@acale.ph
name: Acaleph
- email: shashidhara.huawei@gmail.com
name: shashidharatd
- email: andor44@gmail.com
name: andor44
- email: manuel@rueg.eu
name: mrueg
name: coredns
sources:
- https://github.com/coredns/coredns
version: 1.10.0
Loading