Skip to content

Commit

Permalink
cluster api
Browse files Browse the repository at this point in the history
  • Loading branch information
michael levan committed Jul 7, 2023
1 parent 3735c54 commit 299711e
Show file tree
Hide file tree
Showing 50 changed files with 85 additions and 6 deletions.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
apiVersion: simplyengineering.com/v1
kind: MikesNginxApp
kind: MikesAPI
metadata:
name: mikesapptest
spec:
image: nginx:latest
replicas: 2
replicas: 2
deployment:
name: test
namespace: default
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,16 @@ import (

// MikesAPISpec defines the desired state of MikesAPI
type MikesAPISpec struct {
// INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
// Important: Run "make" to regenerate code after modifying this file
Image string `json:"image"`

Replica int `json:"replica"`

MikesPhoneNumber string `json:"mikesPhoneNumber"`
Deployment []Namespaced `json:"deployment"`
}

MikesAge string `json:"mikesAge"`
type Namespaced struct {
Name string `json:"name"`
Namespace string `json:"namespace"`
}

// MikesAPIStatus defines the observed state of MikesAPI
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Empty file added capi-azurekubeadm.yaml
Empty file.
3 changes: 3 additions & 0 deletions cluster-api/apply.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```
kubectl apply -f capi-azurekubeadm.yaml
```
3 changes: 3 additions & 0 deletions cluster-api/cloud-provider.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```
helm install --kubeconfig=./capi-azure.kubeconfig --repo https://raw.githubusercontent.com/kubernetes-sigs/cloud-provider-azure/master/helm/repo cloud-provider-azure --generate-name --set infra.clusterName=capi-azure --set cloudControllerManager.clusterCIDR="192.168.0.0/16"
```
4 changes: 4 additions & 0 deletions cluster-api/cni-install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
```
helm repo add projectcalico https://docs.tigera.io/calico/charts --kubeconfig=./capi-azure.kubeconfig && \
helm install calico projectcalico/tigera-operator --kubeconfig=./capi-azure.kubeconfig -f https://raw.githubusercontent.com/kubernetes-sigs/cluster-api-provider-azure/main/templates/addons/calico/values.yaml --namespace tigera-operator --create-namespace
```
3 changes: 3 additions & 0 deletions cluster-api/connect-to-cluster.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```
clusterctl get kubeconfig capi-azure > capi-azure.kubeconfig
```
12 changes: 12 additions & 0 deletions cluster-api/install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
## Linux

```
curl -L https://github.com/kubernetes-sigs/cluster-api/releases/download/v1.4.4/clusterctl-linux-amd64 -o clusterctl
sudo install -o root -g root -m 0755 clusterctl /usr/local/bin/clusterctl
```

## Mac
```
brew install clusterctl
```
33 changes: 33 additions & 0 deletions cluster-api/mgmtinit-azure.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
```
export CLUSTER_TOPOLOGY=true
```

```
export AZURE_SUBSCRIPTION_ID=""
# Create an Azure Service Principal and paste the output here
export AZURE_TENANT_ID=""
export AZURE_CLIENT_ID=""
export AZURE_CLIENT_SECRET=""
# Base64 encode the variables
export AZURE_SUBSCRIPTION_ID_B64="$(echo -n "$AZURE_SUBSCRIPTION_ID" | base64 | tr -d '\n')"
export AZURE_TENANT_ID_B64="$(echo -n "$AZURE_TENANT_ID" | base64 | tr -d '\n')"
export AZURE_CLIENT_ID_B64="$(echo -n "$AZURE_CLIENT_ID" | base64 | tr -d '\n')"
export AZURE_CLIENT_SECRET_B64="$(echo -n "$AZURE_CLIENT_SECRET" | base64 | tr -d '\n')"
# Settings needed for AzureClusterIdentity used by the AzureCluster
export AZURE_CLUSTER_IDENTITY_SECRET_NAME="cluster-identity-secret"
export CLUSTER_IDENTITY_NAME="cluster-identity"
export AZURE_CLUSTER_IDENTITY_SECRET_NAMESPACE="default"
```

```
# Create a secret to include the password of the Service Principal identity created in Azure
kubectl create secret generic "${AZURE_CLUSTER_IDENTITY_SECRET_NAME}" --from-literal=clientSecret="${AZURE_CLIENT_SECRET}" --namespace "${AZURE_CLUSTER_IDENTITY_SECRET_NAMESPACE}"
```

```
# Finally, initialize the management cluster
clusterctl init --infrastructure azure
```
12 changes: 12 additions & 0 deletions cluster-api/workloadcreation-azure.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
```
export AZURE_LOCATION="eastus"
export AZURE_CONTROL_PLANE_MACHINE_TYPE="Standard_D2s_v3"
export AZURE_NODE_MACHINE_TYPE="Standard_D2s_v3"
export AZURE_RESOURCE_GROUP="devrelasaservice"
```

```
clusterctl generate cluster capi-azure --kubernetes-version v1.27.0 > capi-azurekubeadm.yaml
```
2 changes: 2 additions & 0 deletions service-mesh/istio/prod.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ helm install istiod istio/istiod -n istio-system --wait

# Ingress
kubectl create namespace istio-ingress

kubectl label namespace istio-ingress istio-injection=enabled

helm install istio-ingress istio/gateway -n istio-ingress --wait

# Confirm status
Expand Down

0 comments on commit 299711e

Please sign in to comment.