deployment

package
v0.34.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 14, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Example
package main

import (
	"embed"
	"os"

	testlog "knative.dev/reconciler-test/pkg/logging"
	"knative.dev/reconciler-test/pkg/manifest"
)

//go:embed *.yaml
var yaml embed.FS

func main() {
	ctx := testlog.NewContext()
	images := map[string]string{}
	cfg := map[string]interface{}{
		"name":      "foo",
		"namespace": "bar",
		"selectors": map[string]string{"app": "foo"},
		"image":     "gcr.io/knative-samples/helloworld-go",
		"port":      8080,
	}

	files, err := manifest.ExecuteYAML(ctx, yaml, images, cfg)

	if err != nil {
		panic(err)
	}

	manifest.OutputYAML(os.Stdout, files)
}
Output:

apiVersion: apps/v1
kind: Deployment
metadata:
  name: foo
  namespace: bar
spec:
  selector:
    matchLabels:
      app: foo
  template:
    metadata:
      labels:
        app: foo
    spec:
      containers:
        - name: user-container
          image: gcr.io/knative-samples/helloworld-go
          ports:
            - containerPort: 8080
          env:
          - name: POD_NAME
            value: heartbeats
          - name: POD_NAMESPACE
            value: bar

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func AsRef

func AsRef(name string) *duckv1.KReference

AsRef returns a KRef for a Deployment without namespace.

func AsTrackerReference

func AsTrackerReference(name string) *tracker.Reference

func Install

func Install(name string) feature.StepFn

Install will create a Deployment with defaults that can be overwritten by the With* methods.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL