Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cover app info to all commands #177

Merged
merged 3 commits into from Feb 4, 2020
Merged

Cover app info to all commands #177

merged 3 commits into from Feb 4, 2020

Conversation

wingkwong
Copy link
Contributor

Refer to issue #133. Add app info NAME command to the rest of apps

Description

  • Added app info nginx-ingress, cert-manager, metrics-server, tiller, linkerd, cron-connector, kafka-connector, minio, postgresql, kubernetes-dashboard, istio, crossplane
  • Added a bool parameter streamStdio to function GetClientArch in pkg/env. Currently StreamStdio is hardcored as true. Running app minio info will print out clientArch and clientOS.
    Hence, I added this to suppress the unwanted output.
  • Added mongodb to "Apps that you can install today" in README.md. It's missing.

Motivation and Context

  • I have raised an issue to propose this change (required)

How Has This Been Tested?

$ make dist
$ bin/k3sup-darwin app info nginx-ingress
Info for app: nginx-ingress
# If you're using a local environment such as "minikube" or "KinD",
# then try the inlets operator with "k3sup app install inlets-operator"

# If you're using a managed Kubernetes service, then you'll find
# your LoadBalancer's IP under "EXTERNAL-IP" via:

kubectl get svc nginx-ingress-controller

# Find out more at:
# https://github.com/helm/charts/tree/master/stable/nginx-ingress
$ bin/k3sup-darwin app info cert-manager
Info for app: cert-manager
# Get started with cert-manager here:
# https://docs.cert-manager.io/en/latest/tutorials/acme/http-validation.html

# Check cert-manager's logs with:

kubectl logs -n cert-manager deploy/cert-manager -f
$ bin/k3sup-darwin app info metrics-server
Info for app: metrics-server
# Check pod usage

kubectl top pod

# Check node usage

kubectl top node


# Find out more at:
# https://github.com/helm/charts/tree/master/stable/metrics-server
$ bin/k3sup-darwin app info tiller
Info for app: tiller
# You can now use helm with tiller from the installation directory
/Users/wingkwong/.k3sup/bin/helm
$ bin/k3sup-darwin app info linkerd
Info for app: linkerd
# Get the linkerd-cli
curl -sL https://run.linkerd.io/install | sh

# Find out more at:
# https://linkerd.io

# To use the Linkerd CLI set this path:

export PATH=$PATH:/Users/wingkwong/.k3sup/bin
linkerd --help
$ bin/k3sup-darwin app info cron-connector
Info for app: cron-connector
# Example usage to trigger nodeinfo every 5 minutes:

faas-cli store deploy nodeinfo \
  --annotation schedule="*/5 * * * *" \
  --annotation topic=cron-function

# View the connector's logs:

kubectl logs deploy/cron-connector -n openfaas -f

# Find out more on the project homepage:

# https://github.com/openfaas-incubator/cron-connector/
$ bin/k3sup-darwin app info kafka-connector
Info for app: kafka-connector
# View the connector's logs:

kubectl logs deploy/kafka-connector -n openfaas -f

# Find out more on the project homepage:

# https://github.com/openfaas-incubator/kafka-connector/
$ bin/k3sup-darwin app info minio
Info for app: minio
# Forward the minio port to your machine
kubectl port-forward -n default svc/minio 9000:9000 &

# Get the access and secret key to gain access to minio
ACCESSKEY=$(kubectl get secret -n default minio -o jsonpath="{.data.accesskey}" | base64 --decode; echo)
SECRETKEY=$(kubectl get secret -n default minio -o jsonpath="{.data.secretkey}" | base64 --decode; echo)

# Get the Minio Client
curl -SLf https://dl.min.io/client/mc/release/darwin-amd64/mc \
  && chmod +x mc

# Add a host
mc config host add minio http://127.0.0.1:9000 $ACCESSKEY $SECRETKEY

# List buckets
mc ls minio

# Find out more at: https://min.io
$ bin/k3sup-darwin app info postgresql
Info for app: postgresql
PostgreSQL can be accessed via port 5432 on the following DNS name from within your cluster:

        postgresql.default.svc.cluster.local - Read/Write connection

To get the password for "postgres" run:

    export POSTGRES_PASSWORD=$(kubectl get secret --namespace default postgresql -o jsonpath="{.data.postgresql-password}" | base64 --decode)

To connect to your database run the following command:

    kubectl run postgresql-client --rm --tty -i --restart='Never' --namespace default --image docker.io/bitnami/postgresql:11.6.0-debian-9-r0 --env="PGPASSWORD=$POSTGRES_PASSWORD" --command -- psql --host postgresql -U postgres -d postgres -p 5432

To connect to your database from outside the cluster execute the following commands:

    kubectl port-forward --namespace default svc/postgresql 5432:5432 &
        PGPASSWORD="$POSTGRES_PASSWORD" psql --host 127.0.0.1 -U postgres -d postgres -p 5432

# Find out more at: https://github.com/helm/charts/tree/master/stable/postgresql
$ bin/k3sup-darwin app info kubernetes-dashboard
Info for app: kubernetes-dashboard
# To create the Service Account and the ClusterRoleBinding
# @See https://github.com/kubernetes/dashboard/blob/master/docs/user/access-control/creating-sample-user.md#creating-sample-user

cat <<EOF | kubectl apply -f -
---
apiVersion: v1
kind: ServiceAccount
metadata:
  name: admin-user
  namespace: kubernetes-dashboard
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
  name: admin-user
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: cluster-admin
subjects:
- kind: ServiceAccount
  name: admin-user
  namespace: kubernetes-dashboard
---
EOF

#To forward the dashboard to your local machine 
kubectl proxy

#To get your Token for logging in
kubectl -n kubernetes-dashboard describe secret $(kubectl -n kubernetes-dashboard get secret | grep admin-user-token | awk '{print $1}')

# Once Proxying you can navigate to the below
http://localhost:8001/api/v1/namespaces/kubernetes-dashboard/services/https:kubernetes-dashboard:/proxy/#/login
$ bin/k3sup-darwin app info istio
Info for app: istio
# Find out more at:
# https://github.com/istio/
$ bin/k3sup-darwin app info crossplane
Info for app: crossplane
# Get started by installing a stack for your favorite provider:
* stack-gcp: https://crossplane.io/docs/master/install-crossplane.html#gcp-stack
* stack-aws: https://crossplane.io/docs/master/install-crossplane.html#aws-stack
* stack-azure: https://crossplane.io/docs/master/install-crossplane.html#azure-stack

Learn more about Crossplane: https://crossplaneio.github.io/docs/

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I've read the CONTRIBUTION guide
  • I have signed-off my commits with git commit -s
  • I have added tests to cover my changes.
  • All new and existing tests passed.

Slient the unwanted output as the value will be printed after calling this function

Signed-off-by: wingkwong <wingkwong.code@gmail.com>
Enable applications to show thier info. The available applications are nginx-ingress, cert-manager, metrics-server, tiller, linkerd, cron-connector, kafka-connector, minio, postgresql, kubernetes-dashboard, istio, and crossplane

Fixes: alexellis#133

Signed-off-by: wingkwong <wingkwong.code@gmail.com>
Add app info sub-command to show post install instructions for an app and the app homepage link, so that users don't have to unnecessarily install again to see them, which was the only way till now to see post install instructions.

This commit adds info for nginx-ingress, cert-manager, metrics-server, tiller, linkerd, cron-connector, kafka-connector, minio, postgresql, kubernetes-dashboard, istio, abd crossplane

Fixes: alexellis#133

Signed-off-by: wingkwong <wingkwong.code@gmail.com>
Copy link
Owner

@alexellis alexellis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, thank you for squashing the commits and for cleaning them up.

@alexellis alexellis merged commit 3a35061 into alexellis:master Feb 4, 2020
@alexellis
Copy link
Owner

Merged, thank you. I will kick off a release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants