Skip to content

Commit

Permalink
Merge branch 'develop' of github.com:cncf/cnf-conformance into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
thewolfpack committed May 12, 2020
2 parents 16b9d5a + 75b9140 commit 96e8479
Show file tree
Hide file tree
Showing 36 changed files with 1,285 additions and 8 deletions.
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
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
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
1 change: 1 addition & 0 deletions sample-cnfs/sample_envoy_slow_startup/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: envoy
deployment_name: envoy
service_name: envoy
application_deployment_names: [envoy]
helm_chart_container_name: envoy
white_list_helm_chart_container_names: [falco, nginx, envoy, calico-node, kube-proxy, nginx-proxy, node-cache]
Expand Down
23 changes: 23 additions & 0 deletions sample-cnfs/sample_nodeport/chart/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# 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 file for Kubernetes
OWNERS
19 changes: 19 additions & 0 deletions sample-cnfs/sample_nodeport/chart/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
apiVersion: v1
appVersion: 5.12.35
description: Ubiquiti Network's Unifi Controller
home: https://github.com/jacobalberty/unifi-docker
icon: https://blog.ubnt.com/wp-content/uploads/2016/10/unifi-app-logo.png
keywords:
- ubiquiti
- unifi
- mongodb
maintainers:
- email: jeff@billimek.com
name: billimek
- email: mike@quadra-tec.net
name: mcronce
name: unifi
sources:
- https://github.com/jacobalberty/unifi-docker
- https://github.com/helm/charts/tree/master/stable/unifi
version: 0.7.0
180 changes: 180 additions & 0 deletions sample-cnfs/sample_nodeport/chart/README.md

Large diffs are not rendered by default.

19 changes: 19 additions & 0 deletions sample-cnfs/sample_nodeport/chart/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
1. Get the application URL by running these commands:
{{- if .Values.ingress.enabled }}
{{- range .Values.ingress.hosts }}
http{{ if $.Values.ingress.tls }}s{{ end }}://{{ . }}{{ $.Values.ingress.path }}
{{- end }}
{{- else if contains "NodePort" .Values.guiService.type }}
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ template "unifi.fullname" . }})
export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
echo http://$NODE_IP:$NODE_PORT
{{- else if contains "LoadBalancer" .Values.guiService.type }}
NOTE: It may take a few minutes for the LoadBalancer IP to be available.
You can watch the status of by running 'kubectl get svc --namespace {{ .Release.Namespace }} -w {{ template "unifi.fullname" . }}-gui'
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "unifi.fullname" . }}-gui -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
echo http://$SERVICE_IP:{{ .Values.guiService.port }}
{{- else if contains "ClusterIP" .Values.guiService.type }}
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app={{ template "unifi.name" . }},release={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8443:{.Values.guiService.port}
Visit https://127.0.0.1:8443 to use your application
{{- end }}
32 changes: 32 additions & 0 deletions sample-cnfs/sample_nodeport/chart/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{{/* vim: set filetype=mustache: */}}
{{/*
Expand the name of the chart.
*/}}
{{- define "unifi.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
{{- end -}}

{{/*
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "unifi.fullname" -}}
{{- if .Values.fullnameOverride -}}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- $name := default .Chart.Name .Values.nameOverride -}}
{{- if contains $name .Release.Name -}}
{{- .Release.Name | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{- end -}}
{{- end -}}

{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "unifi.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
{{- end -}}
39 changes: 39 additions & 0 deletions sample-cnfs/sample_nodeport/chart/templates/captive-ingress.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{{- if (and .Values.captivePortalService.ingress.enabled (not .Values.unifiedService.enabled)) }}
{{- $fullName := include "unifi.fullname" . -}}
{{- $ingressPath := .Values.captivePortalService.ingress.path -}}
{{- $unifiedServiceEnabled := .Values.unifiedService.enabled -}}
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: {{ $fullName }}-captive
labels:
app.kubernetes.io/name: {{ include "unifi.name" . }}
helm.sh/chart: {{ include "unifi.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- with .Values.captivePortalService.ingress.annotations }}
annotations:
{{ toYaml . | indent 4 }}
{{- end }}
spec:
{{- if .Values.captivePortalService.ingress.tls }}
tls:
{{- range .Values.captivePortalService.ingress.tls }}
- hosts:
{{- range .hosts }}
- {{ . | quote }}
{{- end }}
secretName: {{ .secretName }}
{{- end }}
{{- end }}
rules:
{{- range .Values.captivePortalService.ingress.hosts }}
- host: {{ . }}
http:
paths:
- path: {{ $ingressPath }}
backend:
serviceName: {{ $fullName }}-captiveportalservice
servicePort: captive-http
{{- end }}
{{- end }}
61 changes: 61 additions & 0 deletions sample-cnfs/sample_nodeport/chart/templates/captive-svc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
{{ if (and .Values.captivePortalService.enabled (not .Values.unifiedService.enabled)) }}
apiVersion: v1
kind: Service
metadata:
name: {{ template "unifi.fullname" . }}-captiveportalservice
labels:
app.kubernetes.io/name: {{ include "unifi.name" . }}
helm.sh/chart: {{ include "unifi.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- if .Values.captivePortalService.labels }}
{{ toYaml .Values.captivePortalService.labels | indent 4 }}
{{- end }}
{{- with .Values.captivePortalService.annotations }}
annotations:
{{ toYaml . | indent 4 }}
{{- end }}
spec:
{{- if (or (eq .Values.captivePortalService.type "ClusterIP") (empty .Values.captivePortalService.type)) }}
type: ClusterIP
{{- if .Values.captivePortalService.clusterIP }}
clusterIP: {{ .Values.captivePortalService.clusterIP }}
{{end}}
{{- else if eq .Values.captivePortalService.type "LoadBalancer" }}
type: {{ .Values.captivePortalService.type }}
{{- if .Values.captivePortalService.loadBalancerIP }}
loadBalancerIP: {{ .Values.captivePortalService.loadBalancerIP }}
{{- end }}
{{- if .Values.captivePortalService.loadBalancerSourceRanges }}
loadBalancerSourceRanges:
{{ toYaml .Values.captivePortalService.loadBalancerSourceRanges | indent 4 }}
{{- end -}}
{{- else }}
type: {{ .Values.captivePortalService.type }}
{{- end }}
{{- if .Values.captivePortalService.externalIPs }}
externalIPs:
{{ toYaml .Values.captivePortalService.externalIPs | indent 4 }}
{{- end }}
{{- if .Values.captivePortalService.externalTrafficPolicy }}
externalTrafficPolicy: {{ .Values.captivePortalService.externalTrafficPolicy }}
{{- end }}
ports:
- port: {{ .Values.captivePortalService.http }}
targetPort: captive-http
protocol: TCP
name: captive-http
{{ if (and (eq .Values.captivePortalService.type "NodePort") (not (empty .Values.captivePortalService.http))) }}
nodePort: {{.Values.captivePortalService.http}}
{{ end }}
- port: {{ .Values.captivePortalService.https }}
targetPort: captive-https
protocol: TCP
name: captive-https
{{ if (and (eq .Values.captivePortalService.type "NodePort") (not (empty .Values.captivePortalService.https))) }}
nodePort: {{.Values.captivePortalService.https}}
{{ end }}
selector:
app.kubernetes.io/name: {{ include "unifi.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{ end }}
13 changes: 13 additions & 0 deletions sample-cnfs/sample_nodeport/chart/templates/configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{{- if .Values.extraConfigFiles }}
kind: ConfigMap
apiVersion: v1
metadata:
name: {{ template "unifi.fullname" . }}
labels:
app.kubernetes.io/name: {{ include "unifi.name" . }}
helm.sh/chart: {{ include "unifi.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
data:
{{ toYaml .Values.extraConfigFiles | indent 2 }}
{{- end }}
54 changes: 54 additions & 0 deletions sample-cnfs/sample_nodeport/chart/templates/controller-svc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
{{ if not .Values.unifiedService.enabled }}
apiVersion: v1
kind: Service
metadata:
name: {{ template "unifi.fullname" . }}-controller
labels:
app.kubernetes.io/name: {{ include "unifi.name" . }}
helm.sh/chart: {{ include "unifi.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- if .Values.controllerService.labels }}
{{ toYaml .Values.controllerService.labels | indent 4 }}
{{- end }}
{{- with .Values.controllerService.annotations }}
annotations:
{{ toYaml . | indent 4 }}
{{- end }}
spec:
{{- if (or (eq .Values.controllerService.type "ClusterIP") (empty .Values.controllerService.type)) }}
type: ClusterIP
{{- if .Values.controllerService.clusterIP }}
clusterIP: {{ .Values.controllerService.clusterIP }}
{{end}}
{{- else if eq .Values.controllerService.type "LoadBalancer" }}
type: {{ .Values.controllerService.type }}
{{- if .Values.controllerService.loadBalancerIP }}
loadBalancerIP: {{ .Values.controllerService.loadBalancerIP }}
{{- end }}
{{- if .Values.controllerService.loadBalancerSourceRanges }}
loadBalancerSourceRanges:
{{ toYaml .Values.controllerService.loadBalancerSourceRanges | indent 4 }}
{{- end -}}
{{- else }}
type: {{ .Values.controllerService.type }}
{{- end }}
{{- if .Values.controllerService.externalIPs }}
externalIPs:
{{ toYaml .Values.controllerService.externalIPs | indent 4 }}
{{- end }}
{{- if .Values.controllerService.externalTrafficPolicy }}
externalTrafficPolicy: {{ .Values.controllerService.externalTrafficPolicy }}
{{- end }}
ports:
- port: {{ .Values.controllerService.port }}
targetPort: controller
protocol: TCP
name: controller
{{ if (and (eq .Values.controllerService.type "NodePort") (not (empty .Values.controllerService.nodePort))) }}
nodePort: {{.Values.controllerService.nodePort}}
{{ end }}
selector:
app.kubernetes.io/name: {{ include "unifi.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{ end }}
Loading

0 comments on commit 96e8479

Please sign in to comment.