https://github.com/codefresh-io/k8s-dind-config
https://github.com/codefresh-io/k8s-dind-config
Last synced: 8 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/codefresh-io/k8s-dind-config
- Owner: codefresh-io
- Created: 2017-09-20T08:39:47.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2022-06-14T18:04:06.000Z (almost 4 years ago)
- Last Synced: 2025-04-25T14:59:42.620Z (about 1 year ago)
- Language: Shell
- Size: 43 KB
- Stars: 4
- Watchers: 14
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Deprecated!
Please use [Venona](https://github.com/codefresh-io/venona)
### Configure K8s for Codefresh builds
The script configures your Kubernetes cluster namespace to run codefresh.io builds
Please ensure:
- Kubernetes version is 1.6 or newer, kubectl is installed and confired to your cluster
- For RBAC enabled clusters service-account of the namespace should have write permisions for "services","pods","configmaps","secrets" - see rbac.yaml
- You have Codefresh API Access Token - see https://g.codefresh.io/api/
- The cluster is registred in Codefresh - see https://codefresh.io/docs/docs/deploy-to-kubernetes/adding-non-gke-kubernetes-cluster/
- You
Simplest way to create codefresh namespace with required permissions:
```
kubectl create namespace codefresh
kubectl apply -f rbac.yaml
```
Usage:
```sh
./codefresh-k8s-configure.sh [ options ] cluster_name
options:
--api-token - default $API_TOKEN
--namespace - default codefresh
--context
--image-tag
```
It will submit pod with codefresh-configure-$(date '+%Y-%m-%d-%H%M%S'):
```yaml
---
apiVersion: v1
kind: Pod
metadata:
name: ${POD_NAME}
annotations:
forceRedeployUniqId: "N/A"
labels:
app: codefresh-config
spec:
restartPolicy: Never
containers:
- image: codefresh/k8s-dind-config:${IMAGE_TAG:-latest}
name: k8s-dind-config
imagePullPolicy: Always
command:
- "/app/k8s-dind-config"
env:
- name: NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
- name: API_HOST
value: "${API_HOST}"
- name: API_TOKEN
value: "${API_TOKEN}"
- name: REGISTRY_TOKEN
value: "${REGISTRY_TOKEN}"
- name: CLUSTER_NAME
value: "${CLUSTER_NAME}"
```