I've got a kubernetes cluster which was set up with kops with 1.5, and then upgraded to 1.6.2. I'm trying to use PodPresets. The docs state the following requirements:
- You have enabled the api type settings.k8s.io/v1alpha1/podpreset
- You have enabled the admission controller PodPreset
- You have defined your pod presets
I'm seeing that for 1.6.x, the first is taken care of (how can I verify?). How can I apply the second? I can see that there are three kube-apiserver-* pods running in the cluster (I imagine it's for the 3 azs). I guess I can edit their yaml config from kubernetes dashboard and add PodPreset to the admission-control string. But is there a better way to achieve this?
Enable PodPreset in your cluster In order to use Pod presets in your cluster you must ensure the following: You have enabled the API type settings.k8s.io/v1alpha1/podpreset . For example, this can be done by including settings.k8s.io/v1alpha1=true in the --runtime-config option for the API server.
kubeadm installs clusters on existing infrastructure; whereas, kops builds the EC2 instances for you, and can also build VPC, IAM, Security groups and a number of other features as well. If you need HA masters or manifest-based cluster management, then kops may also be your first choice.
Kops is sometimes referred to as the 'kubectl' for spinning up clusters. Kops lets you create, destroy and upgrade Kubernetes clusters and is supported on AWS (Amazon Web Services, we cover more of this on our Kubernetes on AWS - what you need to know page) with GKE in beta support, and VMware vSphere in alpha.
kOps, also known as Kubernetes operations, is an open-source project which helps you create, destroy, upgrade, and maintain a highly available, production-grade Kubernetes cluster. Depending on the requirement, kOps can also provision cloud infrastructure.
You can list the API groups which are currently enabled in your cluster either with the api-versions
kubectl command, or by sending a GET request to the /apis
endpoint of your kube-apiserver
:
$ curl localhost:8080/apis
{
"paths": [
"/api",
"/api/v1",
"...",
"/apis/settings.k8s.io",
"/apis/settings.k8s.io/v1alpha1",
"...",
}
Note: The
settings.k8s.io/v1alpha1
API is enabled by default on Kubernetes v1.6 and v1.7 but will be disabled by default in v1.8.
You can use a kops ClusterSpec to customize the configuration of your Kubernetes components during the cluster provisioning, including the API servers.
This is described on the documentation page Using A Manifest to Manage kops Clusters, and the full spec for the KubeAPIServerConfig type is available in the kops GoDoc.
Example:
apiVersion: kops/v1
kind: Cluster
metadata:
name: k8s.example.com
spec:
kubeAPIServer:
AdmissionControl:
- NamespaceLifecycle
- LimitRanger
- PodPreset
To update an existing cluster, perform the following steps:
Get the full cluster configuration with
kops get cluster name --full
Copy the kubeAPIServer spec block from it.
Do not push back the full configuration. Instead, edit the cluster configuration with
kops edit cluster name
Paste the kubeAPIServer spec block, add the missing bits, and save.
Update the cluster resources with
kops update cluster nane
Perform a rolling update to apply the changes:
kops rolling-update name
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With