-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2db69e4
commit dd18189
Showing
3 changed files
with
35 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
# Simple example of creating 3 Kubernetes namespaces | ||
users = [ 'bob', 'sue', 'sally'] | ||
|
||
# Our users in need of namespaces | ||
users = ['jim', 'sally', 'sue'] | ||
# This Python object is defined by inline YAML | ||
namespace = < | ||
apiVersion: v1 | ||
kind: Namespace | ||
metadata: | ||
# The !~ syntax enables python substitution, in this case a variable named `userName` | ||
name: !~ user | ||
> | ||
|
||
# The namespaces objects from YAML | ||
namespaces = map(lambda user: < | ||
apiVersion: v1 | ||
kind: Namespace | ||
metadata: | ||
name: !~ user | ||
>, users) | ||
|
||
# Output | ||
render(namespaces) | ||
for user in users: | ||
namespace.render() | ||
print("---") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
# Simple example of creating 5 Kubernetes namespaces | ||
users = [ 'bob', 'sue', 'sally', 'jim'] | ||
# Simple example of creating 3 Kubernetes namespaces | ||
|
||
# This Python object is defined by inline YAML | ||
namespace = < | ||
apiVersion: v1 | ||
kind: Namespace | ||
metadata: | ||
# The !~ syntax enables python substitution, in this case a variable named `userName` | ||
name: !~ user | ||
> | ||
# Our users in need of namespaces | ||
users = ['jim', 'sally', 'sue'] | ||
|
||
for user in users: | ||
namespace.render() | ||
print("---") | ||
# The namespaces objects from YAML | ||
namespaces = map(lambda user: < | ||
apiVersion: v1 | ||
kind: Namespace | ||
metadata: | ||
name: !~ user | ||
>, users) | ||
|
||
# Output | ||
render(namespaces) |