Skip to content

Commit

Permalink
Merge pull request #49 from DataDog/v0.3
Browse files Browse the repository at this point in the history
release v0.3.0 to master
  • Loading branch information
clamoriniere committed Oct 4, 2020
2 parents 044d045 + 3e2beeb commit d72a1bc
Show file tree
Hide file tree
Showing 9 changed files with 99 additions and 15 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build the manager binary
FROM golang:1.13 as builder
FROM golang:1.14 as builder

WORKDIR /workspace
# Copy the Go Modules manifests
Expand Down
4 changes: 2 additions & 2 deletions RELEASING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## Steps

1. Checkout the repository on the correct branch and changeset (`master`).
1. Checkout the repository on the correct branch and changeset (`master`).Creates a new branch if it is the first release for a "minor" version: `git checkout -b vX.Y`.
2. Run the bundle generation:
- For a release candidate, run the following command, locally: `make VERSION=x.v.z-rc.w bundle`
For example, to generate the release version `0.3.0-rc.2`, run: `make VERSION=0.3.0-rc.2 bundle`
Expand All @@ -21,7 +21,7 @@
5. Push the generated commit and tag to the repostory branch.

```console
$ git push origin master
$ git push origin vX.Y
$ git push origin vX.Y.Z
```

Expand Down
11 changes: 6 additions & 5 deletions bundle/manifests/extendeddaemonset.clusterserviceversion.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ metadata:
capabilities: Full Lifecycle
operators.operatorframework.io/builder: operator-sdk-v1.0.0
operators.operatorframework.io/project_layout: go.kubebuilder.io/v2
name: extendeddaemonset.v0.2.0
name: extendeddaemonset.v0.3.0
namespace: placeholder
spec:
apiservicedefinitions: {}
Expand Down Expand Up @@ -203,7 +203,7 @@ spec:
deployments:
- name: eds-controller-manager
spec:
replicas: 1
replicas: 2
selector:
matchLabels:
app.kubernetes.io/name: extendeddaemonset
Expand Down Expand Up @@ -243,10 +243,10 @@ spec:
resources:
limits:
cpu: 100m
memory: 30Mi
memory: 100Mi
requests:
cpu: 100m
memory: 20Mi
memory: 100Mi
terminationGracePeriodSeconds: 10
permissions:
- rules:
Expand Down Expand Up @@ -303,4 +303,5 @@ spec:
provider:
name: Datadog
url: https://github.com/DataDog/extendeddaemonset
version: 0.2.0
replaces: extendeddaemonset.v0.2.0
version: 0.3.0
4 changes: 2 additions & 2 deletions chart/extendeddaemonset/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
apiVersion: v1
appVersion: v0.2.0
appVersion: v0.3.0
description: Extended Daemonset Controller
name: extendeddaemonset
version: v0.2.0
version: v0.3.0
2 changes: 1 addition & 1 deletion chart/extendeddaemonset/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
replicaCount: 1
image:
repository: datadog/extendeddaemonset
tag: v0.2.0
tag: v0.3.0
pullPolicy: IfNotPresent
imagePullSecrets: []
nameOverride: ""
Expand Down
28 changes: 28 additions & 0 deletions examples/foo-eds_exclude-node.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
apiVersion: datadoghq.com/v1alpha1
kind: ExtendedDaemonSet
metadata:
name: foo
spec:
strategy:
canary:
replicas: 1
duration: 5m
rollingUpdate:
maxParallelPodCreation: 1
slowStartIntervalDuration: 1m
template:
spec:
containers:
- name: daemon
image: k8s.gcr.io/pause:3.0
tolerations:
- operator: Exists
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: extendeddaemonset.datadoghq.com/exclude
operator: NotIn
values:
- foo
19 changes: 19 additions & 0 deletions examples/foo-eds_v1.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
apiVersion: datadoghq.com/v1alpha1
kind: ExtendedDaemonSet
metadata:
name: foo
spec:
strategy:
canary:
replicas: 1
duration: 5m
rollingUpdate:
maxParallelPodCreation: 1
slowStartIntervalDuration: 1m
template:
spec:
containers:
- name: daemon
image: k8s.gcr.io/pause:3.0
tolerations:
- operator: Exists
19 changes: 19 additions & 0 deletions examples/foo-eds_v2.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
apiVersion: datadoghq.com/v1alpha1
kind: ExtendedDaemonSet
metadata:
name: foo
spec:
strategy:
canary:
replicas: 1
duration: 5m
rollingUpdate:
maxParallelPodCreation: 1
slowStartIntervalDuration: 1m
template:
spec:
containers:
- name: daemon
image: k8s.gcr.io/pause:3.1
tolerations:
- operator: Exists
25 changes: 21 additions & 4 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ func main() {

// Custom flags
var printVersion, pprofActive bool
var logEncoder string
flag.StringVar(&logEncoder, "logEncoder", "json", "log encoding ('json' or 'console')")
logLevel := zap.LevelFlag("loglevel", zapcore.InfoLevel, "Set log level")
flag.BoolVar(&printVersion, "version", false, "Print version and exit")
flag.BoolVar(&pprofActive, "pprof", false, "Enable pprof endpoint")
Expand All @@ -69,7 +71,10 @@ func main() {
flag.Parse()

// Logging setup
customSetupLogging(*logLevel)
if err := customSetupLogging(*logLevel, logEncoder); err != nil {
setupLog.Error(err, "unable to setup the logger")
os.Exit(1)
}

// Print version information
if printVersion {
Expand All @@ -85,7 +90,7 @@ func main() {
HealthProbeBindAddress: ":8081",
Port: 9443,
LeaderElection: enableLeaderElection,
LeaderElectionID: "e361fbac.datadoghq.com",
LeaderElectionID: "extendeddaemonset-lock",
}))
if err != nil {
setupLog.Error(err, "unable to start manager")
Expand Down Expand Up @@ -146,12 +151,24 @@ func customSetupEnvironment(mgr manager.Manager) {
}
}

func customSetupLogging(logLevel zapcore.Level) {
func customSetupLogging(logLevel zapcore.Level, logEncoder string) error {
var encoder zapcore.Encoder
switch logEncoder {
case "console":
encoder = zapcore.NewConsoleEncoder(zap.NewProductionEncoderConfig())
case "json":
encoder = zapcore.NewJSONEncoder(zap.NewProductionEncoderConfig())
default:
return fmt.Errorf("unknow log encoder: %s", logEncoder)
}

ctrl.SetLogger(ctrlzap.New(
ctrlzap.Encoder(zapcore.NewConsoleEncoder(zap.NewProductionEncoderConfig())),
ctrlzap.Encoder(encoder),
ctrlzap.Level(logLevel),
ctrlzap.StacktraceLevel(zapcore.PanicLevel)),
)

return nil
}

func customSetupHealthChecks(mgr manager.Manager) {
Expand Down

0 comments on commit d72a1bc

Please sign in to comment.