Is it possible to deploy kubernetes application through bazel?
You need to use the k8s_object to interact with Kubernetes cluster.
You can create a Deployment that will deploy your application to the cluster:
Here is an example nginx-deployment.yaml
:
apiVersion: apps/v1kind: Deploymentmetadata: name: nginx-deployment labels: app: nginxspec: replicas: 3 selector: matchLabels: app: nginx template: metadata: labels: app: nginx spec: containers: - name: nginx image: nginx:1.7.9 ports: - containerPort: 80
You have to use that yaml
file as a template in the bazel k8s_object, so it would look like this:k8s_object(name = "nginx", kind = "create", template = "nginx-deployment.yaml")