From 3f56ab265b1a24110f7e9b153ccf72efcee52d61 Mon Sep 17 00:00:00 2001 From: Stefan Prodan Date: Thu, 10 May 2018 19:08:54 +0300 Subject: [PATCH] [stable/weave-cloud] Replace Scope, Flux and Cortex with weave-agent daemon (#5163) * Replace Scope, Flux and Cortex with weave-agent daemon - bump version to 0.2.0 - use the weave namespace instead of kube-system - rename the token variable and store it as a kube secret * Remove blank lines * add empty token * Add api and app version * Remove duplicate chart yaml * Add demo token value * Add CI values with a demo token * Make RBAC and service account optional * Consistent indentation * Use Github usernames * Cleaup CI values * Use chart fullname for RBAC resources * Use a release version for weave-agent * Remove deprecated service account --- stable/weave-cloud/Chart.yaml | 8 +- stable/weave-cloud/OWNERS | 2 + stable/weave-cloud/README.md | 19 +- stable/weave-cloud/ci/e2e-values.yaml | 3 + stable/weave-cloud/templates/NOTES.txt | 6 +- stable/weave-cloud/templates/_helpers.tpl | 43 +++ stable/weave-cloud/templates/cortex.yaml | 273 ------------------ stable/weave-cloud/templates/deployment.yaml | 41 +++ stable/weave-cloud/templates/flux.yaml | 132 --------- stable/weave-cloud/templates/rbac.yaml | 40 +++ stable/weave-cloud/templates/scope.yaml | 95 ------ stable/weave-cloud/templates/secret.yaml | 7 + .../weave-cloud/templates/serviceaccount.yaml | 11 + stable/weave-cloud/update.sh | 16 - stable/weave-cloud/values.yaml | 23 +- 15 files changed, 193 insertions(+), 526 deletions(-) create mode 100644 stable/weave-cloud/ci/e2e-values.yaml create mode 100644 stable/weave-cloud/templates/_helpers.tpl delete mode 100644 stable/weave-cloud/templates/cortex.yaml create mode 100644 stable/weave-cloud/templates/deployment.yaml delete mode 100644 stable/weave-cloud/templates/flux.yaml create mode 100644 stable/weave-cloud/templates/rbac.yaml delete mode 100644 stable/weave-cloud/templates/scope.yaml create mode 100644 stable/weave-cloud/templates/secret.yaml create mode 100644 stable/weave-cloud/templates/serviceaccount.yaml delete mode 100755 stable/weave-cloud/update.sh diff --git a/stable/weave-cloud/Chart.yaml b/stable/weave-cloud/Chart.yaml index ca6cbc18ff..10c7f0013e 100644 --- a/stable/weave-cloud/Chart.yaml +++ b/stable/weave-cloud/Chart.yaml @@ -1,10 +1,14 @@ +apiVersion: v1 +appVersion: "0.2.0" name: weave-cloud -version: 0.1.3 +version: 0.2.0 description: | Weave Cloud is a add-on to Kubernetes which provides Continuous Delivery, along with hosted Prometheus Monitoring and a visual dashboard for exploring & debugging microservices home: https://weave.works maintainers: - - name: Ilya Dmitrichenko + - name: errordeveloper email: ilya@weave.works + - name: stefanprodan + email: stefan@weave.works engine: gotpl icon: https://www.weave.works/assets/images/bltd108e8f850ae9e7c/weave-logo-512.png diff --git a/stable/weave-cloud/OWNERS b/stable/weave-cloud/OWNERS index b7db27c912..fa515e19cc 100644 --- a/stable/weave-cloud/OWNERS +++ b/stable/weave-cloud/OWNERS @@ -1,4 +1,6 @@ approvers: - errordeveloper +- stefanprodan reviewers: - errordeveloper +- stefanprodan \ No newline at end of file diff --git a/stable/weave-cloud/README.md b/stable/weave-cloud/README.md index cd5bfd6ac8..dbbddeb7ae 100644 --- a/stable/weave-cloud/README.md +++ b/stable/weave-cloud/README.md @@ -15,12 +15,15 @@ You will need a service token which you can get from [cloud.weave.works](https:/ To install the chart: ```console -$ helm install --name weave-cloud --namespace kube-system --set ServiceToken= stable/weave-cloud +$ helm install --name weave-cloud \ +--namespace weave \ +--set token= \ +stable/weave-cloud ``` To view the pods installed: ```console -$ kubectl get pods -n kube-system -l weave-cloud-component +$ kubectl get pods -n weave ``` To upgrade the chart: @@ -33,7 +36,13 @@ $ helm upgrade --reuse-values weave-cloud stable/weave-cloud To uninstall/delete the `weave-cloud` chart: ```console -$ helm delete weave-cloud +$ helm delete --purge weave-cloud +``` + +Delete the `weave` namespace: + +```console +$ kubectl delete namespace weave ``` The command removes all the Kubernetes components associated with the chart and deletes the release. @@ -44,4 +53,6 @@ The following tables lists the configurable parameters of the Weave Cloud Agents | Parameter | Description | Default | | --------- | ----------- | ------- | -| `ServiceToken` | Weave Cloud service token | _none_ _(**must be set**)_ | +| `token` | Weave Cloud service token | _none_ _(**must be set**)_ | +| `rbac.create` | If `true`, create and use RBAC resources | `true` | +| `serviceAccount.create` | If `true`, create a new service account | `true` | \ No newline at end of file diff --git a/stable/weave-cloud/ci/e2e-values.yaml b/stable/weave-cloud/ci/e2e-values.yaml new file mode 100644 index 0000000000..5e21ebadbb --- /dev/null +++ b/stable/weave-cloud/ci/e2e-values.yaml @@ -0,0 +1,3 @@ +# CI values for weave-cloud. + +token: demo diff --git a/stable/weave-cloud/templates/NOTES.txt b/stable/weave-cloud/templates/NOTES.txt index af16ccb999..3aa32e2505 100644 --- a/stable/weave-cloud/templates/NOTES.txt +++ b/stable/weave-cloud/templates/NOTES.txt @@ -1,10 +1,10 @@ -{{- if .Values.ServiceToken -}} +{{- if .Values.token -}} Weave Cloud agents had been installed! First, verify all Pods are running: - kubectl get pods -n {{ .Release.Namespace }} -l weave-cloud-component + kubectl get pods -n {{ .Release.Namespace }} Next, login to Weave Cloud (https://cloud.weave.works) and verify the agents are connect to your instance. @@ -23,6 +23,6 @@ To retrieve your Weave Cloud service token, log in to your instance first: https Then run: - helm upgrade {{ .Release.Name }} --set ServiceToken= stable/weave-cloud + helm upgrade {{ .Release.Name }} --set token= stable/weave-cloud {{- end }} diff --git a/stable/weave-cloud/templates/_helpers.tpl b/stable/weave-cloud/templates/_helpers.tpl new file mode 100644 index 0000000000..d4fd978655 --- /dev/null +++ b/stable/weave-cloud/templates/_helpers.tpl @@ -0,0 +1,43 @@ +{{/* vim: set filetype=mustache: */}} +{{/* +Expand the name of the chart. +*/}} +{{- define "weave-cloud.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 "weave-cloud.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 "weave-cloud.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{/* +Create the name of the service account to use +*/}} +{{- define "weave-cloud.serviceAccountName" -}} +{{- if .Values.serviceAccount.create -}} + {{ default (include "weave-cloud.fullname" .) .Values.serviceAccount.name }} +{{- else -}} + {{ default "default" .Values.serviceAccount.name }} +{{- end -}} +{{- end -}} \ No newline at end of file diff --git a/stable/weave-cloud/templates/cortex.yaml b/stable/weave-cloud/templates/cortex.yaml deleted file mode 100644 index acb7a74e2c..0000000000 --- a/stable/weave-cloud/templates/cortex.yaml +++ /dev/null @@ -1,273 +0,0 @@ -apiVersion: v1 -kind: List -items: - - apiVersion: v1 - kind: ServiceAccount - metadata: - name: weave-cortex - labels: - name: weave-cortex - - apiVersion: rbac.authorization.k8s.io/v1beta1 - kind: ClusterRole - metadata: - name: weave-cortex - labels: - name: weave-cortex - rules: - - apiGroups: - - '*' - resources: - - '*' - verbs: - - '*' - - nonResourceURLs: - - '*' - verbs: - - '*' - - apiVersion: rbac.authorization.k8s.io/v1beta1 - kind: ClusterRoleBinding - metadata: - name: weave-cortex - labels: - name: weave-cortex - roleRef: - kind: ClusterRole - name: weave-cortex - apiGroup: rbac.authorization.k8s.io - subjects: - - kind: ServiceAccount - name: weave-cortex - namespace: kube-system - - apiVersion: apps/v1beta1 - kind: Deployment - metadata: - name: weave-cortex-agent - labels: - name: weave-cortex-agent - app: weave-cortex - weave-cloud-component: cortex - weave-cortex-component: agent - spec: - replicas: 1 - template: - metadata: - labels: - name: weave-cortex-agent - app: weave-cortex - weave-cloud-component: cortex - weave-cortex-component: agent - spec: - containers: - - name: agent - args: - - '-config.file=/etc/prometheus/prometheus.yml' - - '-web.listen-address=:8080' - - '-storage.local.engine=none' - image: 'prom/prometheus:v1.7.1' - imagePullPolicy: IfNotPresent - ports: - - containerPort: 8080 - protocol: TCP - volumeMounts: - - name: agent-config-volume - mountPath: /etc/prometheus - serviceAccountName: weave-cortex - volumes: - - name: agent-config-volume - configMap: - name: weave-cortex-agent-config - - apiVersion: v1 - kind: Service - metadata: - name: weave-cortex-agent - labels: - name: weave-cortex-agent - app: weave-cortex - weave-cloud-component: cortex - weave-cortex-component: agent - spec: - ports: - - name: agent - port: 80 - protocol: TCP - targetPort: 8080 - selector: - name: weave-cortex-agent - app: weave-cortex - weave-cloud-component: cortex - weave-cortex-component: agent - - apiVersion: extensions/v1beta1 - kind: DaemonSet - metadata: - name: weave-cortex-node-exporter - labels: - name: weave-cortex-node-exporter - app: weave-cortex - weave-cloud-component: cortex - weave-cortex-component: node-exporter - spec: - template: - metadata: - annotations: - prometheus.io.scrape: 'true' - labels: - name: weave-cortex-node-exporter - app: weave-cortex - weave-cloud-component: cortex - weave-cortex-component: node-exporter - spec: - containers: - - name: agent - image: 'prom/node-exporter:v0.14.0' - imagePullPolicy: IfNotPresent - ports: - - containerPort: 9100 - protocol: TCP - securityContext: - privileged: true - hostNetwork: true - hostPID: true - serviceAccountName: weave-cortex - tolerations: - - effect: NoSchedule - operator: Exists - updateStrategy: - type: RollingUpdate - - apiVersion: v1 - kind: ConfigMap - metadata: - name: weave-cortex-agent-config - labels: - name: weave-cortex-agent-config - app: weave-cortex - weave-cloud-component: cortex - weave-cortex-component: agent-config - data: - prometheus.yml: | - global: - scrape_interval: 15s - remote_write: - - url: 'https://cloud.weave.works/api/prom/push' - basic_auth: - password: '{{.Values.ServiceToken}}' - remote_read: - - url: 'https://cloud.weave.works/api/prom/read' - basic_auth: - password: '{{.Values.ServiceToken}}' - scrape_configs: - - job_name: kubernetes-service-endpoints - kubernetes_sd_configs: - - role: endpoints - tls_config: - ca_file: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt - bearer_token_file: /var/run/secrets/kubernetes.io/serviceaccount/token - relabel_configs: - - source_labels: - - __meta_kubernetes_service_label_component - regex: apiserver - action: replace - target_label: __scheme__ - replacement: https - - source_labels: - - __meta_kubernetes_service_label_kubernetes_io_cluster_service - action: drop - regex: 'true' - - source_labels: - - __meta_kubernetes_service_annotation_prometheus_io_scrape - action: drop - regex: 'false' - - source_labels: - - __meta_kubernetes_pod_container_port_name - action: drop - regex: .*-noscrape - - source_labels: - - __meta_kubernetes_service_annotation_prometheus_io_scheme - action: replace - target_label: __scheme__ - regex: ^(https?)$ - replacement: $1 - - source_labels: - - __meta_kubernetes_service_annotation_prometheus_io_path - action: replace - target_label: __metrics_path__ - regex: ^(.+)$ - replacement: $1 - - source_labels: - - __address__ - - __meta_kubernetes_service_annotation_prometheus_io_port - action: replace - target_label: __address__ - regex: '^(.+)(?::\d+);(\d+)$' - replacement: '$1:$2' - - action: labelmap - regex: ^__meta_kubernetes_service_label_(.+)$ - replacement: $1 - - source_labels: - - __meta_kubernetes_namespace - - __meta_kubernetes_service_name - separator: / - target_label: job - - job_name: kubernetes-pods - kubernetes_sd_configs: - - role: pod - relabel_configs: - - source_labels: - - __meta_kubernetes_pod_annotation_prometheus_io_scrape - action: keep - regex: 'true' - - source_labels: - - __meta_kubernetes_namespace - - __meta_kubernetes_pod_label_name - separator: / - target_label: job - - source_labels: - - __meta_kubernetes_pod_node_name - target_label: node - - job_name: kubernetes-nodes - kubernetes_sd_configs: - - role: node - tls_config: - insecure_skip_verify: true - bearer_token_file: /var/run/secrets/kubernetes.io/serviceaccount/token - relabel_configs: - - target_label: __scheme__ - replacement: https - - action: labelmap - regex: __meta_kubernetes_node_label_(.+) - - source_labels: - - __meta_kubernetes_node_label_kubernetes_io_hostname - target_label: instance - - target_label: __address__ - replacement: 'kubernetes.default.svc:443' - - source_labels: - - __meta_kubernetes_node_name - regex: (.+) - target_label: __metrics_path__ - replacement: '/api/v1/nodes/${1}/proxy/metrics' - - job_name: weave - kubernetes_sd_configs: - - role: pod - relabel_configs: - - source_labels: - - __meta_kubernetes_namespace - - __meta_kubernetes_pod_label_name - action: keep - regex: ^kube-system;weave-net$ - - source_labels: - - __meta_kubernetes_pod_container_name - - __address__ - action: replace - target_label: __address__ - regex: '^weave;(.+?)(?::\d+)?$' - replacement: '$1:6782' - - source_labels: - - __meta_kubernetes_pod_container_name - - __address__ - action: replace - target_label: __address__ - regex: '^weave-npc;(.+?)(?::\d+)?$' - replacement: '$1:6781' - - source_labels: - - __meta_kubernetes_pod_container_name - action: replace - target_label: job diff --git a/stable/weave-cloud/templates/deployment.yaml b/stable/weave-cloud/templates/deployment.yaml new file mode 100644 index 0000000000..509fa80eb1 --- /dev/null +++ b/stable/weave-cloud/templates/deployment.yaml @@ -0,0 +1,41 @@ +apiVersion: apps/v1beta2 +kind: Deployment +metadata: + name: {{ .Values.agent.name }} + labels: + app: {{ template "weave-cloud.name" . }} + chart: {{ template "weave-cloud.chart" . }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +spec: + minReadySeconds: 30 + replicas: 1 + revisionHistoryLimit: 2 + selector: + matchLabels: + app: {{ template "weave-cloud.name" . }} + release: {{ .Release.Name }} + template: + metadata: + labels: + app: {{ template "weave-cloud.name" . }} + release: {{ .Release.Name }} + spec: + {{- if .Values.serviceAccount.create }} + serviceAccountName: {{ template "weave-cloud.serviceAccountName" . }} + {{- end }} + terminationGracePeriodSeconds: 30 + containers: + - name: {{ .Values.agent.name }} + image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" + imagePullPolicy: {{ .Values.image.pullPolicy }} + args: + - -agent.poll-url=https://get.weave.works/k8s/agent.yaml?instanceID={{"{{.InstanceID}}"}} + - -wc.hostname=cloud.weave.works + - -wc.token=$(WEAVE_CLOUD_TOKEN) + env: + - name: WEAVE_CLOUD_TOKEN + valueFrom: + secretKeyRef: + key: token + name: weave-cloud diff --git a/stable/weave-cloud/templates/flux.yaml b/stable/weave-cloud/templates/flux.yaml deleted file mode 100644 index 9224d54998..0000000000 --- a/stable/weave-cloud/templates/flux.yaml +++ /dev/null @@ -1,132 +0,0 @@ -apiVersion: v1 -kind: List -items: - - apiVersion: v1 - kind: ServiceAccount - metadata: - name: weave-flux - labels: - name: weave-flux - - apiVersion: rbac.authorization.k8s.io/v1beta1 - kind: ClusterRole - metadata: - name: weave-flux - labels: - name: weave-flux - rules: - - apiGroups: - - '*' - resources: - - '*' - verbs: - - '*' - - nonResourceURLs: - - '*' - verbs: - - '*' - - apiVersion: rbac.authorization.k8s.io/v1beta1 - kind: ClusterRoleBinding - metadata: - name: weave-flux - labels: - name: weave-flux - roleRef: - kind: ClusterRole - name: weave-flux - apiGroup: rbac.authorization.k8s.io - subjects: - - kind: ServiceAccount - name: weave-flux - namespace: kube-system - - apiVersion: v1 - kind: Secret - metadata: - name: flux-git-deploy - type: Opaque - - apiVersion: apps/v1beta1 - kind: Deployment - metadata: - name: weave-flux-memcached - labels: - name: weave-flux-memcached - app: weave-flux - weave-cloud-component: flux - weave-flux-component: memcached - spec: - replicas: 1 - template: - metadata: - labels: - name: weave-flux-memcached - app: weave-flux - weave-cloud-component: flux - weave-flux-component: memcached - spec: - containers: - - name: memcached - args: - - '-m 64' - - '-p 11211' - - '-vv' - image: 'memcached:1.4.25' - imagePullPolicy: IfNotPresent - ports: - - name: clients - containerPort: 11211 - - apiVersion: v1 - kind: Service - metadata: - name: weave-flux-memcached - labels: - name: weave-flux-memcached - app: weave-flux - weave-cloud-component: flux - weave-flux-component: memcached - spec: - clusterIP: None - ports: - - name: memcached - port: 11211 - selector: - name: weave-flux-memcached - app: weave-flux - weave-cloud-component: flux - weave-flux-component: memcached - - apiVersion: apps/v1beta1 - kind: Deployment - metadata: - name: weave-flux-agent - labels: - name: weave-flux-agent - app: weave-flux - weave-cloud-component: flux - weave-flux-component: agent - spec: - replicas: 1 - strategy: - type: Recreate - template: - metadata: - labels: - name: weave-flux-agent - app: weave-flux - weave-cloud-component: flux - weave-flux-component: agent - spec: - containers: - - name: agent - args: - - '--token={{.Values.ServiceToken}}' - - '--connect=wss://cloud.weave.works/api/flux' - - >- - --memcached-hostname=weave-flux-memcached.kube-system.svc.cluster.local - image: 'quay.io/weaveworks/flux:1.0.0' - imagePullPolicy: IfNotPresent - volumeMounts: - - name: git-key - mountPath: /etc/fluxd/ssh - serviceAccountName: weave-flux - volumes: - - name: git-key - secret: - secretName: flux-git-deploy diff --git a/stable/weave-cloud/templates/rbac.yaml b/stable/weave-cloud/templates/rbac.yaml new file mode 100644 index 0000000000..67e6e9650f --- /dev/null +++ b/stable/weave-cloud/templates/rbac.yaml @@ -0,0 +1,40 @@ +{{- if .Values.rbac.create -}} +apiVersion: rbac.authorization.k8s.io/v1beta1 +kind: ClusterRole +metadata: + name: {{ template "weave-cloud.fullname" . }} + labels: + app: {{ template "weave-cloud.name" . }} + chart: {{ template "weave-cloud.chart" . }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +rules: + - apiGroups: + - '*' + resources: + - '*' + verbs: + - '*' + - nonResourceURLs: + - '*' + verbs: + - '*' +--- +apiVersion: rbac.authorization.k8s.io/v1beta1 +kind: ClusterRoleBinding +metadata: + name: {{ template "weave-cloud.fullname" . }} + labels: + app: {{ template "weave-cloud.name" . }} + chart: {{ template "weave-cloud.chart" . }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: {{ template "weave-cloud.fullname" . }} +subjects: + - name: {{ template "weave-cloud.serviceAccountName" . }} + namespace: {{ .Release.Namespace | quote }} + kind: ServiceAccount +{{- end -}} \ No newline at end of file diff --git a/stable/weave-cloud/templates/scope.yaml b/stable/weave-cloud/templates/scope.yaml deleted file mode 100644 index 6e4fe1281a..0000000000 --- a/stable/weave-cloud/templates/scope.yaml +++ /dev/null @@ -1,95 +0,0 @@ -apiVersion: v1 -kind: List -items: - - apiVersion: v1 - kind: ServiceAccount - metadata: - name: weave-scope - labels: - name: weave-scope - - apiVersion: rbac.authorization.k8s.io/v1beta1 - kind: ClusterRole - metadata: - name: weave-scope - labels: - name: weave-scope - rules: - - apiGroups: - - '*' - resources: - - '*' - verbs: - - '*' - - nonResourceURLs: - - '*' - verbs: - - '*' - - apiVersion: rbac.authorization.k8s.io/v1beta1 - kind: ClusterRoleBinding - metadata: - name: weave-scope - labels: - name: weave-scope - roleRef: - kind: ClusterRole - name: weave-scope - apiGroup: rbac.authorization.k8s.io - subjects: - - kind: ServiceAccount - name: weave-scope - namespace: kube-system - - apiVersion: extensions/v1beta1 - kind: DaemonSet - metadata: - name: weave-scope-agent - labels: - name: weave-scope-agent - app: weave-scope - weave-cloud-component: scope - weave-scope-component: agent - spec: - template: - metadata: - labels: - name: weave-scope-agent - app: weave-scope - weave-cloud-component: scope - weave-scope-component: agent - spec: - containers: - - name: agent - args: - - '--no-app' - - '--probe.docker.bridge=docker0' - - '--probe.docker=true' - - '--probe.kubernetes=true' - - '--service-token={{.Values.ServiceToken}}' - image: 'weaveworks/scope:1.6.5' - imagePullPolicy: IfNotPresent - securityContext: - privileged: true - volumeMounts: - - name: docker-socket - mountPath: /var/run/docker.sock - - name: scope-plugins - mountPath: /var/run/scope/plugins - - name: sys-kernel-debug - mountPath: /sys/kernel/debug - hostNetwork: true - hostPID: true - serviceAccountName: weave-scope - tolerations: - - effect: NoSchedule - operator: Exists - volumes: - - name: docker-socket - hostPath: - path: /var/run/docker.sock - - name: scope-plugins - hostPath: - path: /var/run/scope/plugins - - name: sys-kernel-debug - hostPath: - path: /sys/kernel/debug - updateStrategy: - type: RollingUpdate diff --git a/stable/weave-cloud/templates/secret.yaml b/stable/weave-cloud/templates/secret.yaml new file mode 100644 index 0000000000..b23fa31a96 --- /dev/null +++ b/stable/weave-cloud/templates/secret.yaml @@ -0,0 +1,7 @@ +apiVersion: v1 +kind: Secret +type: Opaque +metadata: + name: weave-cloud +data: + token: {{ .Values.token | b64enc }} diff --git a/stable/weave-cloud/templates/serviceaccount.yaml b/stable/weave-cloud/templates/serviceaccount.yaml new file mode 100644 index 0000000000..71dd98d1be --- /dev/null +++ b/stable/weave-cloud/templates/serviceaccount.yaml @@ -0,0 +1,11 @@ +{{- if .Values.serviceAccount.create -}} +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ template "weave-cloud.serviceAccountName" . }} + labels: + app: {{ template "weave-cloud.name" . }} + chart: {{ template "weave-cloud.chart" . }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +{{- end -}} diff --git a/stable/weave-cloud/update.sh b/stable/weave-cloud/update.sh deleted file mode 100755 index 541fe491ee..0000000000 --- a/stable/weave-cloud/update.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/sh -eux - -# A Weave Cloud user is usually expect to install the agents using one simple command like this: -# kubectl create -n kube-system 'https://cloud.weave.works/k8s/v1.6/weave-cloud?t=' -# -# There is service that generates manifest based on the parameters passed in the URL. -# This chart simply checks-in the YAML manifest generated by the service, and this script is used to -# update the chart. - -for manifest in flux scope cortex ; do - curl --silent --location \ - --get "https://cloud.weave.works/k8s/v1.6/${manifest}" \ - --data-urlencode "service-token={{.Values.ServiceToken}}" \ - --data-urlencode "omit-support-info=true" \ - --output "./templates/${manifest}.yaml" -done diff --git a/stable/weave-cloud/values.yaml b/stable/weave-cloud/values.yaml index a329708f16..d5c7d7cdd4 100644 --- a/stable/weave-cloud/values.yaml +++ b/stable/weave-cloud/values.yaml @@ -1 +1,22 @@ -# ServiceToken: "" +# Default values for weave-cloud. + +token: "" + +agent: + name: weave-agent + +image: + repository: quay.io/weaveworks/launcher-agent + tag: 1.0.0 + pullPolicy: IfNotPresent + +rbac: + # Specifies whether RBAC resources should be created + create: true + +serviceAccount: + # Specifies whether a service account should be created + create: true + # The name of the service account to use. + # If not set and create is true, a name is generated using the fullname template + name: