Browse Source

more apps

pull/43/head
arun-vc 5 years ago
parent
commit
ad34a704ea
  1. 239
      application-crds/base/crd.yaml
  2. 4
      application-crds/base/kustomization.yaml
  3. 5
      application-crds/kustomization.yaml
  4. 11
      application/base/cluster-role-binding.yaml
  5. 21
      application/base/cluster-role.yaml
  6. 29
      application/base/kustomization.yaml
  7. 1
      application/base/params.env
  8. 3
      application/base/params.yaml
  9. 4
      application/base/service-account.yaml
  10. 7
      application/base/service.yaml
  11. 27
      application/base/stateful-set.yaml
  12. 15
      application/kustomization.yaml
  13. 34
      application/overlays/application/application.yaml
  14. 13
      application/overlays/application/kustomization.yaml
  15. 10
      application/overlays/debug/kustomization.yaml
  16. 25
      application/overlays/debug/stateful-set.yaml
  17. 19
      apps/templates/application-crds.yaml
  18. 16
      apps/templates/application.yaml
  19. 16
      apps/templates/jupyter-web-app.yaml
  20. 7
      apps/templates/namespaces.yaml
  21. 21
      blue-green/.helmignore
  22. 5
      blue-green/Chart.yaml
  23. 30
      blue-green/README.md
  24. 19
      blue-green/templates/NOTES.txt
  25. 32
      blue-green/templates/_helpers.tpl
  26. 56
      blue-green/templates/rollout.yaml
  27. 40
      blue-green/templates/services.yaml
  28. 45
      blue-green/values.yaml
  29. 20
      guestbook/guestbook-ui-deployment.yaml
  30. 10
      guestbook/guestbook-ui-svc.yaml
  31. 1
      helm-dependency/Chart.yaml
  32. 55
      helm-dependency/README.md
  33. 4
      helm-dependency/requirements.yaml
  34. 13
      helm-dependency/values-nomaria.yaml
  35. 7
      helm-dependency/values.yaml
  36. 21
      helm-guestbook/.helmignore
  37. 5
      helm-guestbook/Chart.yaml
  38. 19
      helm-guestbook/templates/NOTES.txt
  39. 32
      helm-guestbook/templates/_helpers.tpl
  40. 52
      helm-guestbook/templates/deployment.yaml
  41. 19
      helm-guestbook/templates/service.yaml
  42. 2
      helm-guestbook/values-production.yaml
  43. 45
      helm-guestbook/values.yaml
  44. 65
      jsonnet-guestbook-tla/guestbook-ui.jsonnet
  45. 59
      jsonnet-guestbook/guestbook-ui.jsonnet
  46. 8
      jsonnet-guestbook/params.libsonnet
  47. 11
      jupyter-web-app/base/cluster-role-binding.yaml
  48. 54
      jupyter-web-app/base/cluster-role.yaml
  49. 127
      jupyter-web-app/base/config-map.yaml
  50. 37
      jupyter-web-app/base/deployment.yaml
  51. 70
      jupyter-web-app/base/kustomization.yaml
  52. 7
      jupyter-web-app/base/params.env
  53. 9
      jupyter-web-app/base/params.yaml
  54. 11
      jupyter-web-app/base/role-binding.yaml
  55. 35
      jupyter-web-app/base/role.yaml
  56. 4
      jupyter-web-app/base/service-account.yaml
  57. 23
      jupyter-web-app/base/service.yaml
  58. 15
      jupyter-web-app/kustomization.yaml
  59. 49
      jupyter-web-app/overlays/application/application.yaml
  60. 13
      jupyter-web-app/overlays/application/kustomization.yaml
  61. 6
      jupyter-web-app/overlays/istio/kustomization.yaml
  62. 3
      jupyter-web-app/overlays/istio/params.yaml
  63. 24
      jupyter-web-app/overlays/istio/virtual-service.yaml
  64. 4
      ksonnet-guestbook/.gitignore
  65. 23
      ksonnet-guestbook/app.yaml
  66. 59
      ksonnet-guestbook/components/guestbook-ui.jsonnet
  67. 18
      ksonnet-guestbook/components/params.libsonnet
  68. 4
      ksonnet-guestbook/environments/base.libsonnet
  69. 2
      ksonnet-guestbook/environments/default/globals.libsonnet
  70. 8
      ksonnet-guestbook/environments/default/main.jsonnet
  71. 17
      ksonnet-guestbook/environments/default/params.libsonnet
  72. 2
      ksonnet-guestbook/environments/dev/globals.libsonnet
  73. 8
      ksonnet-guestbook/environments/dev/main.jsonnet
  74. 17
      ksonnet-guestbook/environments/dev/params.libsonnet
  75. 2
      ksonnet-guestbook/environments/prod/globals.libsonnet
  76. 8
      ksonnet-guestbook/environments/prod/main.jsonnet
  77. 17
      ksonnet-guestbook/environments/prod/params.libsonnet
  78. 20
      kustomize-guestbook/guestbook-ui-deployment.yaml
  79. 10
      kustomize-guestbook/guestbook-ui-svc.yaml
  80. 7
      kustomize-guestbook/kustomization.yaml

239
application-crds/base/crd.yaml

@ -0,0 +1,239 @@
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
creationTimestamp: null
name: applications.app.k8s.io
spec:
group: app.k8s.io
names:
kind: Application
plural: applications
scope: Namespaced
validation:
openAPIV3Schema:
properties:
apiVersion:
type: string
kind:
type: string
metadata:
type: object
spec:
properties:
addOwnerRef:
type: boolean
assemblyPhase:
type: string
componentKinds:
items:
type: object
type: array
descriptor:
properties:
description:
type: string
icons:
items:
properties:
size:
type: string
src:
type: string
type:
type: string
required:
- src
type: object
type: array
keywords:
items:
type: string
type: array
links:
items:
properties:
description:
type: string
url:
type: string
type: object
type: array
maintainers:
items:
properties:
email:
type: string
name:
type: string
url:
type: string
type: object
type: array
notes:
type: string
owners:
items:
properties:
email:
type: string
name:
type: string
url:
type: string
type: object
type: array
type:
type: string
version:
type: string
type: object
info:
items:
properties:
name:
type: string
type:
type: string
value:
type: string
valueFrom:
properties:
configMapKeyRef:
properties:
apiVersion:
type: string
fieldPath:
type: string
key:
type: string
kind:
type: string
name:
type: string
namespace:
type: string
resourceVersion:
type: string
uid:
type: string
type: object
ingressRef:
properties:
apiVersion:
type: string
fieldPath:
type: string
host:
type: string
kind:
type: string
name:
type: string
namespace:
type: string
path:
type: string
resourceVersion:
type: string
uid:
type: string
type: object
secretKeyRef:
properties:
apiVersion:
type: string
fieldPath:
type: string
key:
type: string
kind:
type: string
name:
type: string
namespace:
type: string
resourceVersion:
type: string
uid:
type: string
type: object
serviceRef:
properties:
apiVersion:
type: string
fieldPath:
type: string
kind:
type: string
name:
type: string
namespace:
type: string
path:
type: string
port:
format: int32
type: integer
resourceVersion:
type: string
uid:
type: string
type: object
type:
type: string
type: object
type: object
type: array
selector:
type: object
type: object
status:
properties:
components:
items:
properties:
group:
type: string
kind:
type: string
link:
type: string
name:
type: string
status:
type: string
type: object
type: array
conditions:
items:
properties:
lastTransitionTime:
format: date-time
type: string
lastUpdateTime:
format: date-time
type: string
message:
type: string
reason:
type: string
status:
type: string
type:
type: string
required:
- type
- status
type: object
type: array
observedGeneration:
format: int64
type: integer
type: object
version: v1beta1
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []

4
application-crds/base/kustomization.yaml

@ -0,0 +1,4 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- crd.yaml

5
application-crds/kustomization.yaml

@ -0,0 +1,5 @@
apiVersion: kustomize.config.k8s.io/v1beta1
bases:
- base
kind: Kustomization
namespace: kubeflow

11
application/base/cluster-role-binding.yaml

@ -0,0 +1,11 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: cluster-role-binding
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: cluster-role
subjects:
- kind: ServiceAccount
name: service-account

21
application/base/cluster-role.yaml

@ -0,0 +1,21 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: cluster-role
rules:
- apiGroups:
- '*'
resources:
- '*'
verbs:
- get
- list
- update
- patch
- watch
- apiGroups:
- app.k8s.io
resources:
- '*'
verbs:
- '*'

29
application/base/kustomization.yaml

@ -0,0 +1,29 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- cluster-role.yaml
- cluster-role-binding.yaml
- service-account.yaml
- service.yaml
- stateful-set.yaml
namespace: kubeflow
nameprefix: application-controller-
configMapGenerator:
- name: parameters
env: params.env
generatorOptions:
disableNameSuffixHash: true
images:
- name: gcr.io/kubeflow-images-public/kubernetes-sigs/application
newName: gcr.io/kubeflow-images-public/kubernetes-sigs/application
newTag: 1.0-beta
vars:
- name: project
objref:
kind: ConfigMap
name: parameters
apiVersion: v1
fieldref:
fieldpath: data.project
configurations:
- params.yaml

1
application/base/params.env

@ -0,0 +1 @@
project=

3
application/base/params.yaml

@ -0,0 +1,3 @@
varReference:
- path: spec/template/spec/containers/image
kind: StatefulSet

4
application/base/service-account.yaml

@ -0,0 +1,4 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: service-account

7
application/base/service.yaml

@ -0,0 +1,7 @@
apiVersion: v1
kind: Service
metadata:
name: service
spec:
ports:
- port: 443

27
application/base/stateful-set.yaml

@ -0,0 +1,27 @@
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: stateful-set
spec:
serviceName: service
selector:
matchLabels:
app: application-controller
template:
metadata:
labels:
app: application-controller
annotations:
sidecar.istio.io/inject: "false"
spec:
containers:
- name: manager
command:
- /root/manager
image: gcr.io/kubeflow-images-public/kubernetes-sigs/application
imagePullPolicy: Always
env:
- name: project
value: $(project)
serviceAccountName: service-account
volumeClaimTemplates: []

15
application/kustomization.yaml

@ -0,0 +1,15 @@
apiVersion: kustomize.config.k8s.io/v1beta1
bases:
- base
commonLabels:
app.kubernetes.io/component: kubeflow
app.kubernetes.io/instance: kubeflow-v0.7.0
app.kubernetes.io/managed-by: kfctl
app.kubernetes.io/name: kubeflow
app.kubernetes.io/part-of: kubeflow
app.kubernetes.io/version: v0.7.0
kind: Kustomization
namespace: kubeflow
resources:
- overlays/application/application.yaml
namePrefix: application1

34
application/overlays/application/application.yaml

@ -0,0 +1,34 @@
apiVersion: app.k8s.io/v1beta1
kind: Application
metadata:
name: kubeflow
spec:
selector:
matchLabels:
app.kubernetes.io/name: kubeflow
app.kubernetes.io/instance: kubeflow-v0.7.0
app.kubernetes.io/managed-by: kfctl
app.kubernetes.io/component: kubeflow
app.kubernetes.io/part-of: kubeflow
app.kubernetes.io/version: v0.7.0
componentKinds:
- group: app.k8s.io
kind: Application
descriptor:
type: kubeflow
version: v1beta1
description: application that aggregates all kubeflow applications
maintainers:
- name: Jeremy Lewi
email: jlewi@google.com
- name: Kam Kasravi
email: kam.d.kasravi@intel.com
owners:
- name: Jeremy Lewi
email: jlewi@google.com
keywords:
- kubeflow
links:
- description: About
url: "https://kubeflow.org"
addOwnerRef: true

13
application/overlays/application/kustomization.yaml

@ -0,0 +1,13 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
bases:
- ../../base
resources:
- application.yaml
commonLabels:
app.kubernetes.io/name: kubeflow
app.kubernetes.io/instance: kubeflow-v0.7.0
app.kubernetes.io/managed-by: kfctl
app.kubernetes.io/component: kubeflow
app.kubernetes.io/part-of: kubeflow
app.kubernetes.io/version: v0.7.0

10
application/overlays/debug/kustomization.yaml

@ -0,0 +1,10 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
bases:
- ../../base
patchesStrategicMerge:
- stateful-set.yaml
images:
- name: gcr.io/$(project)/application-controller
newName: gcr.io/$(project)/application-controller
newTag: latest

25
application/overlays/debug/stateful-set.yaml

@ -0,0 +1,25 @@
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: stateful-set
spec:
template:
metadata:
annotations:
sidecar.istio.io/inject: "false"
spec:
containers:
- name: manager
image: gcr.io/$(project)/application-controller:latest
command:
- /go/bin/dlv
args:
- --listen=:2345
- --headless=true
- --api-version=2
- exec
- /go/src/github.com/kubernetes-sigs/application/manager
ports:
- containerPort: 2345
securityContext:
privileged: true

19
apps/templates/application-crds.yaml

@ -0,0 +1,19 @@
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: application-crds
namespace: kubeflow
finalizers:
- resources-finalizer.argocd.argoproj.io
spec:
destination:
namespace: kubeflow
server: {{ .Values.spec.destination.server }}
project: default
source:
path: application-crds
repoURL: {{ .Values.spec.source.repoURL }}
targetRevision: {{ .Values.spec.source.targetRevision }}

16
apps/templates/application.yaml

@ -0,0 +1,16 @@
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: application
namespace: kubeflow
finalizers:
- resources-finalizer.argocd.argoproj.io
spec:
destination:
namespace: kubeflow
server: {{ .Values.spec.destination.server }}
project: default
source:
path: application
repoURL: {{ .Values.spec.source.repoURL }}
targetRevision: {{ .Values.spec.source.targetRevision }}

16
apps/templates/jupyter-web-app.yaml

@ -0,0 +1,16 @@
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: jupyter-web-app
namespace: kubeflow
finalizers:
- resources-finalizer.argocd.argoproj.io
spec:
destination:
namespace: kubeflow
server: {{ .Values.spec.destination.server }}
project: default
source:
path: jupyter-web-app
repoURL: {{ .Values.spec.source.repoURL }}
targetRevision: {{ .Values.spec.source.targetRevision }}

7
apps/templates/namespaces.yaml

@ -11,3 +11,10 @@ metadata:
name: sync-waves
annotations:
argocd.argoproj.io/sync-wave: "-1"
---
apiVersion: v1
kind: Namespace
metadata:
name: kubeflow
annotations:
argocd.argoproj.io/sync-wave: "-1"

21
blue-green/.helmignore

@ -1,21 +0,0 @@
# 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

5
blue-green/Chart.yaml

@ -1,5 +0,0 @@
apiVersion: v1
appVersion: "1.0"
description: A Helm chart for Kubernetes
name: helm-guestbook
version: 0.1.0

30
blue-green/README.md

@ -1,30 +0,0 @@
# Blue Green
The blue green strategy is not supported by built-in Kubernetes Deployment but available via third-party Kubernetes controller.
This example demonstrates how to implement blue-green deployment via [Argo Rollouts](https://github.com/argoproj/argo-rollouts):
1. Install Argo Rollouts controller: https://github.com/argoproj/argo-rollouts#installation
2. Create a sample application and sync it.
```
argocd app create --name blue-green --repo https://github.com/argoproj/argocd-example-apps --dest-server https://kubernetes.default.svc --dest-namespace default --path blue-green && argocd app sync blue-green
```
Once the application is synced you can access it using `blue-green-helm-guestbook` service.
3. Change image version parameter to trigger blue-green deployment process:
```
argocd app set blue-green -p image.tag=0.2 && argocd app sync blue-green
```
Now application runs `ks-guestbook-demo:0.1` and `ks-guestbook-demo:0.2` images simultaneously.
The `ks-guestbook-demo:0.2` is still considered `blue` available only via preview service `blue-green-helm-guestbook-preview`.
4. Promote `ks-guestbook-demo:0.2` to `green` by patching `Rollout` resource:
```
argocd app patch-resource blue-green --kind Rollout --resource-name blue-green-helm-guestbook --patch '{ "status": { "verifyingPreview": false } }' --patch-type 'application/merge-patch+json'
```
This promotes `ks-guestbook-demo:0.2` to `green` status and `Rollout` deletes old replica which runs `ks-guestbook-demo:0.1`.

19
blue-green/templates/NOTES.txt

@ -1,19 +0,0 @@
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.service.type }}
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ template "helm-guestbook.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.service.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 -w {{ template "helm-guestbook.fullname" . }}'
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "helm-guestbook.fullname" . }} -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
echo http://$SERVICE_IP:{{ .Values.service.port }}
{{- else if contains "ClusterIP" .Values.service.type }}
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app={{ template "helm-guestbook.name" . }},release={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
echo "Visit http://127.0.0.1:8080 to use your application"
kubectl port-forward $POD_NAME 8080:80
{{- end }}

32
blue-green/templates/_helpers.tpl

@ -1,32 +0,0 @@
{{/* vim: set filetype=mustache: */}}
{{/*
Expand the name of the chart.
*/}}
{{- define "helm-guestbook.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 "helm-guestbook.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 "helm-guestbook.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
{{- end -}}

56
blue-green/templates/rollout.yaml

@ -1,56 +0,0 @@
apiVersion: argoproj.io/v1alpha1
kind: Rollout
metadata:
name: {{ template "helm-guestbook.fullname" . }}
labels:
app: {{ template "helm-guestbook.name" . }}
chart: {{ template "helm-guestbook.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
spec:
replicas: {{ .Values.replicaCount }}
revisionHistoryLimit: 3
selector:
matchLabels:
app: {{ template "helm-guestbook.name" . }}
release: {{ .Release.Name }}
strategy:
blueGreen:
activeService: {{ template "helm-guestbook.fullname" . }}
previewService: {{ template "helm-guestbook.fullname" . }}-preview
template:
metadata:
labels:
app: {{ template "helm-guestbook.name" . }}
release: {{ .Release.Name }}
spec:
containers:
- name: {{ .Chart.Name }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
ports:
- name: http
containerPort: 80
protocol: TCP
livenessProbe:
httpGet:
path: /
port: http
readinessProbe:
httpGet:
path: /
port: http
resources:
{{ toYaml .Values.resources | indent 12 }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{ toYaml . | indent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{ toYaml . | indent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{ toYaml . | indent 8 }}
{{- end }}

40
blue-green/templates/services.yaml

@ -1,40 +0,0 @@
---
apiVersion: v1
kind: Service
metadata:
name: {{ template "helm-guestbook.fullname" . }}
labels:
app: {{ template "helm-guestbook.name" . }}
chart: {{ template "helm-guestbook.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
spec:
type: {{ .Values.service.type }}
ports:
- port: {{ .Values.service.port }}
targetPort: http
protocol: TCP
name: http
selector:
app: {{ template "helm-guestbook.name" . }}
release: {{ .Release.Name }}
---
apiVersion: v1
kind: Service
metadata:
name: {{ template "helm-guestbook.fullname" . }}-preview
labels:
app: {{ template "helm-guestbook.name" . }}
chart: {{ template "helm-guestbook.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
spec:
type: {{ .Values.service.type }}
ports:
- port: {{ .Values.service.port }}
targetPort: http
protocol: TCP
name: http
selector:
app: {{ template "helm-guestbook.name" . }}
release: {{ .Release.Name }}

45
blue-green/values.yaml

@ -1,45 +0,0 @@
# Default values for helm-guestbook.
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.
replicaCount: 1
image:
repository: gcr.io/heptio-images/ks-guestbook-demo
tag: 0.1
pullPolicy: IfNotPresent
service:
type: ClusterIP
port: 80
ingress:
enabled: false
annotations: {}
# kubernetes.io/ingress.class: nginx
# kubernetes.io/tls-acme: "true"
path: /
hosts:
- chart-example.local
tls: []
# - secretName: chart-example-tls
# hosts:
# - chart-example.local
resources: {}
# We usually recommend not to specify default resources and to leave this as a conscious
# choice for the user. This also increases chances charts run on environments with little
# resources, such as Minikube. If you do want to specify resources, uncomment the following
# lines, adjust them as necessary, and remove the curly braces after 'resources:'.
# limits:
# cpu: 100m
# memory: 128Mi
# requests:
# cpu: 100m
# memory: 128Mi
nodeSelector: {}
tolerations: []
affinity: {}

20
guestbook/guestbook-ui-deployment.yaml

@ -1,20 +0,0 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: guestbook-ui
spec:
replicas: 1
revisionHistoryLimit: 3
selector:
matchLabels:
app: guestbook-ui
template:
metadata:
labels:
app: guestbook-ui
spec:
containers:
- image: gcr.io/heptio-images/ks-guestbook-demo:0.2
name: guestbook-ui
ports:
- containerPort: 80

10
guestbook/guestbook-ui-svc.yaml

@ -1,10 +0,0 @@
apiVersion: v1
kind: Service
metadata:
name: guestbook-ui
spec:
ports:
- port: 80
targetPort: 80
selector:
app: guestbook-ui

1
helm-dependency/Chart.yaml

@ -1 +0,0 @@
name: wordpress

55
helm-dependency/README.md

@ -1,55 +0,0 @@
# Helm Dependencies
This example application demonstrates how an OTS (off-the-shelf) helm chart can be retrieved and
pinned to a specific helm sem version from an upstream helm repository, and customized using a custom
values.yaml in the private git repository.
In this example, the wordpress application is pulled from the stable helm repo, and pinned to v5.0.2:
```yaml
dependencies:
- name: wordpress
version: 5.0.2
repository: https://kubernetes-charts.storage.googleapis.com
```
A custom values.yaml is used to customize the parameters of the wordpress helm chart:
```yaml
wordpress:
wordpressPassword: foo
mariadb:
db:
password: bar
rootUser:
password: baz
```
### Subchart Note
The wordpress chart referenced in this example contains a subchart for mariadb as specified in the requirements.yaml file of the wordpress chart:
```yaml
- name: mariadb
version: 5.x.x
repository: https://kubernetes-charts.storage.googleapis.com/
condition: mariadb.enabled
tags:
- wordpress-database
```
In order to disable this chart, you must set the value to false for both `mariadb.enabled` and `wordpress.mariadb.enabled`. The first is used by the mariadb subchart condition field, the second is used by the wordpress chart deployment template. An example demonstration is available in the values-nomaria.yaml file:
```yaml
mariadb:
enabled: false
wordpress:
wordpressPassword: foo
mariadb:
enabled: false
externalDatabase:
host: localhost
user: bn_wordpress
password: ""
database: bitnami_wordpress
port: 3306
```

4
helm-dependency/requirements.yaml

@ -1,4 +0,0 @@
dependencies:
- name: wordpress
version: 5.0.2
repository: https://kubernetes-charts.storage.googleapis.com

13
helm-dependency/values-nomaria.yaml

@ -1,13 +0,0 @@
mariadb:
enabled: false
wordpress:
wordpressPassword: foo
mariadb:
enabled: false
externalDatabase:
host: localhost
user: bn_wordpress
password: ""
database: bitnami_wordpress
port: 3306

7
helm-dependency/values.yaml

@ -1,7 +0,0 @@
wordpress:
wordpressPassword: foo
mariadb:
db:
password: bar
rootUser:
password: baz

21
helm-guestbook/.helmignore

@ -1,21 +0,0 @@
# 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

5
helm-guestbook/Chart.yaml

@ -1,5 +0,0 @@
apiVersion: v1
appVersion: "1.0"
description: A Helm chart for Kubernetes
name: helm-guestbook
version: 0.1.0

19
helm-guestbook/templates/NOTES.txt

@ -1,19 +0,0 @@
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.service.type }}
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ template "helm-guestbook.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.service.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 -w {{ template "helm-guestbook.fullname" . }}'
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "helm-guestbook.fullname" . }} -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
echo http://$SERVICE_IP:{{ .Values.service.port }}
{{- else if contains "ClusterIP" .Values.service.type }}
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app={{ template "helm-guestbook.name" . }},release={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
echo "Visit http://127.0.0.1:8080 to use your application"
kubectl port-forward $POD_NAME 8080:80
{{- end }}

32
helm-guestbook/templates/_helpers.tpl

@ -1,32 +0,0 @@
{{/* vim: set filetype=mustache: */}}
{{/*
Expand the name of the chart.
*/}}
{{- define "helm-guestbook.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 "helm-guestbook.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 "helm-guestbook.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
{{- end -}}

52
helm-guestbook/templates/deployment.yaml

@ -1,52 +0,0 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ template "helm-guestbook.fullname" . }}
labels:
app: {{ template "helm-guestbook.name" . }}
chart: {{ template "helm-guestbook.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
spec:
replicas: {{ .Values.replicaCount }}
revisionHistoryLimit: 3
selector:
matchLabels:
app: {{ template "helm-guestbook.name" . }}
release: {{ .Release.Name }}
template:
metadata:
labels:
app: {{ template "helm-guestbook.name" . }}
release: {{ .Release.Name }}
spec:
containers:
- name: {{ .Chart.Name }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
ports:
- name: http
containerPort: 80
protocol: TCP
livenessProbe:
httpGet:
path: /
port: http
readinessProbe:
httpGet:
path: /
port: http
resources:
{{ toYaml .Values.resources | indent 12 }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{ toYaml . | indent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{ toYaml . | indent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{ toYaml . | indent 8 }}
{{- end }}

19
helm-guestbook/templates/service.yaml

@ -1,19 +0,0 @@
apiVersion: v1
kind: Service
metadata:
name: {{ template "helm-guestbook.fullname" . }}
labels:
app: {{ template "helm-guestbook.name" . }}
chart: {{ template "helm-guestbook.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
spec:
type: {{ .Values.service.type }}
ports:
- port: {{ .Values.service.port }}
targetPort: http
protocol: TCP
name: http
selector:
app: {{ template "helm-guestbook.name" . }}
release: {{ .Release.Name }}

2
helm-guestbook/values-production.yaml

@ -1,2 +0,0 @@
service:
type: LoadBalancer

45
helm-guestbook/values.yaml

@ -1,45 +0,0 @@
# Default values for helm-guestbook.
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.
replicaCount: 1
image:
repository: gcr.io/heptio-images/ks-guestbook-demo
tag: 0.1
pullPolicy: IfNotPresent
service:
type: ClusterIP
port: 80
ingress:
enabled: false
annotations: {}
# kubernetes.io/ingress.class: nginx
# kubernetes.io/tls-acme: "true"
path: /
hosts:
- chart-example.local
tls: []
# - secretName: chart-example-tls
# hosts:
# - chart-example.local
resources: {}
# We usually recommend not to specify default resources and to leave this as a conscious
# choice for the user. This also increases chances charts run on environments with little
# resources, such as Minikube. If you do want to specify resources, uncomment the following
# lines, adjust them as necessary, and remove the curly braces after 'resources:'.
# limits:
# cpu: 100m
# memory: 128Mi
# requests:
# cpu: 100m
# memory: 128Mi
nodeSelector: {}
tolerations: []
affinity: {}

65
jsonnet-guestbook-tla/guestbook-ui.jsonnet

@ -1,65 +0,0 @@
function (
containerPort=80,
image="gcr.io/heptio-images/ks-guestbook-demo:0.2",
name="jsonnet-guestbook-ui",
replicas=1,
servicePort=80,
type="LoadBalancer"
)
[
{
"apiVersion": "v1",
"kind": "Service",
"metadata": {
"name": name
},
"spec": {
"ports": [
{
"port": servicePort,
"targetPort": containerPort
}
],
"selector": {
"app": name
},
"type": type
}
},
{
"apiVersion": "apps/v1",
"kind": "Deployment",
"metadata": {
"name": name
},
"spec": {
"replicas": replicas,
"revisionHistoryLimit": 3,
"selector": {
"matchLabels": {
"app": name
},
},
"template": {
"metadata": {
"labels": {
"app": name
}
},
"spec": {
"containers": [
{
"image": image,
"name": name,
"ports": [
{
"containerPort": containerPort
}
]
}
]
}
}
}
}
]

59
jsonnet-guestbook/guestbook-ui.jsonnet

@ -1,59 +0,0 @@
local params = import 'params.libsonnet';
[
{
"apiVersion": "v1",
"kind": "Service",
"metadata": {
"name": params.name
},
"spec": {
"ports": [
{
"port": params.servicePort,
"targetPort": params.containerPort
}
],
"selector": {
"app": params.name
},
"type": params.type
}
},
{
"apiVersion": "apps/v1",
"kind": "Deployment",
"metadata": {
"name": params.name
},
"spec": {
"replicas": params.replicas,
"revisionHistoryLimit": 3,
"selector": {
"matchLabels": {
"app": params.name
},
},
"template": {
"metadata": {
"labels": {
"app": params.name
}
},
"spec": {
"containers": [
{
"image": params.image,
"name": params.name,
"ports": [
{
"containerPort": params.containerPort
}
]
}
]
}
}
}
}
]

8
jsonnet-guestbook/params.libsonnet

@ -1,8 +0,0 @@
{
containerPort: 80,
image: "gcr.io/heptio-images/ks-guestbook-demo:0.2",
name: "jsonnet-guestbook-ui",
replicas: 1,
servicePort: 80,
type: "LoadBalancer",
}

11
jupyter-web-app/base/cluster-role-binding.yaml

@ -0,0 +1,11 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: cluster-role-binding
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: cluster-role
subjects:
- kind: ServiceAccount
name: service-account

54
jupyter-web-app/base/cluster-role.yaml

@ -0,0 +1,54 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: cluster-role
rules:
- apiGroups:
- ""
resources:
- namespaces
verbs:
- get
- list
- create
- delete
- apiGroups:
- authorization.k8s.io
resources:
- subjectaccessreviews
verbs:
- create
- apiGroups:
- kubeflow.org
resources:
- notebooks
- notebooks/finalizers
- poddefaults
verbs:
- get
- list
- create
- delete
- apiGroups:
- ""
resources:
- persistentvolumeclaims
verbs:
- create
- delete
- get
- list
- apiGroups:
- ""
resources:
- events
verbs:
- list
- apiGroups:
- storage.k8s.io
resources:
- storageclasses
verbs:
- get
- list
- watch

127
jupyter-web-app/base/config-map.yaml

@ -0,0 +1,127 @@
apiVersion: v1
data:
spawner_ui_config.yaml: |
# Configuration file for the Jupyter UI.
#
# Each Jupyter UI option is configured by two keys: 'value' and 'readOnly'
# - The 'value' key contains the default value
# - The 'readOnly' key determines if the option will be available to users
#
# If the 'readOnly' key is present and set to 'true', the respective option
# will be disabled for users and only set by the admin. Also when a
# Notebook is POSTED to the API if a necessary field is not present then
# the value from the config will be used.
#
# If the 'readOnly' key is missing (defaults to 'false'), the respective option
# will be available for users to edit.
#
# Note that some values can be templated. Such values are the names of the
# Volumes as well as their StorageClass
spawnerFormDefaults:
image:
# The container Image for the user's Jupyter Notebook
# If readonly, this value must be a member of the list below
value: gcr.io/kubeflow-images-public/tensorflow-1.14.0-notebook-cpu:v-base-ef41372-1177829795472347138
# The list of available standard container Images
options:
- gcr.io/kubeflow-images-public/tensorflow-1.14.0-notebook-cpu:v0.7.0
- gcr.io/kubeflow-images-public/tensorflow-1.14.0-notebook-gpu:v0.7.0
- gcr.io/kubeflow-images-public/tensorflow-2.0.0a0-notebook-cpu:v0.7.0
- gcr.io/kubeflow-images-public/tensorflow-2.0.0a0-notebook-gpu:v0.7.0
# By default, custom container Images are allowed
# Uncomment the following line to only enable standard container Images
readOnly: false
cpu:
# CPU for user's Notebook
value: '0.5'
readOnly: false
memory:
# Memory for user's Notebook
value: 1.0Gi
readOnly: false
workspaceVolume:
# Workspace Volume to be attached to user's Notebook
# Each Workspace Volume is declared with the following attributes:
# Type, Name, Size, MountPath and Access Mode
value:
type:
# The Type of the Workspace Volume
# Supported values: 'New', 'Existing'
value: New
name:
# The Name of the Workspace Volume
# Note that this is a templated value. Special values:
# {notebook-name}: Replaced with the name of the Notebook. The frontend
# will replace this value as the user types the name
value: 'workspace-{notebook-name}'
size:
# The Size of the Workspace Volume (in Gi)
value: '10Gi'
mountPath:
# The Path that the Workspace Volume will be mounted
value: /home/jovyan
accessModes:
# The Access Mode of the Workspace Volume
# Supported values: 'ReadWriteOnce', 'ReadWriteMany', 'ReadOnlyMany'
value: ReadWriteOnce
class:
# The StrageClass the PVC will use if type is New. Special values are:
# {none}: default StorageClass
# {empty}: empty string ""
value: '{none}'
readOnly: false
dataVolumes:
# List of additional Data Volumes to be attached to the user's Notebook
value: []
# Each Data Volume is declared with the following attributes:
# Type, Name, Size, MountPath and Access Mode
#
# For example, a list with 2 Data Volumes:
# value:
# - value:
# type:
# value: New
# name:
# value: '{notebook-name}-vol-1'
# size:
# value: '10Gi'
# class:
# value: standard
# mountPath:
# value: /home/jovyan/vol-1
# accessModes:
# value: ReadWriteOnce
# class:
# value: {none}
# - value:
# type:
# value: New
# name:
# value: '{notebook-name}-vol-2'
# size:
# value: '10Gi'
# mountPath:
# value: /home/jovyan/vol-2
# accessModes:
# value: ReadWriteMany
# class:
# value: {none}
readOnly: false
extraResources:
# Extra Resource Limits for user's Notebook
# e.x. "{'nvidia.com/gpu': 2}"
value: "{}"
readOnly: false
shm:
value: true
readOnly: false
configurations:
# List of labels to be selected, these are the labels from PodDefaults
# value:
# - add-gcp-secret
# - default-editor
value: []
readOnly: false
kind: ConfigMap
metadata:
name: config

37
jupyter-web-app/base/deployment.yaml

@ -0,0 +1,37 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: deployment
spec:
replicas: 1
template:
spec:
containers:
- env:
- name: ROK_SECRET_NAME
valueFrom:
configMapKeyRef:
name: parameters
key: ROK_SECRET_NAME
- name: UI
valueFrom:
configMapKeyRef:
name: parameters
key: UI
- name: USERID_HEADER
value: $(userid-header)
- name: USERID_PREFIX
value: $(userid-prefix)
image: gcr.io/kubeflow-images-public/jupyter-web-app:v0.5.0
imagePullPolicy: $(policy)
name: jupyter-web-app
ports:
- containerPort: 5000
volumeMounts:
- mountPath: /etc/config
name: config-volume
serviceAccountName: service-account
volumes:
- configMap:
name: config
name: config-volume

70
jupyter-web-app/base/kustomization.yaml

@ -0,0 +1,70 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- cluster-role-binding.yaml
- cluster-role.yaml
- config-map.yaml
- deployment.yaml
- role-binding.yaml
- role.yaml
- service-account.yaml
- service.yaml
namePrefix: jupyter-web-app-
namespace: kubeflow
commonLabels:
app: jupyter-web-app
kustomize.component: jupyter-web-app
images:
- name: gcr.io/kubeflow-images-public/jupyter-web-app
newName: gcr.io/kubeflow-images-public/jupyter-web-app
newTag: vmaster-ge8c85064
configMapGenerator:
- env: params.env
name: parameters
generatorOptions:
disableNameSuffixHash: true
vars:
- fieldref:
fieldPath: data.policy
name: policy
objref:
apiVersion: v1
kind: ConfigMap
name: parameters
- fieldref:
fieldPath: data.prefix
name: prefix
objref:
apiVersion: v1
kind: ConfigMap
name: parameters
- fieldref:
fieldPath: data.clusterDomain
name: clusterDomain
objref:
apiVersion: v1
kind: ConfigMap
name: parameters
- fieldref:
fieldPath: metadata.namespace
name: namespace
objref:
apiVersion: v1
kind: Service
name: service
- fieldref:
fieldPath: data.userid-header
name: userid-header
objref:
apiVersion: v1
kind: ConfigMap
name: parameters
- fieldref:
fieldPath: data.userid-prefix
name: userid-prefix
objref:
apiVersion: v1
kind: ConfigMap
name: parameters
configurations:
- params.yaml

7
jupyter-web-app/base/params.env

@ -0,0 +1,7 @@
UI=default
ROK_SECRET_NAME=secret-rok-{username}
policy=Always
prefix=jupyter
clusterDomain=cluster.local
userid-header=kubeflow-userid
userid-prefix=

9
jupyter-web-app/base/params.yaml

@ -0,0 +1,9 @@
varReference:
- path: spec/template/spec/containers/imagePullPolicy
kind: Deployment
- path: metadata/annotations/getambassador.io\/config
kind: Service
- path: spec/template/spec/containers/0/env/2/value
kind: Deployment
- path: spec/template/spec/containers/0/env/3/value
kind: Deployment

11
jupyter-web-app/base/role-binding.yaml

@ -0,0 +1,11 @@
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: RoleBinding
metadata:
name: jupyter-notebook-role-binding
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: jupyter-notebook-role
subjects:
- kind: ServiceAccount
name: jupyter-notebook

35
jupyter-web-app/base/role.yaml

@ -0,0 +1,35 @@
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: Role
metadata:
name: jupyter-notebook-role
rules:
- apiGroups:
- ""
resources:
- pods
- pods/log
- secrets
- services
verbs:
- '*'
- apiGroups:
- ""
- apps
- extensions
resources:
- deployments
- replicasets
verbs:
- '*'
- apiGroups:
- kubeflow.org
resources:
- '*'
verbs:
- '*'
- apiGroups:
- batch
resources:
- jobs
verbs:
- '*'

4
jupyter-web-app/base/service-account.yaml

@ -0,0 +1,4 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: service-account

23
jupyter-web-app/base/service.yaml

@ -0,0 +1,23 @@
apiVersion: v1
kind: Service
metadata:
annotations:
getambassador.io/config: |-
---
apiVersion: ambassador/v0
kind: Mapping
name: webapp_mapping
prefix: /$(prefix)/
service: jupyter-web-app-service.$(namespace)
add_request_headers:
x-forwarded-prefix: /jupyter
labels:
run: jupyter-web-app
name: service
spec:
ports:
- name: http
port: 80
protocol: TCP
targetPort: 5000
type: ClusterIP

15
jupyter-web-app/kustomization.yaml

@ -0,0 +1,15 @@
apiVersion: kustomize.config.k8s.io/v1beta1
bases:
- base
- overlays/istio
commonLabels:
app.kubernetes.io/component: jupyter-web-app
app.kubernetes.io/instance: jupyter-web-app-v0.7.0
app.kubernetes.io/managed-by: kfctl
app.kubernetes.io/name: jupyter-web-app
app.kubernetes.io/part-of: kubeflow
app.kubernetes.io/version: v0.7.0
kind: Kustomization
namespace: kubeflow
resources:
- overlays/application/application.yaml

49
jupyter-web-app/overlays/application/application.yaml

@ -0,0 +1,49 @@
apiVersion: app.k8s.io/v1beta1
kind: Application
metadata:
name: jupyter-web-app
spec:
selector:
matchLabels:
app.kubernetes.io/name: jupyter-web-app
app.kubernetes.io/instance: jupyter-web-app-v0.7.0
app.kubernetes.io/managed-by: kfctl
app.kubernetes.io/component: jupyter-web-app
app.kubernetes.io/part-of: kubeflow
app.kubernetes.io/version: v0.7.0
componentKinds:
- group: core
kind: ConfigMap
- group: apps
kind: Deployment
- group: rbac.authorization.k8s.io
kind: RoleBinding
- group: rbac.authorization.k8s.io
kind: Role
- group: core
kind: ServiceAccount
- group: core
kind: Service
- group: networking.istio.io
kind: VirtualService
descriptor:
type: jupyter-web-app
version: v1beta1
description: Provides a UI which allows the user to create/conect/delete jupyter notebooks.
maintainers:
- name: Kimonas Sotirchos
email: kimwnasptd@arrikto.com
owners:
- name: Kimonas Sotirchos
email: kimwnasptd@arrikto.com
keywords:
- jupyterhub
- jupyter ui
- notebooks
links:
- description: About
url: https://github.com/kubeflow/kubeflow/tree/master/components/jupyter-web-app
- description: Docs
url: https://www.kubeflow.org/docs/notebooks
addOwnerRef: true

13
jupyter-web-app/overlays/application/kustomization.yaml

@ -0,0 +1,13 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
bases:
- ../../base
resources:
- application.yaml
commonLabels:
app.kubernetes.io/name: jupyter-web-app
app.kubernetes.io/instance: jupyter-web-app-v0.7.0
app.kubernetes.io/managed-by: kfctl
app.kubernetes.io/component: jupyter-web-app
app.kubernetes.io/part-of: kubeflow
app.kubernetes.io/version: v0.7.0

6
jupyter-web-app/overlays/istio/kustomization.yaml

@ -0,0 +1,6 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- virtual-service.yaml
configurations:
- params.yaml

3
jupyter-web-app/overlays/istio/params.yaml

@ -0,0 +1,3 @@
varReference:
- path: spec/http/route/destination/host
kind: VirtualService

24
jupyter-web-app/overlays/istio/virtual-service.yaml

@ -0,0 +1,24 @@
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: jupyter-web-app
spec:
gateways:
- kubeflow-gateway
hosts:
- '*'
http:
- headers:
request:
add:
x-forwarded-prefix: /jupyter
match:
- uri:
prefix: /jupyter/
rewrite:
uri: /
route:
- destination:
host: jupyter-web-app-service.$(namespace).svc.$(clusterDomain)
port:
number: 80

4
ksonnet-guestbook/.gitignore

@ -1,4 +0,0 @@
/lib
/.ksonnet/registries
/app.override.yaml
/.ks_environment

23
ksonnet-guestbook/app.yaml

@ -1,23 +0,0 @@
apiVersion: 0.1.0
environments:
default:
destination:
namespace: default
server: https://kubernetes.default.svc
k8sVersion: v1.10.0
path: default
dev:
destination:
namespace: dev
server: https://kubernetes.default.svc
k8sVersion: v1.10.0
path: dev
prod:
destination:
namespace: prod
server: https://kubernetes.default.svc
k8sVersion: v1.10.0
path: prod
kind: ksonnet.io/app
name: guestbook
version: 0.0.1

59
ksonnet-guestbook/components/guestbook-ui.jsonnet

@ -1,59 +0,0 @@
local env = std.extVar("__ksonnet/environments");
local params = std.extVar("__ksonnet/params").components["guestbook-ui"];
[
{
"apiVersion": "v1",
"kind": "Service",
"metadata": {
"name": params.name
},
"spec": {
"ports": [
{
"port": params.servicePort,
"targetPort": params.containerPort
}
],
"selector": {
"app": params.name
},
"type": params.type
}
},
{
"apiVersion": "apps/v1",
"kind": "Deployment",
"metadata": {
"name": params.name
},
"spec": {
"replicas": params.replicas,
"revisionHistoryLimit": 3,
"selector": {
"matchLabels": {
"app": params.name
},
},
"template": {
"metadata": {
"labels": {
"app": params.name
}
},
"spec": {
"containers": [
{
"image": params.image,
"name": params.name,
"ports": [
{
"containerPort": params.containerPort
}
]
}
]
}
}
}
}
]

18
ksonnet-guestbook/components/params.libsonnet

@ -1,18 +0,0 @@
{
global: {
// User-defined global parameters; accessible to all component and environments, Ex:
// replicas: 4,
},
components: {
// Component-level parameters, defined initially from 'ks prototype use ...'
// Each object below should correspond to a component in the components/ directory
"guestbook-ui": {
containerPort: 80,
image: "gcr.io/heptio-images/ks-guestbook-demo:0.2",
name: "ks-guestbook-ui",
replicas: 1,
servicePort: 80,
type: "LoadBalancer",
},
},
}

4
ksonnet-guestbook/environments/base.libsonnet

@ -1,4 +0,0 @@
local components = std.extVar("__ksonnet/components");
components + {
// Insert user-specified overrides here.
}

2
ksonnet-guestbook/environments/default/globals.libsonnet

@ -1,2 +0,0 @@
{
}

8
ksonnet-guestbook/environments/default/main.jsonnet

@ -1,8 +0,0 @@
local base = import "base.libsonnet";
// uncomment if you reference ksonnet-lib
// local k = import "k.libsonnet";
base + {
// Insert user-specified overrides here. For example if a component is named \"nginx-deployment\", you might have something like:\n")
// "nginx-deployment"+: k.deployment.mixin.metadata.labels({foo: "bar"})
}

17
ksonnet-guestbook/environments/default/params.libsonnet

@ -1,17 +0,0 @@
local params = std.extVar("__ksonnet/params");
local globals = import "globals.libsonnet";
local envParams = params + {
components +: {
// Insert component parameter overrides here. Ex:
// guestbook +: {
// name: "guestbook-dev",
// replicas: params.global.replicas,
// },
},
};
{
components: {
[x]: envParams.components[x] + globals, for x in std.objectFields(envParams.components)
},
}

2
ksonnet-guestbook/environments/dev/globals.libsonnet

@ -1,2 +0,0 @@
{
}

8
ksonnet-guestbook/environments/dev/main.jsonnet

@ -1,8 +0,0 @@
local base = import "base.libsonnet";
// uncomment if you reference ksonnet-lib
// local k = import "k.libsonnet";
base + {
// Insert user-specified overrides here. For example if a component is named \"nginx-deployment\", you might have something like:\n")
// "nginx-deployment"+: k.deployment.mixin.metadata.labels({foo: "bar"})
}

17
ksonnet-guestbook/environments/dev/params.libsonnet

@ -1,17 +0,0 @@
local params = std.extVar("__ksonnet/params");
local globals = import "globals.libsonnet";
local envParams = params + {
components +: {
// Insert component parameter overrides here. Ex:
// guestbook +: {
// name: "guestbook-dev",
// replicas: params.global.replicas,
// },
},
};
{
components: {
[x]: envParams.components[x] + globals, for x in std.objectFields(envParams.components)
},
}

2
ksonnet-guestbook/environments/prod/globals.libsonnet

@ -1,2 +0,0 @@
{
}

8
ksonnet-guestbook/environments/prod/main.jsonnet

@ -1,8 +0,0 @@
local base = import "base.libsonnet";
// uncomment if you reference ksonnet-lib
// local k = import "k.libsonnet";
base + {
// Insert user-specified overrides here. For example if a component is named \"nginx-deployment\", you might have something like:\n")
// "nginx-deployment"+: k.deployment.mixin.metadata.labels({foo: "bar"})
}

17
ksonnet-guestbook/environments/prod/params.libsonnet

@ -1,17 +0,0 @@
local params = std.extVar("__ksonnet/params");
local globals = import "globals.libsonnet";
local envParams = params + {
components +: {
// Insert component parameter overrides here. Ex:
// guestbook +: {
// name: "guestbook-dev",
// replicas: params.global.replicas,
// },
},
};
{
components: {
[x]: envParams.components[x] + globals, for x in std.objectFields(envParams.components)
},
}

20
kustomize-guestbook/guestbook-ui-deployment.yaml

@ -1,20 +0,0 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: guestbook-ui
spec:
replicas: 1
revisionHistoryLimit: 3
selector:
matchLabels:
app: guestbook-ui
template:
metadata:
labels:
app: guestbook-ui
spec:
containers:
- image: gcr.io/heptio-images/ks-guestbook-demo:0.2
name: guestbook-ui
ports:
- containerPort: 80

10
kustomize-guestbook/guestbook-ui-svc.yaml

@ -1,10 +0,0 @@
apiVersion: v1
kind: Service
metadata:
name: guestbook-ui
spec:
ports:
- port: 80
targetPort: 80
selector:
app: guestbook-ui

7
kustomize-guestbook/kustomization.yaml

@ -1,7 +0,0 @@
namePrefix: kustomize-
resources:
- guestbook-ui-deployment.yaml
- guestbook-ui-svc.yaml
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
Loading…
Cancel
Save