Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expand YAML anchors in releases #11468

Closed
davidspek opened this issue Jun 4, 2021 · 0 comments · Fixed by #11581
Closed

Expand YAML anchors in releases #11468

davidspek opened this issue Jun 4, 2021 · 0 comments · Fixed by #11581
Labels
kind/feature Well-understood/specified features, ready for coding.
Milestone

Comments

@davidspek
Copy link
Contributor

Duplicate of #9350.

With the v0.22.0 release I noticed there were a lot of YAML anchors used in https://github.com/knative/serving/releases/download/v0.22.0/serving-core.yaml. The problem appeared when trying to use the manifest as a remote resource using Kustomize for Kubeflow deployments, as Kustomize has problems with YAML anchors (see kubernetes-sigs/kustomize#3675). I assumed the use of YAML anchors was a conscious decision so I didn't think it would make sense to request the removal of anchors.

However, I just noticed that the release file for v0.23.0 contains only 1 YAML anchor for a readinessProbe and livenessProbe at line 4873. This is part of the webhook deployment below. Would it be possible to remove this last YAML anchor so that the KNative release manifests can be used as remote resources in Kustomize?

apiVersion: apps/v1
kind: Deployment
metadata:
  name: webhook
  namespace: knative-serving
  labels:
    serving.knative.dev/release: "v0.23.0"
spec:
  selector:
    matchLabels:
      app: webhook
      role: webhook
  template:
    metadata:
      annotations:
        cluster-autoscaler.kubernetes.io/safe-to-evict: "false"
      labels:
        app: webhook
        role: webhook
        serving.knative.dev/release: "v0.23.0"
    spec:
      # To avoid node becoming SPOF, spread our replicas to different nodes.
      affinity:
        podAntiAffinity:
          preferredDuringSchedulingIgnoredDuringExecution:
            - podAffinityTerm:
                labelSelector:
                  matchLabels:
                    app: webhook
                topologyKey: kubernetes.io/hostname
              weight: 100
      serviceAccountName: controller
      containers:
        - name: webhook
          # This is the Go import path for the binary that is containerized
          # and substituted here.
          image: gcr.io/knative-releases/knative.dev/serving/cmd/webhook@sha256:a276669c3ec2ee82f9399c6e0cc1b1923a16e7341e8973b10eee6a83d9c9ba44
          resources:
            requests:
              cpu: 100m
              memory: 100Mi
            limits:
              cpu: 500m
              memory: 500Mi
          env:
            - name: POD_NAME
              valueFrom:
                fieldRef:
                  fieldPath: metadata.name
            - name: SYSTEM_NAMESPACE
              valueFrom:
                fieldRef:
                  fieldPath: metadata.namespace
            - name: CONFIG_LOGGING_NAME
              value: config-logging
            - name: CONFIG_OBSERVABILITY_NAME
              value: config-observability
            - name: WEBHOOK_NAME
              value: webhook
            - name: WEBHOOK_PORT
              value: "8443"
            # TODO(https://github.com/knative/pkg/pull/953): Remove stackdriver specific config
            - name: METRICS_DOMAIN
              value: knative.dev/internal/serving
          securityContext:
            allowPrivilegeEscalation: false
            readOnlyRootFilesystem: true
            runAsNonRoot: true
            capabilities:
              drop:
                - all
          ports:
            - name: metrics
              containerPort: 9090
            - name: profiling
              containerPort: 8008
            - name: https-webhook
              containerPort: 8443
          readinessProbe: &probe
            periodSeconds: 1
            httpGet:
              scheme: HTTPS
              port: 8443
              httpHeaders:
                - name: k-kubelet-probe
                  value: "webhook"
          livenessProbe:
            !!merge <<: *probe
            failureThreshold: 6
            initialDelaySeconds: 20
      # Our webhook should gracefully terminate by lame ducking first, set this to a sufficiently
      # high value that we respect whatever value it has configured for the lame duck grace period.
      terminationGracePeriodSeconds: 300
@davidspek davidspek added the kind/feature Well-understood/specified features, ready for coding. label Jun 4, 2021
@dprotaso dprotaso added this to the 0.24.x milestone Jun 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Well-understood/specified features, ready for coding.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants