Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
H
helm3
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
helm3
Commits
47991c9c
Commit
47991c9c
authored
Apr 14, 2016
by
Matt Butcher
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(chart): update chart testdata for newer format
parent
5b78c77f
Hide whitespace changes
Inline
Side-by-side
Showing
36 changed files
with
57 additions
and
563 deletions
+57
-563
chart_test.go
pkg/chart/chart_test.go
+1
-47
chartfile.go
pkg/chart/chartfile.go
+7
-52
chartfile_test.go
pkg/chart/chartfile_test.go
+0
-50
save_test.go
pkg/chart/save_test.go
+5
-8
README.md
pkg/chart/testdata/README.md
+1
-9
frobnitz-0.0.1.tgz
pkg/chart/testdata/frobnitz-0.0.1.tgz
+0
-0
Chart.toml
pkg/chart/testdata/frobnitz/Chart.toml
+15
-0
Chart.yaml
pkg/chart/testdata/frobnitz/Chart.yaml
+0
-19
INSTALL.txt
pkg/chart/testdata/frobnitz/INSTALL.txt
+1
-0
pre-install.py
pkg/chart/testdata/frobnitz/hooks/pre-install.py
+0
-1
template.tpl
pkg/chart/testdata/frobnitz/templates/template.tpl
+1
-0
wordpress-resources.yaml
...hart/testdata/frobnitz/templates/wordpress-resources.yaml
+0
-12
wordpress.jinja
pkg/chart/testdata/frobnitz/templates/wordpress.jinja
+0
-72
wordpress.jinja.schema
pkg/chart/testdata/frobnitz/templates/wordpress.jinja.schema
+0
-69
wordpress.yaml
pkg/chart/testdata/frobnitz/templates/wordpress.yaml
+0
-6
values.toml
pkg/chart/testdata/frobnitz/values.toml
+6
-0
ill-1.2.3.tgz
pkg/chart/testdata/ill-1.2.3.tgz
+0
-0
Chart.yaml
pkg/chart/testdata/ill/Chart.yaml
+0
-28
LICENSE
pkg/chart/testdata/ill/LICENSE
+0
-1
README.md
pkg/chart/testdata/ill/README.md
+0
-11
README.md
pkg/chart/testdata/ill/docs/README.md
+0
-1
pre-install.py
pkg/chart/testdata/ill/hooks/pre-install.py
+0
-1
wordpress-resources.yaml
pkg/chart/testdata/ill/templates/wordpress-resources.yaml
+0
-12
wordpress.jinja
pkg/chart/testdata/ill/templates/wordpress.jinja
+0
-72
wordpress.jinja.schema
pkg/chart/testdata/ill/templates/wordpress.jinja.schema
+0
-69
wordpress.yaml
pkg/chart/testdata/ill/templates/wordpress.yaml
+0
-6
nochart.tgz
pkg/chart/testdata/nochart.tgz
+0
-0
Chart.yaml
pkg/chart/testdata/sprocket/Chart.yaml
+13
-2
LICENSE
pkg/chart/testdata/sprocket/LICENSE
+0
-1
README.md
pkg/chart/testdata/sprocket/README.md
+0
-3
README.md
pkg/chart/testdata/sprocket/docs/README.md
+0
-1
pre-install.py
pkg/chart/testdata/sprocket/hooks/pre-install.py
+0
-1
icon.svg
pkg/chart/testdata/sprocket/icon.svg
+0
-8
placeholder.txt
pkg/chart/testdata/sprocket/templates/placeholder.txt
+0
-1
template.tpl
pkg/chart/testdata/sprocket/templates/template.tpl
+1
-0
values.toml
pkg/chart/testdata/sprocket/values.toml
+6
-0
No files found.
pkg/chart/chart_test.go
View file @
47991c9c
...
...
@@ -28,9 +28,7 @@ const (
testfile
=
"testdata/frobnitz/Chart.yaml"
testdir
=
"testdata/frobnitz/"
testarchive
=
"testdata/frobnitz-0.0.1.tgz"
testill
=
"testdata/ill-1.2.3.tgz"
testnochart
=
"testdata/nochart.tgz"
testmember
=
"templates/wordpress.jinja"
testmember
=
"templates/template.tpl"
)
// Type canaries. If these fail, they will fail at compile time.
...
...
@@ -47,11 +45,6 @@ func TestLoadDir(t *testing.T) {
if
c
.
Chartfile
()
.
Name
!=
"frobnitz"
{
t
.
Errorf
(
"Expected chart name to be 'frobnitz'. Got '%s'."
,
c
.
Chartfile
()
.
Name
)
}
if
c
.
Chartfile
()
.
Dependencies
[
0
]
.
Version
!=
"^3"
{
d
:=
c
.
Chartfile
()
.
Dependencies
[
0
]
.
Version
t
.
Errorf
(
"Expected dependency 0 to have version '^3'. Got '%s'."
,
d
)
}
}
func
TestLoad
(
t
*
testing
.
T
)
{
...
...
@@ -93,32 +86,6 @@ func TestLoadData(t *testing.T) {
}
}
func
TestLoadIll
(
t
*
testing
.
T
)
{
c
,
err
:=
Load
(
testill
)
if
err
!=
nil
{
t
.
Errorf
(
"Failed to load chart: %s"
,
err
)
return
}
defer
c
.
Close
()
if
c
.
Chartfile
()
==
nil
{
t
.
Error
(
"No chartfile was loaded."
)
return
}
// Ill does not have an icon.
if
i
,
err
:=
c
.
Icon
();
err
==
nil
{
t
.
Errorf
(
"Expected icon to be missing. Got %s"
,
i
)
}
}
func
TestLoadNochart
(
t
*
testing
.
T
)
{
_
,
err
:=
Load
(
testnochart
)
if
err
==
nil
{
t
.
Error
(
"Nochart should not have loaded at all."
)
}
}
func
TestChart
(
t
*
testing
.
T
)
{
c
,
err
:=
LoadDir
(
testdir
)
if
err
!=
nil
{
...
...
@@ -144,19 +111,6 @@ func TestChart(t *testing.T) {
if
d
!=
filepath
.
Join
(
dir
,
preTemplates
)
{
t
.
Errorf
(
"Unexpectedly, templates are in %s"
,
d
)
}
d
=
c
.
HooksDir
()
if
d
!=
filepath
.
Join
(
dir
,
preHooks
)
{
t
.
Errorf
(
"Unexpectedly, hooks are in %s"
,
d
)
}
i
,
err
:=
c
.
Icon
()
if
err
!=
nil
{
t
.
Errorf
(
"No icon found in test chart: %s"
,
err
)
}
if
i
!=
filepath
.
Join
(
dir
,
preIcon
)
{
t
.
Errorf
(
"Unexpectedly, icon is in %s"
,
i
)
}
}
func
TestLoadTemplates
(
t
*
testing
.
T
)
{
...
...
pkg/chart/chartfile.go
View file @
47991c9c
...
...
@@ -19,23 +19,18 @@ package chart
import
(
"io/ioutil"
"github.com/Masterminds/semver"
"gopkg.in/yaml.v2"
)
// Chartfile describes a Helm Chart (e.g. Chart.yaml)
type
Chartfile
struct
{
Name
string
`yaml:"name"`
Description
string
`yaml:"description"`
Version
string
`yaml:"version"`
Keywords
[]
string
`yaml:"keywords,omitempty"`
Maintainers
[]
*
Maintainer
`yaml:"maintainers,omitempty"`
Source
[]
string
`yaml:"source,omitempty"`
Home
string
`yaml:"home"`
Dependencies
[]
*
Dependency
`yaml:"dependencies,omitempty"`
Environment
[]
*
EnvConstraint
`yaml:"environment,omitempty"`
Expander
*
Expander
`yaml:"expander,omitempty"`
Schema
string
`yaml:"schema,omitempty"`
Name
string
`yaml:"name"`
Description
string
`yaml:"description"`
Version
string
`yaml:"version"`
Keywords
[]
string
`yaml:"keywords,omitempty"`
Maintainers
[]
*
Maintainer
`yaml:"maintainers,omitempty"`
Source
[]
string
`yaml:"source,omitempty"`
Home
string
`yaml:"home"`
}
// Maintainer describes a chart maintainer.
...
...
@@ -44,29 +39,6 @@ type Maintainer struct {
Email
string
`yaml:"email,omitempty"`
}
// Dependency describes a specific dependency.
type
Dependency
struct
{
Name
string
`yaml:"name,omitempty"`
Version
string
`yaml:"version"`
Location
string
`yaml:"location"`
}
// EnvConstraint specifies environmental constraints.
type
EnvConstraint
struct
{
Name
string
`yaml:"name"`
Version
string
`yaml:"version"`
Extensions
[]
string
`yaml:"extensions,omitempty"`
APIGroups
[]
string
`yaml:"apiGroups,omitempty"`
}
// Expander controls how template/ is evaluated.
type
Expander
struct
{
// Currently just Expandybird or GoTemplate
Name
string
`json:"name"`
// During evaluation, which file to start from.
Entrypoint
string
`json:"entrypoint"`
}
// LoadChartfile loads a Chart.yaml file into a *Chart.
func
LoadChartfile
(
filename
string
)
(
*
Chartfile
,
error
)
{
b
,
err
:=
ioutil
.
ReadFile
(
filename
)
...
...
@@ -91,20 +63,3 @@ func (c *Chartfile) Save(filename string) error {
func
(
c
*
Chartfile
)
Marshal
()
([]
byte
,
error
)
{
return
yaml
.
Marshal
(
c
)
}
// VersionOK returns true if the given version meets the constraints.
//
// It returns false if the version string or constraint is unparsable or if the
// version does not meet the constraint.
func
(
d
*
Dependency
)
VersionOK
(
version
string
)
bool
{
c
,
err
:=
semver
.
NewConstraint
(
d
.
Version
)
if
err
!=
nil
{
return
false
}
v
,
err
:=
semver
.
NewVersion
(
version
)
if
err
!=
nil
{
return
false
}
return
c
.
Check
(
v
)
}
pkg/chart/chartfile_test.go
View file @
47991c9c
...
...
@@ -27,10 +27,6 @@ func TestLoadChartfile(t *testing.T) {
return
}
if
len
(
f
.
Environment
[
0
]
.
Extensions
)
!=
2
{
t
.
Errorf
(
"Expected two extensions, got %d"
,
len
(
f
.
Environment
[
0
]
.
Extensions
))
}
if
f
.
Name
!=
"frobnitz"
{
t
.
Errorf
(
"Expected frobnitz, got %s"
,
f
.
Name
)
}
...
...
@@ -39,53 +35,7 @@ func TestLoadChartfile(t *testing.T) {
t
.
Errorf
(
"Expected 2 maintainers, got %d"
,
len
(
f
.
Maintainers
))
}
if
len
(
f
.
Dependencies
)
!=
1
{
t
.
Errorf
(
"Expected 2 dependencies, got %d"
,
len
(
f
.
Dependencies
))
}
if
f
.
Dependencies
[
0
]
.
Name
!=
"thingerbob"
{
t
.
Errorf
(
"Expected second dependency to be thingerbob: %q"
,
f
.
Dependencies
[
0
]
.
Name
)
}
if
f
.
Source
[
0
]
!=
"https://example.com/foo/bar"
{
t
.
Errorf
(
"Expected https://example.com/foo/bar, got %s"
,
f
.
Source
)
}
expander
:=
f
.
Expander
if
expander
==
nil
{
t
.
Errorf
(
"No expander found in %s"
,
testfile
)
}
else
{
if
expander
.
Name
!=
"Expandybird"
{
t
.
Errorf
(
"Expected expander name Expandybird, got %s"
,
expander
.
Name
)
}
if
expander
.
Entrypoint
!=
"templates/wordpress.jinja"
{
t
.
Errorf
(
"Expected expander entrypoint templates/wordpress.jinja, got %s"
,
expander
.
Entrypoint
)
}
}
if
f
.
Schema
!=
"wordpress.jinja.schema"
{
t
.
Errorf
(
"Expected schema wordpress.jinja.schema, got %s"
,
f
.
Schema
)
}
}
func
TestVersionOK
(
t
*
testing
.
T
)
{
f
,
err
:=
LoadChartfile
(
testfile
)
if
err
!=
nil
{
t
.
Errorf
(
"Error loading %s: %s"
,
testfile
,
err
)
}
// These are canaries. The SemVer package exhuastively tests the
// various permutations. This will alert us if we wired it up
// incorrectly.
d
:=
f
.
Dependencies
[
0
]
if
d
.
VersionOK
(
"1.0.0"
)
{
t
.
Errorf
(
"1.0.0 should have been marked out of range"
)
}
if
!
d
.
VersionOK
(
"3.2.3"
)
{
t
.
Errorf
(
"Version 3.2.3 should have been marked in-range"
)
}
}
pkg/chart/save_test.go
View file @
47991c9c
...
...
@@ -23,6 +23,7 @@ import (
"io/ioutil"
"os"
"path/filepath"
"sort"
"testing"
)
...
...
@@ -66,20 +67,16 @@ func TestSave(t *testing.T) {
expect
:=
[]
string
{
"sprocket"
,
"sprocket/Chart.yaml"
,
"sprocket/LICENSE"
,
"sprocket/README.md"
,
"sprocket/docs"
,
"sprocket/docs/README.md"
,
"sprocket/hooks"
,
"sprocket/hooks/pre-install.py"
,
"sprocket/icon.svg"
,
"sprocket/values.toml"
,
"sprocket/templates"
,
"sprocket/templates/
placeholder.txt
"
,
"sprocket/templates/
template.tpl
"
,
}
if
len
(
expect
)
!=
len
(
files
)
{
t
.
Errorf
(
"Expected %d files, found %d"
,
len
(
expect
),
len
(
files
))
return
}
sort
.
Strings
(
files
)
sort
.
Strings
(
expect
)
for
i
:=
0
;
i
<
len
(
expect
);
i
++
{
if
expect
[
i
]
!=
files
[
i
]
{
t
.
Errorf
(
"Expected file %q, got %q"
,
expect
[
i
],
files
[
i
])
...
...
pkg/chart/testdata/README.md
View file @
47991c9c
The testdata directory here holds charts that match the specification.
The
`fromnitz/`
directory contains a chart that matches the chart
specification.
The
`frobnitz-0.0.1.tgz`
file is an archive of the
`frobnitz`
directory.
The
`ill`
chart and directory is a chart that is not 100% compatible,
but which should still be parseable.
This directory houses charts used in testing.
pkg/chart/testdata/frobnitz-0.0.1.tgz
View file @
47991c9c
No preview for this file type
pkg/chart/testdata/frobnitz/Chart.toml
0 → 100644
View file @
47991c9c
name
=
"frobnitz"
description
=
"This is a frobniz."
version
=
"1.2.3-alpha.1+12345"
keywords
=
[
"frobnitz"
,
"sprocket"
,
"dodad"
]
home
=
"http://example.com"
source
=
[
"https://example.com/foo/bar"
,
"https://github.com/example/foo"
]
[[maintainer]]
name
=
"The Helm Team"
email
=
"helm@example.com"
[[maintainer]]
name
=
"Someone Else"
email
=
"nobody@example.com"
pkg/chart/testdata/frobnitz/Chart.yaml
View file @
47991c9c
#helm:generate foo
name
:
frobnitz
description
:
This is a frobniz.
version
:
"
1.2.3-alpha.1+12345"
...
...
@@ -14,20 +13,3 @@ maintainers:
source
:
-
https://example.com/foo/bar
home
:
http://example.com
dependencies
:
-
name
:
thingerbob
location
:
https://example.com/charts/thingerbob-3.2.1.tgz
version
:
^3
environment
:
-
name
:
Kubernetes
version
:
~1.1
extensions
:
-
extensions/v1beta1
-
extensions/v1beta1/daemonset
apiGroups
:
-
3rdParty
expander
:
name
:
Expandybird
entrypoint
:
templates/wordpress.jinja
schema
:
wordpress.jinja.schema
\ No newline at end of file
pkg/chart/testdata/frobnitz/INSTALL.txt
0 → 100644
View file @
47991c9c
This is an install document. The client may display this.
pkg/chart/testdata/frobnitz/hooks/pre-install.py
deleted
100644 → 0
View file @
5b78c77f
# Placeholder.
pkg/chart/testdata/frobnitz/templates/template.tpl
0 → 100644
View file @
47991c9c
Hello {{.Name | default "world"}}
pkg/chart/testdata/frobnitz/templates/wordpress-resources.yaml
deleted
100644 → 0
View file @
5b78c77f
# Google Cloud Deployment Manager template
resources
:
-
name
:
nfs-disk
type
:
compute.v1.disk
properties
:
zone
:
us-central1-b
sizeGb
:
200
-
name
:
mysql-disk
type
:
compute.v1.disk
properties
:
zone
:
us-central1-b
sizeGb
:
200
pkg/chart/testdata/frobnitz/templates/wordpress.jinja
deleted
100644 → 0
View file @
5b78c77f
#helm:generate dm_template
{% set PROPERTIES = properties or {} %}
{% set PROJECT = PROPERTIES['project'] or 'dm-k8s-testing' %}
{% set NFS_SERVER = PROPERTIES['nfs-server'] or {} %}
{% set NFS_SERVER_IP = NFS_SERVER['ip'] or '10.0.253.247' %}
{% set NFS_SERVER_PORT = NFS_SERVER['port'] or 2049 %}
{% set NFS_SERVER_DISK = NFS_SERVER['disk'] or 'nfs-disk' %}
{% set NFS_SERVER_DISK_FSTYPE = NFS_SERVER['fstype'] or 'ext4' %}
{% set NGINX = PROPERTIES['nginx'] or {} %}
{% set NGINX_PORT = 80 %}
{% set NGINX_REPLICAS = NGINX['replicas'] or 2 %}
{% set WORDPRESS_PHP = PROPERTIES['wordpress-php'] or {} %}
{% set WORDPRESS_PHP_REPLICAS = WORDPRESS_PHP['replicas'] or 2 %}
{% set WORDPRESS_PHP_PORT = WORDPRESS_PHP['port'] or 9000 %}
{% set MYSQL = PROPERTIES['mysql'] or {} %}
{% set MYSQL_PORT = MYSQL['port'] or 3306 %}
{% set MYSQL_PASSWORD = MYSQL['password'] or 'mysql-password' %}
{% set MYSQL_DISK = MYSQL['disk'] or 'mysql-disk' %}
{% set MYSQL_DISK_FSTYPE = MYSQL['fstype'] or 'ext4' %}
resources:
- name: nfs
type: github.com/kubernetes/application-dm-templates/storage/nfs:v1
properties:
ip: {{ NFS_SERVER_IP }}
port: {{ NFS_SERVER_PORT }}
disk: {{ NFS_SERVER_DISK }}
fstype: {{NFS_SERVER_DISK_FSTYPE }}
- name: nginx
type: github.com/kubernetes/application-dm-templates/common/replicatedservice:v2
properties:
service_port: {{ NGINX_PORT }}
container_port: {{ NGINX_PORT }}
replicas: {{ NGINX_REPLICAS }}
external_service: true
image: gcr.io/{{ PROJECT }}/nginx:latest
volumes:
- mount_path: /var/www/html
persistentVolumeClaim:
claimName: nfs
- name: mysql
type: github.com/kubernetes/application-dm-templates/common/replicatedservice:v2
properties:
service_port: {{ MYSQL_PORT }}
container_port: {{ MYSQL_PORT }}
replicas: 1
image: mysql:5.6
env:
- name: MYSQL_ROOT_PASSWORD
value: {{ MYSQL_PASSWORD }}
volumes:
- mount_path: /var/lib/mysql
gcePersistentDisk:
pdName: {{ MYSQL_DISK }}
fsType: {{ MYSQL_DISK_FSTYPE }}
- name: wordpress-php
type: github.com/kubernetes/application-dm-templates/common/replicatedservice:v2
properties:
service_name: wordpress-php
service_port: {{ WORDPRESS_PHP_PORT }}
container_port: {{ WORDPRESS_PHP_PORT }}
replicas: 2
image: wordpress:fpm
env:
- name: WORDPRESS_DB_PASSWORD
value: {{ MYSQL_PASSWORD }}
- name: WORDPRESS_DB_HOST
value: mysql-service
volumes:
- mount_path: /var/www/html
persistentVolumeClaim:
claimName: nfs
pkg/chart/testdata/frobnitz/templates/wordpress.jinja.schema
deleted
100644 → 0
View file @
5b78c77f
info:
title: Wordpress
description: |
Defines a Wordpress website by defining four replicated services: an NFS service, an nginx service, a wordpress-php service, and a MySQL service.
The nginx service and the Wordpress-php service both use NFS to share files.
properties:
project:
type: string
default: dm-k8s-testing
description: Project location to load the images from.
nfs-service:
type: object
properties:
ip:
type: string
default: 10.0.253.247
description: The IP of the NFS service.
port:
type: int
default: 2049
description: The port of the NFS service.
disk:
type: string
default: nfs-disk
description: The name of the persistent disk the NFS service uses.
fstype:
type: string
default: ext4
description: The filesystem the disk of the NFS service uses.
nginx:
type: object
properties:
replicas:
type: int
default: 2
description: The number of replicas for the nginx service.
wordpress-php:
type: object
properties:
replicas:
type: int
default: 2
description: The number of replicas for the wordpress-php service.
port:
type: int
default: 9000
description: The port the wordpress-php service runs on.
mysql:
type: object
properties:
port:
type: int
default: 3306
description: The port the MySQL service runs on.
password:
type: string
default: mysql-password
description: The root password of the MySQL service.
disk:
type: string
default: mysql-disk
description: The name of the persistent disk the MySQL service uses.
fstype:
type: string
default: ext4
description: The filesystem the disk of the MySQL service uses.
pkg/chart/testdata/frobnitz/templates/wordpress.yaml
deleted
100644 → 0
View file @
5b78c77f
imports
:
-
path
:
wordpress.jinja
resources
:
-
name
:
wordpress
type
:
wordpress.jinja
pkg/chart/testdata/frobnitz/values.toml
0 → 100644
View file @
47991c9c
# A values file contains configuration.
name
=
"Some Name"
[section]
name
=
"Name in a section"
pkg/chart/testdata/ill-1.2.3.tgz
deleted
100644 → 0
View file @
5b78c77f
File deleted
pkg/chart/testdata/ill/Chart.yaml
deleted
100644 → 0
View file @
5b78c77f
#helm:generate foo
name
:
ill
description
:
This is a frobniz.
version
:
"
1.2.3-alpha.1+12345"
keywords
:
-
ill
-
sprocket
-
dodad
maintainers
:
-
name
:
The Helm Team
email
:
helm@example.com
-
name
:
Someone Else
email
:
nobody@example.com
source
:
-
https://example.com/foo/bar
home
:
http://example.com
dependencies
:
-
name
:
thingerbob
location
:
https://example.com/charts/thingerbob-3.2.1.tgz
version
:
^3
environment
:
-
name
:
Kubernetes
version
:
~1.1
extensions
:
-
extensions/v1beta1
-
extensions/v1beta1/daemonset
apiGroups
:
-
3rdParty
pkg/chart/testdata/ill/LICENSE
deleted
100644 → 0
View file @
5b78c77f
LICENSE placeholder.
pkg/chart/testdata/ill/README.md
deleted
100644 → 0
View file @
5b78c77f
# Frobnitz
This is an example chart.
## Usage
This is an example. It has no usage.
## Development
For developer info, see the top-level repository.
pkg/chart/testdata/ill/docs/README.md
deleted
100644 → 0
View file @
5b78c77f
This is a placeholder for documentation.
pkg/chart/testdata/ill/hooks/pre-install.py
deleted
100644 → 0
View file @
5b78c77f
# Placeholder.
pkg/chart/testdata/ill/templates/wordpress-resources.yaml
deleted
100644 → 0
View file @
5b78c77f
# Google Cloud Deployment Manager template
resources
:
-
name
:
nfs-disk
type
:
compute.v1.disk
properties
:
zone
:
us-central1-b
sizeGb
:
200
-
name
:
mysql-disk
type
:
compute.v1.disk
properties
:
zone
:
us-central1-b
sizeGb
:
200
pkg/chart/testdata/ill/templates/wordpress.jinja
deleted
100644 → 0
View file @
5b78c77f
#helm:generate dm_template
{% set PROPERTIES = properties or {} %}
{% set PROJECT = PROPERTIES['project'] or 'dm-k8s-testing' %}
{% set NFS_SERVER = PROPERTIES['nfs-server'] or {} %}
{% set NFS_SERVER_IP = NFS_SERVER['ip'] or '10.0.253.247' %}
{% set NFS_SERVER_PORT = NFS_SERVER['port'] or 2049 %}
{% set NFS_SERVER_DISK = NFS_SERVER['disk'] or 'nfs-disk' %}
{% set NFS_SERVER_DISK_FSTYPE = NFS_SERVER['fstype'] or 'ext4' %}
{% set NGINX = PROPERTIES['nginx'] or {} %}
{% set NGINX_PORT = 80 %}
{% set NGINX_REPLICAS = NGINX['replicas'] or 2 %}
{% set WORDPRESS_PHP = PROPERTIES['wordpress-php'] or {} %}
{% set WORDPRESS_PHP_REPLICAS = WORDPRESS_PHP['replicas'] or 2 %}
{% set WORDPRESS_PHP_PORT = WORDPRESS_PHP['port'] or 9000 %}
{% set MYSQL = PROPERTIES['mysql'] or {} %}
{% set MYSQL_PORT = MYSQL['port'] or 3306 %}
{% set MYSQL_PASSWORD = MYSQL['password'] or 'mysql-password' %}
{% set MYSQL_DISK = MYSQL['disk'] or 'mysql-disk' %}
{% set MYSQL_DISK_FSTYPE = MYSQL['fstype'] or 'ext4' %}
resources:
- name: nfs
type: github.com/kubernetes/application-dm-templates/storage/nfs:v1
properties:
ip: {{ NFS_SERVER_IP }}
port: {{ NFS_SERVER_PORT }}
disk: {{ NFS_SERVER_DISK }}
fstype: {{NFS_SERVER_DISK_FSTYPE }}
- name: nginx
type: github.com/kubernetes/application-dm-templates/common/replicatedservice:v2
properties:
service_port: {{ NGINX_PORT }}
container_port: {{ NGINX_PORT }}
replicas: {{ NGINX_REPLICAS }}
external_service: true
image: gcr.io/{{ PROJECT }}/nginx:latest
volumes:
- mount_path: /var/www/html
persistentVolumeClaim:
claimName: nfs
- name: mysql
type: github.com/kubernetes/application-dm-templates/common/replicatedservice:v2
properties:
service_port: {{ MYSQL_PORT }}
container_port: {{ MYSQL_PORT }}
replicas: 1
image: mysql:5.6
env:
- name: MYSQL_ROOT_PASSWORD
value: {{ MYSQL_PASSWORD }}
volumes:
- mount_path: /var/lib/mysql
gcePersistentDisk:
pdName: {{ MYSQL_DISK }}
fsType: {{ MYSQL_DISK_FSTYPE }}
- name: wordpress-php
type: github.com/kubernetes/application-dm-templates/common/replicatedservice:v2
properties:
service_name: wordpress-php
service_port: {{ WORDPRESS_PHP_PORT }}
container_port: {{ WORDPRESS_PHP_PORT }}
replicas: 2
image: wordpress:fpm
env:
- name: WORDPRESS_DB_PASSWORD
value: {{ MYSQL_PASSWORD }}
- name: WORDPRESS_DB_HOST
value: mysql-service
volumes:
- mount_path: /var/www/html
persistentVolumeClaim:
claimName: nfs
pkg/chart/testdata/ill/templates/wordpress.jinja.schema
deleted
100644 → 0
View file @
5b78c77f
info:
title: Wordpress
description: |
Defines a Wordpress website by defining four replicated services: an NFS service, an nginx service, a wordpress-php service, and a MySQL service.
The nginx service and the Wordpress-php service both use NFS to share files.
properties:
project:
type: string
default: dm-k8s-testing
description: Project location to load the images from.
nfs-service:
type: object
properties:
ip:
type: string
default: 10.0.253.247
description: The IP of the NFS service.
port:
type: int
default: 2049
description: The port of the NFS service.
disk:
type: string
default: nfs-disk
description: The name of the persistent disk the NFS service uses.
fstype:
type: string
default: ext4
description: The filesystem the disk of the NFS service uses.
nginx:
type: object
properties:
replicas:
type: int
default: 2
description: The number of replicas for the nginx service.
wordpress-php:
type: object
properties:
replicas:
type: int
default: 2
description: The number of replicas for the wordpress-php service.
port:
type: int
default: 9000
description: The port the wordpress-php service runs on.
mysql:
type: object
properties:
port:
type: int
default: 3306
description: The port the MySQL service runs on.
password:
type: string
default: mysql-password
description: The root password of the MySQL service.
disk:
type: string
default: mysql-disk
description: The name of the persistent disk the MySQL service uses.
fstype:
type: string
default: ext4
description: The filesystem the disk of the MySQL service uses.
pkg/chart/testdata/ill/templates/wordpress.yaml
deleted
100644 → 0
View file @
5b78c77f
imports
:
-
path
:
wordpress.jinja
resources
:
-
name
:
wordpress
type
:
wordpress.jinja
pkg/chart/testdata/nochart.tgz
deleted
100644 → 0
View file @
5b78c77f
File deleted
pkg/chart/testdata/sprocket/Chart.yaml
View file @
47991c9c
name
:
sprocket
description
:
This is a sprocket
.
description
:
This is a sprocket
"
version
:
1.2.3-alpha.1+12345
home
:
"
"
keywords
:
-
frobnitz
-
sprocket
-
dodad
maintainers
:
-
name
:
The Helm Team
email
:
helm@example.com
-
name
:
Someone Else
email
:
nobody@example.com
source
:
-
https://example.com/foo/bar
home
:
http://example.com
pkg/chart/testdata/sprocket/LICENSE
deleted
100644 → 0
View file @
5b78c77f
LICENSE placeholder.
pkg/chart/testdata/sprocket/README.md
deleted
100644 → 0
View file @
5b78c77f
# Sprocket
This is an example chart.
pkg/chart/testdata/sprocket/docs/README.md
deleted
100644 → 0
View file @
5b78c77f
This is a placeholder for documentation.
pkg/chart/testdata/sprocket/hooks/pre-install.py
deleted
100644 → 0
View file @
5b78c77f
# Placeholder.
pkg/chart/testdata/sprocket/icon.svg
deleted
100644 → 0
View file @
5b78c77f
<?xml version="1.0"?>
<svg
xmlns:svg=
"http://www.w3.org/2000/svg"
xmlns=
"http://www.w3.org/2000/svg"
xmlns:xlink=
"http://www.w3.org/1999/xlink"
version=
"1.0"
width=
"256"
height=
"256"
id=
"test"
>
<desc>
Example icon
</desc>
<rect
id=
"first"
x=
"2"
y=
"2"
width=
"40"
height=
"60"
fill=
"navy"
/>
<rect
id=
"second"
x=
"15"
y=
"4"
width=
"40"
height=
"60"
fill=
"red"
/>
</svg>
pkg/chart/testdata/sprocket/templates/placeholder.txt
deleted
100644 → 0
View file @
5b78c77f
This is a placeholder.
pkg/chart/testdata/sprocket/templates/template.tpl
0 → 100644
View file @
47991c9c
Hello {{.Name | default "world"}}
pkg/chart/testdata/sprocket/values.toml
0 → 100644
View file @
47991c9c
# A values file contains configuration.
name
=
"Some Name"
[section]
name
=
"Name in a section"
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment