dhall-kubernetes/examples/aws-iam-authenticator-chart.dhall
Gabriel Gonzalez 89e7c8ed0b
Automate exclusion of duplicate resources (#99)
Related to https://github.com/dhall-lang/dhall-kubernetes/issues/75

In order to support multiple versions of the Kubernetes API we need to begin
automating the process of excluding duplicate resources (otherwise the
maintenance burden would be far too high).  This change adds new support
for automatically preferring Kubernetes resources by version where:

* v2 is prioritized over v1
* production is prioritized over beta, which is prioritized over alpha

Note that even when prioritizing by version there are still a few cases of
duplicates.  For now we use the default behavior of `Data.List.maximumBy`
to select the last resource if there are still conflicts.  This leads to
a few differences in which resources are preferred when such a conflict
arises (where previously we were just guessing manually which one to pick).
2020-01-03 08:51:05 -08:00

122 lines
4.5 KiB
Plaintext

let kubernetes =
../package.dhall sha256:0a6949aabfb5a1250f08c4e3a533024d4705bea98ace08d8d107417e54a9648a
let release = "wintering-rodent"
let name = "aws-iam-authenticator"
let fullName = "${release}-${name}"
let version = "0.1.1"
let chart = "${name}-${version}"
let heritage = "dhall"
in kubernetes.DaemonSet::{
, metadata =
kubernetes.ObjectMeta::{
, name = fullName
, labels =
toMap
{ app = name
, chart = chart
, release = release
, heritage = heritage
}
}
, spec =
Some
kubernetes.DaemonSetSpec::{
, updateStrategy =
Some
kubernetes.DaemonSetUpdateStrategy::{
, type = Some "RollingUpdate"
}
, template =
kubernetes.PodTemplateSpec::{
, metadata =
kubernetes.ObjectMeta::{
, name = name
, annotations =
toMap
{ `scheduler.alpha.kubernetes.io/critical-pod` = "" }
, labels = toMap { app = name, release = release }
}
, spec =
Some
kubernetes.PodSpec::{
, hostNetwork = Some True
, nodeSelector =
toMap { `node-role.kubernetes.io/master` = "" }
, tolerations =
[ kubernetes.Toleration::{
, effect = Some "NoSchedule"
, key = Some "node-role.kubernetes.io/master"
}
, kubernetes.Toleration::{
, effect = Some "CriticalAddonsOnly"
, key = Some "Exists"
}
]
, containers =
[ kubernetes.Container::{
, name = fullName
, image =
Some "gcr.io/heptio-images/authenticator:v0.1.0"
, args =
[ "server"
, "--config=/etc/aws-iam-authenticator/config.yaml"
, "--state-dir=/var/aws-iam-authenticator"
, "--generate-kubeconfig=/etc/kubernetes/aws-iam-authenticator/kubeconfig.yaml"
]
, volumeMounts =
[ kubernetes.VolumeMount::{
, name = "config"
, mountPath = "/etc/aws-iam-authenticator/"
}
, kubernetes.VolumeMount::{
, name = "state"
, mountPath = "/var/aws-iam-authenticator/"
}
, kubernetes.VolumeMount::{
, name = "output"
, mountPath =
"/etc/kubernetes/aws-iam-authenticator/"
}
]
}
]
, volumes =
[ kubernetes.Volume::{
, name = "config"
, configMap =
Some
kubernetes.ConfigMapVolumeSource::{
, name = Some fullName
}
}
, kubernetes.Volume::{
, name = "output"
, hostPath =
Some
kubernetes.HostPathVolumeSource::{
, path =
"/srv/kubernetes/aws-iam-authenticator/"
}
}
, kubernetes.Volume::{
, name = "state"
, hostPath =
Some
kubernetes.HostPathVolumeSource::{
, path =
"/srv/kubernetes/aws-iam-authenticator/"
}
}
]
}
}
}
}