Spinnaker: Deploy Manifest fails to parse manifest

Created on 20 Jun 2018  路  3Comments  路  Source: spinnaker/spinnaker

Issue Summary:

Deploy Manifest fails to parse manifest

Cloud Provider(s):

k8s/GKE

Environment:

GKE standard node set up

Feature Area:

Kubernetes Manifest based support

Description:

Testing stage with single yaml and got

"Exception ( Deploy Manifest )
Failure evaluating manifest expressions: {#!/bin/bash set -x [ -z "ID_OFFSET" ] && ID_OFFSET=1 export ZOOKEEPER_SERVER_ID=(({HOSTNAME##-} + ID_OFFSET)) echo "{ZOOKEEPER_SERVER_ID:-1}" | tee /var/lib/zookeeper/data/myid cp -Lur /etc/kafka-configmap/ /etc/kafka/ sed -i "s/server.ZOOKEEPER_SERVER_ID=[a-z0-9.-]*/server.ZOOKEEPER_SERVER_ID=0.0.0.0/" /etc/kafka/zookeeper.properties=[Result {description='Failed to evaluate [init.sh] EL1041E: After parsing a valid expression, there is still more data in the expression: 'hash(#)'', exceptionType=class org.springframework.expression.spel.SpelParseException, timestamp=1529516695410, level=ERROR}]}"

Steps to Reproduce:

Deploy a manifest with a fairly complex yaml (see https://github.com/Yolean/kubernetes-kafka/blob/master/zookeeper/10zookeeper-config.yml )

Additional Details:

image

Most helpful comment

Is there no other solution then "escaping" environment variables again?

That would lead us in the direction, that we have to fork all helm charts (like keycloak, postgres, neo4j, ...) which contains environement variables and have the need to escape the environment variables.

Is that real the solution?
Is there something other available? Like changing the SPeL character from $ to @ maybe? So that spinnaker SPel is not using the same character like the environment variables.

Moreover the escaping breaks for us the default helm installation. So we are manipulating the helm charts in that manner, that they are just working with spinnaker not with plain helm.

All 3 comments

See: https://github.com/spinnaker/spinnaker/issues/2809

Since Spinnaker ships with a template parser, you unfortunately need to escape the template expressions of the form ${ .. }. The above issue shows the fix.

Is there no other solution then "escaping" environment variables again?

That would lead us in the direction, that we have to fork all helm charts (like keycloak, postgres, neo4j, ...) which contains environement variables and have the need to escape the environment variables.

Is that real the solution?
Is there something other available? Like changing the SPeL character from $ to @ maybe? So that spinnaker SPel is not using the same character like the environment variables.

Moreover the escaping breaks for us the default helm installation. So we are manipulating the helm charts in that manner, that they are just working with spinnaker not with plain helm.

I'm using fluentd as a sidecar container for logging for all my applications. However, the yaml parsing is failing. I've checked Evaluate SpEL expressions in overrides at bake time and Skip SpEL expression evaluation. Here is the configmap for fluentd. Any ideas?

kind: ConfigMap
apiVersion: v1
metadata:
  name: fluentd-cloudwatch
  labels:
    app: fluentd-cloudwatch
    chart: fluentd-cloudwatch-0.7.1
    release: fluentd-cloudwatch
data:
  fluent.conf: |
    <match fluent.**>
        @type null
    </match>

    <source>
        @type tail
        enable_stat_watcher false
        path /logs/*/*.log
        pos_file /var/log/fluentd-containers.log.pos
        tag "*-#{ENV['POD_NAME']}-#{ENV['NODE_NAME']}"
        read_from_head true
        emit_unmatched_lines true
        <parse>
        @type json
        time_format %Y-%m-%dT%H:%M:%S.%NZ
        </parse>
    </source>

    <filter **>
       @type record_transformer
       @id filter_containers_stream_transformer
       <record>
        stream_name ${tag_suffix[2]}
       </record>
    </filter>

    <match **>
        @type cloudwatch_logs
        log_group_name "/k8s/#{ENV['POD_NAMESPACE']}"
        log_stream_name_key stream_name
        remove_log_stream_name_key true
        auto_create_stream true
        retention_in_days 90
        <buffer>
        flush_interval 15s
        chunk_limit_size 2m
        queued_chunks_limit_size 32
        retry_forever true
        </buffer>
    </match>

Was this page helpful?
0 / 5 - 0 ratings